this.activator = activator;
this.serviceClass = serviceClass;
}
public Object addingService(ServiceReference ref) {
Service service = (Service) this.bc.getService( ref );
logger.info( "registering compiler : " + service + " : " + service.getClass().getInterfaces()[0] );
Dictionary dic = new Hashtable();
ServiceReference regServiceRef = this.activator.kbuilderReg.getReference();
for ( String key : regServiceRef.getPropertyKeys() ) {
dic.put( key,
regServiceRef.getProperty( key ) );
}
dic.put( service.getClass().getInterfaces()[0].getName(),
"true" );
activator.kbuilderReg.setProperties( dic );
ServiceRegistryImpl.getInstance().registerLocator( serviceClass != null ? serviceClass : service.getClass().getInterfaces()[0],
new BundleContextInstantiator( this.bc,
ref ) );
return service;
}