掲示板

OSGi architecture documentation

7年前 に Dimitris Menounos によって更新されました。

OSGi architecture documentation

New Member 投稿: 1 参加年月日: 16/05/26 最新の投稿
Hello, I am studying the new architecture of the Liferay 7. Does a documentation page exists that describes the details of the integration between the OSGi and the application server containers? I have a lot of questions like the following:

Is the OSGi container being embedded in the same app server JVM process?
Are the portlets and ext plugins being loaded by an app server or an OSGi classloader?
Since now all modules are being converted to isolated osgi modules and deployed into the osgi container, is it possible use the standard app server services like EJBs, CDI, JPA, etc.?
How has the JSP compilation and execution been affected by the OSGi architecture?
How are the jar libraries in the ROOT/WEB-iNF/lib being used by the OSGi container?



Thank you
thumbnail
7年前 に Ray Augé によって更新されました。

RE: OSGi architecture documentation

Liferay Legend 投稿: 1197 参加年月日: 05/02/08 最新の投稿
Dimitris Menounos:

Is the OSGi container being embedded in the same app server JVM process?

Yes! But it's Liferay's own embedded framework. It's in no way related to the framework which may already exist in the app server.
Dimitris Menounos:

Are the portlets and ext plugins being loaded by an app server or an OSGi classloader?

Since they are OSGi bundles (we call them modules) they are loaded within an OSGi classloader.

(Note: ext is treated like before but we are getting far away from these. there are better, more maintainable ways to do _most_ of what ext could do.
Dimitris Menounos:

Since now all modules are being converted to isolated osgi modules and deployed into the osgi container, is it possible use the standard app server services like EJBs, CDI, JPA, etc.?

Some, but not any of the ones you explicitly mentioned! You may use JNDI, and a couple others. There _is_ a narrow avenue for configuring your way into access of some other app server services but I would recommend against that approach unless you are definitively locked down to a single app server (and never plan to migrate away from it). I would recommend taking the approach of getting your Liferay related work done within the OSGi framework Liferay bundles and if need be use a remoting technology of your choice to connect with external services that can provide other things you need.

Dimitris Menounos:

How has the JSP compilation and execution been affected by the OSGi architecture?

Liferay has it's own JSP compiler framework built on top of the JSP reference implementation (Glassfish Jasper). All jsps inside the OSGi runtime are handled through this mechanism. It contains enhancements such as a modular taglib framework based on OSGi's Requirements and Capabilities module which enables all the dynamics of OSGi.
Dimitris Menounos:

How are the jar libraries in the ROOT/WEB-iNF/lib being used by the OSGi container?

We've selected a specific subset of functionality that we export from the system bundle of our OSGi framework such that regardless of which app server Liferay is running on the inner world of our OSGi framework appears consistent. This enables the highest degree of cross app-server compatibility. Effectively this boils down to a list of java packages being exported from the system bundle via the system.packages.extra OSGi framework property.
7年前 に Dimitris Menounos によって更新されました。

RE: OSGi architecture documentation

New Member 投稿: 3 参加年月日: 16/06/13 最新の投稿
Hello Ray. You cleared many of my questions. Can you please elaborate more on the last item so as to have a better understanding.

There exists a portal-impl.jar inside /tomcat-8.0.32/webapps/ROOT/WEB-INF/lib which contains core packages like com.liferay.portal.* and com.liferay.portlet.*, for example com.liferay.portlet.blogs.*. Additionally there also exist several com.liferay.*.jar files inside/osgi/modules.

I understand that the latter are osgi bundles visible only to the osgi container. However, is the former (portal-impl.jar) also an osgi bundle? If it is why is it in the webapp lib folder? Moreover how are the contents of the portal-impl.jar related with the contents of the various com.liferay.*.jar bundles?

Thank you

PS. I am currently studying the transition of a project that has loads of customizations at both the ext and hook modules to the new architecture. So I need to obtain a deep knowledge of the inner workings between the app server and the osgi container.
thumbnail
7年前 に Ray Augé によって更新されました。

RE: OSGi architecture documentation

Liferay Legend 投稿: 1197 参加年月日: 05/02/08 最新の投稿
Dimitris Menounos:
There exists a portal-impl.jar inside /tomcat-8.0.32/webapps/ROOT/WEB-INF/lib which contains core packages like com.liferay.portal.* and com.liferay.portlet.*, for example com.liferay.portlet.blogs.*. Additionally there also exist several com.liferay.*.jar files inside/osgi/modules.

I understand that the latter are osgi bundles visible only to the osgi container. However, is the former (portal-impl.jar) also an osgi bundle? If it is why is it in the webapp lib folder? Moreover how are the contents of the portal-impl.jar related with the contents of the various com.liferay.*.jar bundles?

Portal-impl, though built as an OSGi bundle, is not used as one since it is still housing a significant amount of unmodularized code. It's still in the webapp dir because its code is plain webapp code. The various com.liferay.* bundles you see are either extracted and modularized from the original core or new features evolved from the redesign and pushed into the OSGi runtime.

We build pretty much all artifacts now as OSGi bundles because this gives us the power to baseline, which is our compatibility (a.k.a. semantic versioning) policeman.
7年前 に vikash gupta によって更新されました。

RE: OSGi architecture documentation

New Member 投稿: 8 参加年月日: 11/07/23 最新の投稿
Hi Ray,

I have another question regarding migrating CoreJSPhook. How we can load the class which is deployed as osgi bundle in CoreJSPhook module. i followed the article Overriding Core JSP in liferay 7 documentation and tried calling osgi service in JSP. but i am getting JSP compile error for the class. I understood by research that corejsp module can only load class which are in Global lib or root lib. Is there any way to load hook class or load another osgi module class in CoreJSP hook module?

Please help.

Thanks
Vikash