Play framework and OSGI

大憨熊 提交于 2019-12-12 07:48:03

问题


Is it possible to integrate play framework with OSGI to create plugable components? Did someone try it?


回答1:


If you mean "create Play modules with OSGi", then no, it's not supported

If you mean "deploy Play as an OSGi module" then no, it's not supported

And to be fair, there's no reason to push its support. You can read these thoughts from Spring founder on OSGi, as an example. OSGi would add extra complexity to Play, while the main aim of Play is to be a rapid development platform, simple to use, removing some Java conventions (like Sessions). It would kind of defeat the purpose.




回答2:


If we're discussing Play 2 then it's definitely worth acknowledging that an important and integral part of Play now is Akka, which could be seen as an alternative to OSGi. Philosophically I think Akka has a lot in common with the core principles of Play and Scala (a functional, stateless, NIO approach), while OSGi is more aligned with the Java EE/Spring camp.

That's not to say that Akka and OSGi are wholly mutually-exclusive: Akka's documentation suggests you can deploy Akka as an OSGi bundle and create some mutant app which has Akka actors firing up via an OSGi bundle.

But to answer the question, no, Play doesn't do OSGi, but it very much does do Akka.



来源:https://stackoverflow.com/questions/6604641/play-framework-and-osgi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!