this.bc = bc;
this.activator = activator;
}
public Object addingService(ServiceReference ref) {
Service service = (Service) this.bc.getService( ref );
System.out.println( "registering api : " + service + " : " + service.getClass().getInterfaces()[0] );
Dictionary dic = new Hashtable();
ServiceReference regServiceRef = this.activator.serviceRegistry.getReference();
for ( String key : regServiceRef.getPropertyKeys() ) {
dic.put( key,
regServiceRef.getProperty( key ) );
}
dic.put( service.getClass().getInterfaces()[0].getName(),
"true" );
activator.serviceRegistry.setProperties( dic );
((ServiceRegistryImpl) bc.getService( regServiceRef )).registerLocator( service.getClass().getInterfaces()[0],
new BundleContextInstantiator( this.bc,
ref ) );
return service;
}