You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Dmitry Skavish <sk...@gmail.com> on 2009/06/16 20:58:48 UTC

extending SCR

Hello all,
I need to build something on top of DS. In particular I need to be able to
instantiate services not via default no-arg constructor, but say via some DI
framework (i.e. guice). Is it possible?

Thanks!

-- 
Dmitry Skavish

Re: extending SCR

Posted by Felix Meschberger <fm...@gmail.com>.
Hi,

Richard S. Hall schrieb:
> On 6/16/09 8:04 PM, Agemo Cui wrote:
>> Hi,
>>
>> DS is running in the lifecycle of a bundle.
>> When a bundle is installed, a classloader will be created anyways.
>> That's my understanding.
> 
> That is not necessarily the case.
> 
>> Otherwise how could SCR get the component descriptor? That descriptor
>> should be loaded by the classloader of the hosting bundle.
> 
> Resource loading can happen without a class loader using the
> Bundle.getResource() or Bundle.getEntry() method. I believe the spec
> says getEntry() must happen without a class loader, but the former is
> framework impl dependent. Felix doesn't use a class loader to load local
> resources, only if it delegates to another bundle to find a resource.

FYI: Currently our SCR implementation uses Bundle.getResource() but to
implement the ability to list components with wildcards (FELIX-928 [1])
I will change this to use Bundle.findEntries() and Bundle.getEntry().

Regards
Felix

[1] https://issues.apache.org/jira/browse/FELIX-928

> 
> -> richard
> 
>>
>> Regards,
>> Agemo
>>
>> On Jun 16, 2009, at 6:09 PM, Dmitry Skavish wrote:
>>
>>> Felix, yes, of course, with SCR a bundle has to be started, but if
>>> there is
>>> no BundleActivator, as usually the case if you use only DS, then the
>>> framework does not even create a classloader. At least that is my
>>> understanding.
>>>
>>> On Tue, Jun 16, 2009 at 6:04 PM, Felix Meschberger
>>> <fm...@gmail.com>wrote:
>>>
>>>> Hi,
>>>>
>>>> well, for SCR, too, you have to start the bundle for the components to
>>>> be registered. But, yes, the instantiation of the services may be
>>>> delayed.
>>>>
>>>> Regards
>>>> Felix
>>>>
>>>> Dmitry Skavish schrieb:
>>>>> As far as I understand Peaberry does exactly that. The only problem
>>>>> with
>>>> it
>>>>> is that I need to start my bundle to register my services which is not
>>>> good
>>>>> if I have hundreds of services, but only few of them are used at a
>>>>> time.
>>>>> That is no lazyness. DS supports lazyness, but no constructor DI :(
>>>>> On Tue, Jun 16, 2009 at 5:41 PM, Felix Meschberger <fmeschbe@gmail.com
>>>>> wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> Dmitry Skavish schrieb:
>>>>>>> Sorry if it's not clear, I will try to explain.
>>>>>>> Let's say I have a component (DS component). This component will be
>>>>>> created
>>>>>>> by SCR by its public no-arg constructor. What I want is to take
>>>>>>> control
>>>>>> over
>>>>>>> this instantiation, for example to inject guice components through
>>>>>> @Inject
>>>>>>> constructor.
>>>>>> I am not really sure, whether it makes sense to mix technologies
>>>>>> on this
>>>>>> level.
>>>>>>
>>>>>> DS provide functionality to fully describe components and inject
>>>>>> dependencies, which are OSGi services.
>>>>>>
>>>>>> Adding @Inject to this game would require further descriptors and
>>>>>> probably further registries ... Maybe I am wrong ...
>>>>>>
>>>>>> Regards
>>>>>> Felix
>>>>>>
>>>>>>> I am not sure I can do it with iPOJO, but even if I could I
>>>>>>> cannot use
>>>> it
>>>>>>> because of bytecode weaving (we are constrained here).
>>>>>>>
>>>>>>> Basically I like DS and would like to use DS, but I also need
>>>> constructor
>>>>>>> injection.
>>>>>>>
>>>>>>> I will look into peaberry closer, I was under impression that it
>>>>>>> lacks
>>>>>> some
>>>>>>> of the DS features.
>>>>>>>
>>>>>>> On Tue, Jun 16, 2009 at 4:18 PM, Felix Meschberger
>>>>>>> <fmeschbe@gmail.com
>>>>>>> wrote:
>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> Dmitry Skavish schrieb:
>>>>>>>>> Hello all,
>>>>>>>>> I need to build something on top of DS. In particular I need to be
>>>> able
>>>>>>>> to
>>>>>>>>> instantiate services not via default no-arg constructor, but
>>>>>>>>> say via
>>>>>> some
>>>>>>>> DI
>>>>>>>>> framework (i.e. guice). Is it possible?
>>>>>>>> I do not exactly understand your requirement.
>>>>>>>>
>>>>>>>> Maybe standard DS is not what you are looking for but for example
>>>> iPOJO
>>>>>>>> or Peaberry/Guice ?
>>>>>>>>
>>>>>>>> Regards
>>>>>>>> Felix
>>>>>>>>
>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>
>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>>>>>>> For additional commands, e-mail: users-help@felix.apache.org
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>>>>> For additional commands, e-mail: users-help@felix.apache.org
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>>> For additional commands, e-mail: users-help@felix.apache.org
>>>>
>>>>
>>>
>>>
>>> -- 
>>> Dmitry Skavish
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: extending SCR

Posted by Agemo Cui <ag...@gamio.org>.
Got it.

Thanks, Richard.


Regards,
Agemo

On Jun 16, 2009, at 8:43 PM, Richard S. Hall wrote:

> On 6/16/09 8:04 PM, Agemo Cui wrote:
>> Hi,
>>
>> DS is running in the lifecycle of a bundle.
>> When a bundle is installed, a classloader will be created anyways.
>> That's my understanding.
>
> That is not necessarily the case.
>
>> Otherwise how could SCR get the component descriptor? That  
>> descriptor should be loaded by the classloader of the hosting bundle.
>
> Resource loading can happen without a class loader using the  
> Bundle.getResource() or Bundle.getEntry() method. I believe the spec  
> says getEntry() must happen without a class loader, but the former  
> is framework impl dependent. Felix doesn't use a class loader to  
> load local resources, only if it delegates to another bundle to find  
> a resource.
>
> -> richard
>
>>
>> Regards,
>> Agemo
>>
>> On Jun 16, 2009, at 6:09 PM, Dmitry Skavish wrote:
>>
>>> Felix, yes, of course, with SCR a bundle has to be started, but if  
>>> there is
>>> no BundleActivator, as usually the case if you use only DS, then the
>>> framework does not even create a classloader. At least that is my
>>> understanding.
>>>
>>> On Tue, Jun 16, 2009 at 6:04 PM, Felix Meschberger <fmeschbe@gmail.com 
>>> >wrote:
>>>
>>>> Hi,
>>>>
>>>> well, for SCR, too, you have to start the bundle for the  
>>>> components to
>>>> be registered. But, yes, the instantiation of the services may be  
>>>> delayed.
>>>>
>>>> Regards
>>>> Felix
>>>>
>>>> Dmitry Skavish schrieb:
>>>>> As far as I understand Peaberry does exactly that. The only  
>>>>> problem with
>>>> it
>>>>> is that I need to start my bundle to register my services which  
>>>>> is not
>>>> good
>>>>> if I have hundreds of services, but only few of them are used at  
>>>>> a time.
>>>>> That is no lazyness. DS supports lazyness, but no constructor  
>>>>> DI :(
>>>>> On Tue, Jun 16, 2009 at 5:41 PM, Felix Meschberger <fmeschbe@gmail.com
>>>>> wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> Dmitry Skavish schrieb:
>>>>>>> Sorry if it's not clear, I will try to explain.
>>>>>>> Let's say I have a component (DS component). This component  
>>>>>>> will be
>>>>>> created
>>>>>>> by SCR by its public no-arg constructor. What I want is to  
>>>>>>> take control
>>>>>> over
>>>>>>> this instantiation, for example to inject guice components  
>>>>>>> through
>>>>>> @Inject
>>>>>>> constructor.
>>>>>> I am not really sure, whether it makes sense to mix  
>>>>>> technologies on this
>>>>>> level.
>>>>>>
>>>>>> DS provide functionality to fully describe components and inject
>>>>>> dependencies, which are OSGi services.
>>>>>>
>>>>>> Adding @Inject to this game would require further descriptors and
>>>>>> probably further registries ... Maybe I am wrong ...
>>>>>>
>>>>>> Regards
>>>>>> Felix
>>>>>>
>>>>>>> I am not sure I can do it with iPOJO, but even if I could I  
>>>>>>> cannot use
>>>> it
>>>>>>> because of bytecode weaving (we are constrained here).
>>>>>>>
>>>>>>> Basically I like DS and would like to use DS, but I also need
>>>> constructor
>>>>>>> injection.
>>>>>>>
>>>>>>> I will look into peaberry closer, I was under impression that  
>>>>>>> it lacks
>>>>>> some
>>>>>>> of the DS features.
>>>>>>>
>>>>>>> On Tue, Jun 16, 2009 at 4:18 PM, Felix Meschberger <fmeschbe@gmail.com
>>>>>>> wrote:
>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> Dmitry Skavish schrieb:
>>>>>>>>> Hello all,
>>>>>>>>> I need to build something on top of DS. In particular I need  
>>>>>>>>> to be
>>>> able
>>>>>>>> to
>>>>>>>>> instantiate services not via default no-arg constructor, but  
>>>>>>>>> say via
>>>>>> some
>>>>>>>> DI
>>>>>>>>> framework (i.e. guice). Is it possible?
>>>>>>>> I do not exactly understand your requirement.
>>>>>>>>
>>>>>>>> Maybe standard DS is not what you are looking for but for  
>>>>>>>> example
>>>> iPOJO
>>>>>>>> or Peaberry/Guice ?
>>>>>>>>
>>>>>>>> Regards
>>>>>>>> Felix
>>>>>>>>
>>>>>>>> ---------------------------------------------------------------------
>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>>>>>>> For additional commands, e-mail: users-help@felix.apache.org
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>>>>> For additional commands, e-mail: users-help@felix.apache.org
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>>> For additional commands, e-mail: users-help@felix.apache.org
>>>>
>>>>
>>>
>>>
>>> -- 
>>> Dmitry Skavish
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: extending SCR

Posted by "Richard S. Hall" <he...@ungoverned.org>.
On 6/16/09 8:04 PM, Agemo Cui wrote:
> Hi,
>
> DS is running in the lifecycle of a bundle.
> When a bundle is installed, a classloader will be created anyways.
> That's my understanding.

That is not necessarily the case.

> Otherwise how could SCR get the component descriptor? That descriptor 
> should be loaded by the classloader of the hosting bundle.

Resource loading can happen without a class loader using the 
Bundle.getResource() or Bundle.getEntry() method. I believe the spec 
says getEntry() must happen without a class loader, but the former is 
framework impl dependent. Felix doesn't use a class loader to load local 
resources, only if it delegates to another bundle to find a resource.

-> richard

>
> Regards,
> Agemo
>
> On Jun 16, 2009, at 6:09 PM, Dmitry Skavish wrote:
>
>> Felix, yes, of course, with SCR a bundle has to be started, but if 
>> there is
>> no BundleActivator, as usually the case if you use only DS, then the
>> framework does not even create a classloader. At least that is my
>> understanding.
>>
>> On Tue, Jun 16, 2009 at 6:04 PM, Felix Meschberger 
>> <fm...@gmail.com>wrote:
>>
>>> Hi,
>>>
>>> well, for SCR, too, you have to start the bundle for the components to
>>> be registered. But, yes, the instantiation of the services may be 
>>> delayed.
>>>
>>> Regards
>>> Felix
>>>
>>> Dmitry Skavish schrieb:
>>>> As far as I understand Peaberry does exactly that. The only problem 
>>>> with
>>> it
>>>> is that I need to start my bundle to register my services which is not
>>> good
>>>> if I have hundreds of services, but only few of them are used at a 
>>>> time.
>>>> That is no lazyness. DS supports lazyness, but no constructor DI :(
>>>> On Tue, Jun 16, 2009 at 5:41 PM, Felix Meschberger <fmeschbe@gmail.com
>>>> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> Dmitry Skavish schrieb:
>>>>>> Sorry if it's not clear, I will try to explain.
>>>>>> Let's say I have a component (DS component). This component will be
>>>>> created
>>>>>> by SCR by its public no-arg constructor. What I want is to take 
>>>>>> control
>>>>> over
>>>>>> this instantiation, for example to inject guice components through
>>>>> @Inject
>>>>>> constructor.
>>>>> I am not really sure, whether it makes sense to mix technologies 
>>>>> on this
>>>>> level.
>>>>>
>>>>> DS provide functionality to fully describe components and inject
>>>>> dependencies, which are OSGi services.
>>>>>
>>>>> Adding @Inject to this game would require further descriptors and
>>>>> probably further registries ... Maybe I am wrong ...
>>>>>
>>>>> Regards
>>>>> Felix
>>>>>
>>>>>> I am not sure I can do it with iPOJO, but even if I could I 
>>>>>> cannot use
>>> it
>>>>>> because of bytecode weaving (we are constrained here).
>>>>>>
>>>>>> Basically I like DS and would like to use DS, but I also need
>>> constructor
>>>>>> injection.
>>>>>>
>>>>>> I will look into peaberry closer, I was under impression that it 
>>>>>> lacks
>>>>> some
>>>>>> of the DS features.
>>>>>>
>>>>>> On Tue, Jun 16, 2009 at 4:18 PM, Felix Meschberger 
>>>>>> <fmeschbe@gmail.com
>>>>>> wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> Dmitry Skavish schrieb:
>>>>>>>> Hello all,
>>>>>>>> I need to build something on top of DS. In particular I need to be
>>> able
>>>>>>> to
>>>>>>>> instantiate services not via default no-arg constructor, but 
>>>>>>>> say via
>>>>> some
>>>>>>> DI
>>>>>>>> framework (i.e. guice). Is it possible?
>>>>>>> I do not exactly understand your requirement.
>>>>>>>
>>>>>>> Maybe standard DS is not what you are looking for but for example
>>> iPOJO
>>>>>>> or Peaberry/Guice ?
>>>>>>>
>>>>>>> Regards
>>>>>>> Felix
>>>>>>>
>>>>>>> --------------------------------------------------------------------- 
>>>>>>>
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>>>>>> For additional commands, e-mail: users-help@felix.apache.org
>>>>>>>
>>>>>>>
>>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>>>> For additional commands, e-mail: users-help@felix.apache.org
>>>>>
>>>>>
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>> For additional commands, e-mail: users-help@felix.apache.org
>>>
>>>
>>
>>
>> -- 
>> Dmitry Skavish
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: extending SCR

Posted by Agemo Cui <ag...@gamio.org>.
Hi,

DS is running in the lifecycle of a bundle.
When a bundle is installed, a classloader will be created anyways.
That's my understanding.
Otherwise how could SCR get the component descriptor? That descriptor  
should be loaded by the classloader of the hosting bundle.

Regards,
Agemo

On Jun 16, 2009, at 6:09 PM, Dmitry Skavish wrote:

> Felix, yes, of course, with SCR a bundle has to be started, but if  
> there is
> no BundleActivator, as usually the case if you use only DS, then the
> framework does not even create a classloader. At least that is my
> understanding.
>
> On Tue, Jun 16, 2009 at 6:04 PM, Felix Meschberger  
> <fm...@gmail.com>wrote:
>
>> Hi,
>>
>> well, for SCR, too, you have to start the bundle for the components  
>> to
>> be registered. But, yes, the instantiation of the services may be  
>> delayed.
>>
>> Regards
>> Felix
>>
>> Dmitry Skavish schrieb:
>>> As far as I understand Peaberry does exactly that. The only  
>>> problem with
>> it
>>> is that I need to start my bundle to register my services which is  
>>> not
>> good
>>> if I have hundreds of services, but only few of them are used at a  
>>> time.
>>> That is no lazyness. DS supports lazyness, but no constructor DI :(
>>> On Tue, Jun 16, 2009 at 5:41 PM, Felix Meschberger <fmeschbe@gmail.com
>>> wrote:
>>>
>>>> Hi,
>>>>
>>>> Dmitry Skavish schrieb:
>>>>> Sorry if it's not clear, I will try to explain.
>>>>> Let's say I have a component (DS component). This component will  
>>>>> be
>>>> created
>>>>> by SCR by its public no-arg constructor. What I want is to take  
>>>>> control
>>>> over
>>>>> this instantiation, for example to inject guice components through
>>>> @Inject
>>>>> constructor.
>>>> I am not really sure, whether it makes sense to mix technologies  
>>>> on this
>>>> level.
>>>>
>>>> DS provide functionality to fully describe components and inject
>>>> dependencies, which are OSGi services.
>>>>
>>>> Adding @Inject to this game would require further descriptors and
>>>> probably further registries ... Maybe I am wrong ...
>>>>
>>>> Regards
>>>> Felix
>>>>
>>>>> I am not sure I can do it with iPOJO, but even if I could I  
>>>>> cannot use
>> it
>>>>> because of bytecode weaving (we are constrained here).
>>>>>
>>>>> Basically I like DS and would like to use DS, but I also need
>> constructor
>>>>> injection.
>>>>>
>>>>> I will look into peaberry closer, I was under impression that it  
>>>>> lacks
>>>> some
>>>>> of the DS features.
>>>>>
>>>>> On Tue, Jun 16, 2009 at 4:18 PM, Felix Meschberger <fmeschbe@gmail.com
>>>>> wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> Dmitry Skavish schrieb:
>>>>>>> Hello all,
>>>>>>> I need to build something on top of DS. In particular I need  
>>>>>>> to be
>> able
>>>>>> to
>>>>>>> instantiate services not via default no-arg constructor, but  
>>>>>>> say via
>>>> some
>>>>>> DI
>>>>>>> framework (i.e. guice). Is it possible?
>>>>>> I do not exactly understand your requirement.
>>>>>>
>>>>>> Maybe standard DS is not what you are looking for but for example
>> iPOJO
>>>>>> or Peaberry/Guice ?
>>>>>>
>>>>>> Regards
>>>>>> Felix
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>>>>> For additional commands, e-mail: users-help@felix.apache.org
>>>>>>
>>>>>>
>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>>> For additional commands, e-mail: users-help@felix.apache.org
>>>>
>>>>
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>>
>
>
> -- 
> Dmitry Skavish


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: extending SCR

Posted by Dmitry Skavish <sk...@gmail.com>.
Felix, yes, of course, with SCR a bundle has to be started, but if there is
no BundleActivator, as usually the case if you use only DS, then the
framework does not even create a classloader. At least that is my
understanding.

On Tue, Jun 16, 2009 at 6:04 PM, Felix Meschberger <fm...@gmail.com>wrote:

> Hi,
>
> well, for SCR, too, you have to start the bundle for the components to
> be registered. But, yes, the instantiation of the services may be delayed.
>
> Regards
> Felix
>
> Dmitry Skavish schrieb:
> > As far as I understand Peaberry does exactly that. The only problem with
> it
> > is that I need to start my bundle to register my services which is not
> good
> > if I have hundreds of services, but only few of them are used at a time.
> > That is no lazyness. DS supports lazyness, but no constructor DI :(
> > On Tue, Jun 16, 2009 at 5:41 PM, Felix Meschberger <fmeschbe@gmail.com
> >wrote:
> >
> >> Hi,
> >>
> >> Dmitry Skavish schrieb:
> >>> Sorry if it's not clear, I will try to explain.
> >>> Let's say I have a component (DS component). This component will be
> >> created
> >>> by SCR by its public no-arg constructor. What I want is to take control
> >> over
> >>> this instantiation, for example to inject guice components through
> >> @Inject
> >>> constructor.
> >> I am not really sure, whether it makes sense to mix technologies on this
> >> level.
> >>
> >> DS provide functionality to fully describe components and inject
> >> dependencies, which are OSGi services.
> >>
> >> Adding @Inject to this game would require further descriptors and
> >> probably further registries ... Maybe I am wrong ...
> >>
> >> Regards
> >> Felix
> >>
> >>> I am not sure I can do it with iPOJO, but even if I could I cannot use
> it
> >>> because of bytecode weaving (we are constrained here).
> >>>
> >>> Basically I like DS and would like to use DS, but I also need
> constructor
> >>> injection.
> >>>
> >>> I will look into peaberry closer, I was under impression that it lacks
> >> some
> >>> of the DS features.
> >>>
> >>> On Tue, Jun 16, 2009 at 4:18 PM, Felix Meschberger <fmeschbe@gmail.com
> >>> wrote:
> >>>
> >>>> Hi,
> >>>>
> >>>> Dmitry Skavish schrieb:
> >>>>> Hello all,
> >>>>> I need to build something on top of DS. In particular I need to be
> able
> >>>> to
> >>>>> instantiate services not via default no-arg constructor, but say via
> >> some
> >>>> DI
> >>>>> framework (i.e. guice). Is it possible?
> >>>> I do not exactly understand your requirement.
> >>>>
> >>>> Maybe standard DS is not what you are looking for but for example
> iPOJO
> >>>> or Peaberry/Guice ?
> >>>>
> >>>> Regards
> >>>> Felix
> >>>>
> >>>> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> >>>> For additional commands, e-mail: users-help@felix.apache.org
> >>>>
> >>>>
> >>>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> >> For additional commands, e-mail: users-help@felix.apache.org
> >>
> >>
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>


-- 
Dmitry Skavish

Re: extending SCR

Posted by Felix Meschberger <fm...@gmail.com>.
Hi,

well, for SCR, too, you have to start the bundle for the components to
be registered. But, yes, the instantiation of the services may be delayed.

Regards
Felix

Dmitry Skavish schrieb:
> As far as I understand Peaberry does exactly that. The only problem with it
> is that I need to start my bundle to register my services which is not good
> if I have hundreds of services, but only few of them are used at a time.
> That is no lazyness. DS supports lazyness, but no constructor DI :(
> On Tue, Jun 16, 2009 at 5:41 PM, Felix Meschberger <fm...@gmail.com>wrote:
> 
>> Hi,
>>
>> Dmitry Skavish schrieb:
>>> Sorry if it's not clear, I will try to explain.
>>> Let's say I have a component (DS component). This component will be
>> created
>>> by SCR by its public no-arg constructor. What I want is to take control
>> over
>>> this instantiation, for example to inject guice components through
>> @Inject
>>> constructor.
>> I am not really sure, whether it makes sense to mix technologies on this
>> level.
>>
>> DS provide functionality to fully describe components and inject
>> dependencies, which are OSGi services.
>>
>> Adding @Inject to this game would require further descriptors and
>> probably further registries ... Maybe I am wrong ...
>>
>> Regards
>> Felix
>>
>>> I am not sure I can do it with iPOJO, but even if I could I cannot use it
>>> because of bytecode weaving (we are constrained here).
>>>
>>> Basically I like DS and would like to use DS, but I also need constructor
>>> injection.
>>>
>>> I will look into peaberry closer, I was under impression that it lacks
>> some
>>> of the DS features.
>>>
>>> On Tue, Jun 16, 2009 at 4:18 PM, Felix Meschberger <fmeschbe@gmail.com
>>> wrote:
>>>
>>>> Hi,
>>>>
>>>> Dmitry Skavish schrieb:
>>>>> Hello all,
>>>>> I need to build something on top of DS. In particular I need to be able
>>>> to
>>>>> instantiate services not via default no-arg constructor, but say via
>> some
>>>> DI
>>>>> framework (i.e. guice). Is it possible?
>>>> I do not exactly understand your requirement.
>>>>
>>>> Maybe standard DS is not what you are looking for but for example iPOJO
>>>> or Peaberry/Guice ?
>>>>
>>>> Regards
>>>> Felix
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>>> For additional commands, e-mail: users-help@felix.apache.org
>>>>
>>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>>
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: extending SCR

Posted by Dmitry Skavish <sk...@gmail.com>.
As far as I understand Peaberry does exactly that. The only problem with it
is that I need to start my bundle to register my services which is not good
if I have hundreds of services, but only few of them are used at a time.
That is no lazyness. DS supports lazyness, but no constructor DI :(
On Tue, Jun 16, 2009 at 5:41 PM, Felix Meschberger <fm...@gmail.com>wrote:

> Hi,
>
> Dmitry Skavish schrieb:
> > Sorry if it's not clear, I will try to explain.
> > Let's say I have a component (DS component). This component will be
> created
> > by SCR by its public no-arg constructor. What I want is to take control
> over
> > this instantiation, for example to inject guice components through
> @Inject
> > constructor.
>
> I am not really sure, whether it makes sense to mix technologies on this
> level.
>
> DS provide functionality to fully describe components and inject
> dependencies, which are OSGi services.
>
> Adding @Inject to this game would require further descriptors and
> probably further registries ... Maybe I am wrong ...
>
> Regards
> Felix
>
> >
> > I am not sure I can do it with iPOJO, but even if I could I cannot use it
> > because of bytecode weaving (we are constrained here).
> >
> > Basically I like DS and would like to use DS, but I also need constructor
> > injection.
> >
> > I will look into peaberry closer, I was under impression that it lacks
> some
> > of the DS features.
> >
> > On Tue, Jun 16, 2009 at 4:18 PM, Felix Meschberger <fmeschbe@gmail.com
> >wrote:
> >
> >> Hi,
> >>
> >> Dmitry Skavish schrieb:
> >>> Hello all,
> >>> I need to build something on top of DS. In particular I need to be able
> >> to
> >>> instantiate services not via default no-arg constructor, but say via
> some
> >> DI
> >>> framework (i.e. guice). Is it possible?
> >> I do not exactly understand your requirement.
> >>
> >> Maybe standard DS is not what you are looking for but for example iPOJO
> >> or Peaberry/Guice ?
> >>
> >> Regards
> >> Felix
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> >> For additional commands, e-mail: users-help@felix.apache.org
> >>
> >>
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>


-- 
Dmitry Skavish

Re: extending SCR

Posted by Felix Meschberger <fm...@gmail.com>.
Hi,

Dmitry Skavish schrieb:
> Sorry if it's not clear, I will try to explain.
> Let's say I have a component (DS component). This component will be created
> by SCR by its public no-arg constructor. What I want is to take control over
> this instantiation, for example to inject guice components through @Inject
> constructor.

I am not really sure, whether it makes sense to mix technologies on this
level.

DS provide functionality to fully describe components and inject
dependencies, which are OSGi services.

Adding @Inject to this game would require further descriptors and
probably further registries ... Maybe I am wrong ...

Regards
Felix

> 
> I am not sure I can do it with iPOJO, but even if I could I cannot use it
> because of bytecode weaving (we are constrained here).
> 
> Basically I like DS and would like to use DS, but I also need constructor
> injection.
> 
> I will look into peaberry closer, I was under impression that it lacks some
> of the DS features.
> 
> On Tue, Jun 16, 2009 at 4:18 PM, Felix Meschberger <fm...@gmail.com>wrote:
> 
>> Hi,
>>
>> Dmitry Skavish schrieb:
>>> Hello all,
>>> I need to build something on top of DS. In particular I need to be able
>> to
>>> instantiate services not via default no-arg constructor, but say via some
>> DI
>>> framework (i.e. guice). Is it possible?
>> I do not exactly understand your requirement.
>>
>> Maybe standard DS is not what you are looking for but for example iPOJO
>> or Peaberry/Guice ?
>>
>> Regards
>> Felix
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>>
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: extending SCR

Posted by Dmitry Skavish <sk...@gmail.com>.
Sorry if it's not clear, I will try to explain.
Let's say I have a component (DS component). This component will be created
by SCR by its public no-arg constructor. What I want is to take control over
this instantiation, for example to inject guice components through @Inject
constructor.

I am not sure I can do it with iPOJO, but even if I could I cannot use it
because of bytecode weaving (we are constrained here).

Basically I like DS and would like to use DS, but I also need constructor
injection.

I will look into peaberry closer, I was under impression that it lacks some
of the DS features.

On Tue, Jun 16, 2009 at 4:18 PM, Felix Meschberger <fm...@gmail.com>wrote:

> Hi,
>
> Dmitry Skavish schrieb:
> > Hello all,
> > I need to build something on top of DS. In particular I need to be able
> to
> > instantiate services not via default no-arg constructor, but say via some
> DI
> > framework (i.e. guice). Is it possible?
>
> I do not exactly understand your requirement.
>
> Maybe standard DS is not what you are looking for but for example iPOJO
> or Peaberry/Guice ?
>
> Regards
> Felix
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>


-- 
Dmitry Skavish

Re: extending SCR

Posted by Felix Meschberger <fm...@gmail.com>.
Hi,

Dmitry Skavish schrieb:
> Hello all,
> I need to build something on top of DS. In particular I need to be able to
> instantiate services not via default no-arg constructor, but say via some DI
> framework (i.e. guice). Is it possible?

I do not exactly understand your requirement.

Maybe standard DS is not what you are looking for but for example iPOJO
or Peaberry/Guice ?

Regards
Felix

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org