You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Fairouz Fakhfakh <fa...@hotmail.com> on 2012/02/23 00:07:01 UTC

Question iPOJO

Hello , 

 

I want to know how assign a property to
service in iPOJO ?

I know that in OSGI for
example:

  Properties props = new Properties();

  props.put("Language",
"English");

  context.registerService(DictionaryService.class.getName(),
new DictionaryImpl(), props);

 

And how search a reference of
service using this property?



Thank you for answering me.

Best regards,

 

 

--   

 Fairouz FAKHFAKH   

 Master student  

 Research group ReDCAD

 National School of
Engineers of Sfax , Tunisia

   

  		 	   		  

Re: Question iPOJO

Posted by Daoud Abdelmonem Faleh <ab...@gmail.com>.
On Thu, Feb 23, 2012 at 6:26 PM, Richard S. Hall <he...@ungoverned.org> wrote:
> On 2/23/12 12:22 , Daoud Abdelmonem Faleh wrote:
>>>>
>>>> Guys isn't that called Hooks in R4r3?
>>>
>>>
>>> No. Most people should completely ignore anything to do with any hooks in
>>> OSGi...
>>
>> Am asking because I can't seem to find ServiceTracker in R4r3 javadoc.
>> Was it removed or replaced?
>
>
> It is part of the compendium spec, not the core spec...it will actually be
> moved to the core spec in the next release.
>
> -> richard

Ah I see.. I see thanks Richard for your time and energy.

--Daoud.

>
>
>>
>> --Daoud.
>>
>>> Best to use a component framework like DS or iPOJO.
>>>
>>> ->  richard
>>>
>>>> HTH,
>>>> --Daoud.
>>>>
>>>>> Thank you for answering me.
>>>>>
>>>>> Best regards,
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>>
>>>>>  Fairouz FAKHFAKH
>>>>>
>>>>>  Master student
>>>>>
>>>>>  Research group ReDCAD
>>>>>
>>>>>  National School of
>>>>> Engineers of Sfax , Tunisia
>>>>>
>>>>>
>>>>>
>>>>>
>>>> ---------------------------------------------------------------------
>>>> 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
>>
>
> ---------------------------------------------------------------------
> 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: Question iPOJO

Posted by "Richard S. Hall" <he...@ungoverned.org>.
On 2/23/12 12:22 , Daoud Abdelmonem Faleh wrote:
>>> Guys isn't that called Hooks in R4r3?
>>
>> No. Most people should completely ignore anything to do with any hooks in
>> OSGi...
> Am asking because I can't seem to find ServiceTracker in R4r3 javadoc.
> Was it removed or replaced?

It is part of the compendium spec, not the core spec...it will actually 
be moved to the core spec in the next release.

-> richard

>
> --Daoud.
>
>> Best to use a component framework like DS or iPOJO.
>>
>> ->  richard
>>
>>> HTH,
>>> --Daoud.
>>>
>>>> Thank you for answering me.
>>>>
>>>> Best regards,
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>>
>>>>   Fairouz FAKHFAKH
>>>>
>>>>   Master student
>>>>
>>>>   Research group ReDCAD
>>>>
>>>>   National School of
>>>> Engineers of Sfax , Tunisia
>>>>
>>>>
>>>>
>>>>
>>> ---------------------------------------------------------------------
>>> 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
>

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


Re: Question iPOJO

Posted by Daoud Abdelmonem Faleh <ab...@gmail.com>.
>>
>> Guys isn't that called Hooks in R4r3?
>
>
> No. Most people should completely ignore anything to do with any hooks in
> OSGi...

Am asking because I can't seem to find ServiceTracker in R4r3 javadoc.
Was it removed or replaced?

--Daoud.

>
> Best to use a component framework like DS or iPOJO.
>
> -> richard
>
>>
>> HTH,
>> --Daoud.
>>
>>> Thank you for answering me.
>>>
>>> Best regards,
>>>
>>>
>>>
>>>
>>>
>>> --
>>>
>>>  Fairouz FAKHFAKH
>>>
>>>  Master student
>>>
>>>  Research group ReDCAD
>>>
>>>  National School of
>>> Engineers of Sfax , Tunisia
>>>
>>>
>>>
>>>
>> ---------------------------------------------------------------------
>> 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: Question iPOJO

Posted by "Richard S. Hall" <he...@ungoverned.org>.
On 2/22/12 21:59 , Daoud Abdelmonem Faleh wrote:
>>
>> And how search a reference of
>> service using this property?
>>
>>
> It worth noticing that the example you are providing is not iPOJO
> related it's plain OSGi.
>
> To answer your question:
> First you need a ServiceReference you can get it using where you give
> a filter with the required service parameters:
> http://www.osgi.org/javadoc/r4v43/org/osgi/framework/BundleContext.html#getServiceReferences(java.lang.Class,
> java.lang.String)
>
> then you get your service using:
> http://www.osgi.org/javadoc/r4v43/org/osgi/framework/BundleContext.html#getService(org.osgi.framework.ServiceReference)
>
> However this is not considered robust coding practice in OSGi world,
> you'd better look into ServiceTracker and whiteboard pattern
> http://www.osgi.org/wiki/uploads/Links/whiteboard.pdf
>
> Guys isn't that called Hooks in R4r3?

No. Most people should completely ignore anything to do with any hooks 
in OSGi...

Best to use a component framework like DS or iPOJO.

-> richard

>
> HTH,
> --Daoud.
>
>> Thank you for answering me.
>>
>> Best regards,
>>
>>
>>
>>
>>
>> --
>>
>>   Fairouz FAKHFAKH
>>
>>   Master student
>>
>>   Research group ReDCAD
>>
>>   National School of
>> Engineers of Sfax , Tunisia
>>
>>
>>
>>
> ---------------------------------------------------------------------
> 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: Question iPOJO

Posted by Daoud Abdelmonem Faleh <ab...@gmail.com>.
>
>
> And how search a reference of
> service using this property?
>
>
It worth noticing that the example you are providing is not iPOJO
related it's plain OSGi.

To answer your question:
First you need a ServiceReference you can get it using where you give
a filter with the required service parameters:
http://www.osgi.org/javadoc/r4v43/org/osgi/framework/BundleContext.html#getServiceReferences(java.lang.Class,
java.lang.String)

then you get your service using:
http://www.osgi.org/javadoc/r4v43/org/osgi/framework/BundleContext.html#getService(org.osgi.framework.ServiceReference)

However this is not considered robust coding practice in OSGi world,
you'd better look into ServiceTracker and whiteboard pattern
http://www.osgi.org/wiki/uploads/Links/whiteboard.pdf

Guys isn't that called Hooks in R4r3?

HTH,
--Daoud.

>
> Thank you for answering me.
>
> Best regards,
>
>
>
>
>
> --
>
>  Fairouz FAKHFAKH
>
>  Master student
>
>  Research group ReDCAD
>
>  National School of
> Engineers of Sfax , Tunisia
>
>
>
>

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