Skip to main content

relationship between application classloader and osgi module classloader

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
5 replies [Last post]
zhuixunzhe_sina
Offline
Joined: 2012-09-13

Hi everyone:

I'm now using GlassFish 3.1.2.2 OpenSource Edition, I want to know the relationship between application classloader and osgi module classloader. The application ClassLoader is used to loading ear or war archive deployed in server. The osgi moudle classLoader is used to load jars in folder ${install_dir}/glassfish/modules. In other words , how the osgi module based web container or ejb container communicate with the application deployed in it.

I have read the documents on http://docs.oracle.com/cd/E19226-01/820-7695/6niugesfp/index.html , but I'm not sure what classloader is used to load the modules. I debuged The glassfish source code ,I found that the APIClassLoader has a field named apiModuleLoader, It has a same parent classLoader with the bundleClassLoader。The bundleClassLoader is used to load modules.I want to konw this is right or not? If that's right, how the container communicate with he application in it? I’m very confusing.

Does anyone knows something about that? If you konw ,please help me or tell me more information. I would greatly appreciate your answer.

Wish you all the best. Thank you very much!

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
zhuixunzhe
Offline
Joined: 2009-12-22

Hi everyone:

I'm now using GlassFish 3.1.2.2 OpenSource Edition, I want to know the relationship between application classloader and osgi module classloader. The application ClassLoader is used to loading ear or war archive deployed in server. The osgi moudle classLoader is used to load jars in folder ${install_dir}/glassfish/modules. In other words , how the osgi module based web container or ejb container communicate with the application deployed in it.

I have read the documents on http://docs.oracle.com/cd/E19226-01/820-7695/6niugesfp/index.html , but I'm not sure what classloader is used to load the modules. I debuged The glassfish source code ,I found that the APIClassLoader has a field named apiModuleLoader, It has a same parent classLoader with the bundleClassLoader。The bundleClassLoader is used to load modules.I want to konw this is right or not? If that's right, how the container communicate with he application in it? I’m very confusing.

Does anyone knows something about that? If you konw ,please help me or tell me more information. I would greatly appreciate your answer.

Wish you all the best. Thank you very much!

friend using glaafish

mgainty
Offline
Joined: 2004-05-21

I assume you want to have the Glassfish Application Server felix container startup routines to pickup your newly minted OSGI jar?http://java.dzone.com/news/from-osgi-glassfish-5-steps

Martin Gainty
______________________________________________
Jogi és Bizalmassági kinyilatkoztatás/Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
Ez az
üzenet bizalmas. Ha nem ön az akinek szánva volt, akkor kérjük, hogy
jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának
készítése nem megengedett. Ez az üzenet csak ismeret cserét szolgál és
semmiféle jogi alkalmazhatósága sincs. Mivel az electronikus üzenetek
könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet
ezen üzenet tartalma miatt.

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.

Subject: relationship between application classloader and osgi module classloader
From: zhaoshanctgu.cn@163.com
To: users@glassfish.java.net
Date: Wed, 21 Nov 2012 16:32:12 +0000

Hi everyone: I'm now using GlassFish 3.1.2.2 OpenSource Edition, I want to know the relationship between application classloader and osgi module classloader. The application ClassLoader is used to loading ear or war archive deployed in server. The osgi moudle classLoader is used to load jars in folder ${install_dir}/glassfish/modules. In other words , how the osgi module based web container or ejb container communicate with the application deployed in it. I have read the documents on http://docs.oracle.com/cd/E19226-01/820-7695/6niugesfp/index.html , but I'm not sure what classloader is used to load the modules. I debuged The glassfish source code ,I found that the APIClassLoader has a field named apiModuleLoader, It has a same parent classLoader with the bundleClassLoader。The bundleClassLoader is used to load modules.I want to konw this is right or not? If that's right, how the container communicate with he application in it? I’m very confusing.
Does anyone knows something about that? If you konw ,please help me or tell me more information. I would greatly appreciate your answer.
Wish you all the best. Thank you very much! friend using glaafish

zhuixunzhe_sina
Offline
Joined: 2012-09-13

Thank you very much for your replay.

I have already developed my osgi jar and deployed it into glassfish. It can work very well. I just want to konw how the war or ear application communicating with the deployed bundles. Applications how to call the services in the osgi based bundles.

ss141213
Offline
Joined: 2005-03-30

Currently any Java EE applications can load classes from packages that
are exported by OSGi bundles. For them to consume OSGi services, they
have to be deployed as OSGi bundles. We call such applications as hybrid
applications. Refer to our OSGi doc [1] for details about how to develop
and deploy such applications.

Thanks,
Sahoo

[1] http://glassfish.java.net/public/GF-OSGi-Features.pdf

On Sunday 25 November 2012 11:50 AM, forums@java.net wrote:
> Thank you very much for your replay. I have already developed my osgi
> jar and
> deployed it into glassfish. It can work very well. I just want to konw
> how
> the war or ear application communicating with the deployed bundles.
> Applications how to call the services in the osgi based bundles.
>
> --
>
> [Message sent by forum member 'zhuixunzhe_sina']
>
> View Post: http://forums.java.net/node/892592
>
>

zhuixunzhe_sina
Offline
Joined: 2012-09-13

Thank you very much for your answer.

I have read this book ,and I also can develop and deploy hybrid applications, They worked very well too. But I also want to konw that general web or ejb applications have any way to communicate with the deployed glassfish bundles in folder ${install_dir}/glassfish/modules?

Wish all the best

Thanks