I want to expose 2 kinds of services.
1. Infrastructure Services :- POJOs that can do logging, auditing etc
2. Business Logic Services: POJOs that would have the business logic
written (called over JNI) based on our user input. For example: on
user input we would need to stop this POJO or create new ones (so that
they can be looked up by name) in runtime.
The methods exposed by these POJOs would be invoked either by servlets
or EJBs that are deployed in the application server. But these POJOs
need to be looked up by name over JNDI.
Is the OSGi service registry or the HK2 service registry available for
look up from some EJB or servlet that is running in the app server?
From what I have learned from the documentation and the samples is
that the HK2 or OSGi bundles are more for infrastructure services or
customizing the runtime and should not have business logic.
I know I have other options like writing the business logic in EJBs
but I wanted to know if there was a way to deploy these POJOs in the
environment without the overhead of the EJB container.
Thanks for the reply Sahoo...
-Shreyas
On Wed, Jun 4, 2008 at 10:51 PM, Sahoo <Sahoo_at_sun.com> wrote:
> I am assuming you are using GFv3. Writing HK2 or OSGi bundle is the only
> option. Since we don't publish any user defined services to JNDI by default,
> you have to do that. Let me ask a few questions to you.
> What is your use case?
> What kind of services are you going to publish to JNDI?
> How are you going to look them up from some other modules?
> Why do you want to communicate using JNDI and not the HK2 service
> registry(Habitat api) or OSGi service registry that's available when you run
> in GFv3?
>
> Thanks,
> Sahoo
>
> Shreyas Shinde wrote:
>>
>> Hello,
>>
>> I am trying to deploy POJOs (plain java classes) into the application
>> server so that I can access them by name over JNDI. I don't want to
>> use the EJB or the Servlet model for this and wanted to know if there
>> is any way I could do this.
>>
>> I have looked into writing service modules for HK2 and OSGi but I am
>> not sure if it is the right approach for this.
>>
>> Is there a good approach for doing this?
>>
>> Thanks,
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>
--
Shreyas