On 19.08.2010, at 17:43, Richard S. Hall wrote:

> Are you saying you have two bundles containing two component classes with the 
> same name and iPOJO ends up using the same component class to create both 
> instances?

Yes, that's normal in this case. Indeed, no factory name, so iPOJO use the 
class name to identify the factory.

So, to fix the issue, just set the factory as private with
@Component(public_factory=false)

Regards,

Clement


> 
> -> richard
> 
> On 8/19/10 10:46, Leos Kunc wrote:
>> Hi. I'm new in OSGI and IPOJO and last days I've spent looking for solution 
>> of
>> the following problem. I need to implement two versions of same class running
>> in simultaneously. I've created same class in two bundles and exported
>> interface as service by annotations:
>> 
>> @Provides
>> @Component
>> @Instantiate
>> public class Impl implements TestServiceIface {
>>      
>>      @Override
>>      public void printString(String arg0) {
>>              System.out.println(arg0 + "impl1");
>>      }
>> 
>> }
>> 
>> Problem is that if I do the same for both bundles, service is exported twice
>> for the bundle that is started first. So in the end I have one bundle which
>> exports the service twice and one bundle that exports no service and therefor
>> second implementation is not accessible at all.
>>   Is there any way in IPOJO to export two versions of same class?
>> 
>> best regards
>> 
>> Leos Kunc
>> 
>> 
>> This e-mail and any attachment is for authorised use by the intended 
>> recipient(s) only. It may contain proprietary material, confidential 
>> information and/or be subject to legal privilege. It should not be copied, 
>> disclosed to, retained or used by, any other party. If you are not an 
>> intended recipient then please promptly delete this e-mail and any 
>> attachment and all copies and inform the sender. Thank you.
>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 

Reply via email to