You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by Sergey Beryozkin <sb...@gmail.com> on 2011/12/19 11:35:07 UTC

Activators for individual frontends

Hi KL, All,

On 16/12/11 22:34, K Fung wrote:

>> In 2.5.2 on later we can think of introducing an activator into the jaxrs
> frontend so that it can discover custom Applications and providers
> registered as OSGI services
>
> Perhaps we should have a discussion on a separate thread to discuss how you
> envision seeing this? In particular, I'm wondering what's the
> baseline/environment you think this would be running. For example, right
> now there is no activator in the CXF JAX-RS bundle but what are the
> consequence of an activator in 2.5.2+ - can it be disabled? Do we rely on
> the OSGI HttpService or do we use a built-in Jetty? Can we support both?
>
> I guess you can see that I'm pretty interested in this topic :-)

I was thinking earlier on that CXF can get a master/root activator which 
will provide BundleContext, etc to individual activators which say JAXWS 
and JAXRS frontends may offer; I think these activators will not act as 
independent activators on its own, they will simply be able to react to 
the information (BundleContext for ex) that the actual root activator 
may offer.
For example, in case of JAX-RS, this sub-activator will probably 
register ServiceTrackers and start listening for (JAX-RS) Application 
interfaces and then will create an endpoint by using HttpService or 
embedded Jetty, something like that

What do you think ?
Sergey

Re: Activators for individual frontends

Posted by Sergey Beryozkin <sb...@gmail.com>.
On 20/12/11 19:04, Daniel Kulp wrote:
> On Monday, December 19, 2011 10:35:07 AM Sergey Beryozkin wrote:
>> Hi KL, All,
>>
>> On 16/12/11 22:34, K Fung wrote:
>>>> In 2.5.2 on later we can think of introducing an activator into the
>>>> jaxrs>
>>> frontend so that it can discover custom Applications and providers
>>> registered as OSGI services
>>>
>>> Perhaps we should have a discussion on a separate thread to discuss how
>>> you envision seeing this? In particular, I'm wondering what's the
>>> baseline/environment you think this would be running. For example, right
>>> now there is no activator in the CXF JAX-RS bundle but what are the
>>> consequence of an activator in 2.5.2+ - can it be disabled? Do we rely
>>> on
>>> the OSGI HttpService or do we use a built-in Jetty? Can we support both?
>>>
>>> I guess you can see that I'm pretty interested in this topic :-)
>>
>> I was thinking earlier on that CXF can get a master/root activator which
>> will provide BundleContext, etc to individual activators which say JAXWS
>> and JAXRS frontends may offer; I think these activators will not act as
>> independent activators on its own, they will simply be able to react to
>> the information (BundleContext for ex) that the actual root activator
>> may offer.
>
> Well, we could have the current activator grab a list out of the current
> bundle (cxf-bundle) of other activators to instantiate and call.  For example,
> we could have a META-INF/cxf/osgi-activators.txt that is created during
> bundling (shade can do it) that the OSGiExtensionLocator thing will grab and
> then call the start/stop on it.

Super, this looks like a good way to start

> We'd only need to look in the current
> bundle.  Once we split into modules, the "core" bundle would not have that and
> thus wouldn't do anything, but the jaxrs bundle could properly define it's own
> activator in it's manifest.    This wouldn't be hard to do.
>
Yea;

Cheers, Sergey

> Dan
>
>> For example, in case of JAX-RS, this sub-activator will probably
>> register ServiceTrackers and start listening for (JAX-RS) Application
>> interfaces and then will create an endpoint by using HttpService or
>> embedded Jetty, something like that
>>
>> What do you think ?
>> Sergey


Re: Activators for individual frontends

Posted by Daniel Kulp <dk...@apache.org>.
On Monday, December 19, 2011 10:35:07 AM Sergey Beryozkin wrote:
> Hi KL, All,
> 
> On 16/12/11 22:34, K Fung wrote:
> >> In 2.5.2 on later we can think of introducing an activator into the
> >> jaxrs> 
> > frontend so that it can discover custom Applications and providers
> > registered as OSGI services
> > 
> > Perhaps we should have a discussion on a separate thread to discuss how
> > you envision seeing this? In particular, I'm wondering what's the
> > baseline/environment you think this would be running. For example, right
> > now there is no activator in the CXF JAX-RS bundle but what are the
> > consequence of an activator in 2.5.2+ - can it be disabled? Do we rely
> > on
> > the OSGI HttpService or do we use a built-in Jetty? Can we support both?
> > 
> > I guess you can see that I'm pretty interested in this topic :-)
> 
> I was thinking earlier on that CXF can get a master/root activator which
> will provide BundleContext, etc to individual activators which say JAXWS
> and JAXRS frontends may offer; I think these activators will not act as
> independent activators on its own, they will simply be able to react to
> the information (BundleContext for ex) that the actual root activator
> may offer.

Well, we could have the current activator grab a list out of the current 
bundle (cxf-bundle) of other activators to instantiate and call.  For example, 
we could have a META-INF/cxf/osgi-activators.txt that is created during 
bundling (shade can do it) that the OSGiExtensionLocator thing will grab and 
then call the start/stop on it.   We'd only need to look in the current 
bundle.  Once we split into modules, the "core" bundle would not have that and 
thus wouldn't do anything, but the jaxrs bundle could properly define it's own 
activator in it's manifest.    This wouldn't be hard to do.

Dan

> For example, in case of JAX-RS, this sub-activator will probably
> register ServiceTrackers and start listening for (JAX-RS) Application
> interfaces and then will create an endpoint by using HttpService or
> embedded Jetty, something like that
> 
> What do you think ?
> Sergey
-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com

Re: Activators for individual frontends

Posted by Sergey Beryozkin <sb...@gmail.com>.
On 19/12/11 10:35, Sergey Beryozkin wrote:
> Hi KL, All,
>
> On 16/12/11 22:34, K Fung wrote:
>
>>> In 2.5.2 on later we can think of introducing an activator into the
>>> jaxrs
>> frontend so that it can discover custom Applications and providers
>> registered as OSGI services
>>
>> Perhaps we should have a discussion on a separate thread to discuss
>> how you
>> envision seeing this? In particular, I'm wondering what's the
>> baseline/environment you think this would be running. For example, right
>> now there is no activator in the CXF JAX-RS bundle but what are the
>> consequence of an activator in 2.5.2+ - can it be disabled? Do we rely on
>> the OSGI HttpService or do we use a built-in Jetty? Can we support both?
>>
>> I guess you can see that I'm pretty interested in this topic :-)
>
> I was thinking earlier on that CXF can get a master/root activator which
> will provide BundleContext, etc to individual activators which say JAXWS
> and JAXRS frontends may offer; I think these activators will not act as
> independent activators on its own

I guess they actually may once we get individual modules OSGI-fied. But 
when get cxf-bundle or cxf-rs bundle deployed these activators are plain 
beans; I think they have to get hold of the root activator, which is 
org.apache.cxf.bus.osgi.OSGiExtensionLocator, and get BundleContext from 
it and do whatever they need to do - ServiceTrack(er) the Application 
interfaces, or in case of JAX-WS listening on bundles with jaxws 
annotations, something like that, etc.
IMHO that will be actually cool - will add a lot of dynamism, and it 
won't interfere with say the existing deployment model where we create 
blueprint or spring contexts

What I don't understand is how say OSGiExtensionLocator will pass 
BundleContext to frontend-specific Activator beans.

Sergey

>, they will simply be able to react to
> the information (BundleContext for ex) that the actual root activator
> may offer.
> For example, in case of JAX-RS, this sub-activator will probably
> register ServiceTrackers and start listening for (JAX-RS) Application
> interfaces and then will create an endpoint by using HttpService or
> embedded Jetty, something like that
>
> What do you think ?
> Sergey


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com