/** * Create a service proxy for registering a provided service. */ public IInternalService createInternalService(Object service, Class<?> type) { // boolean moni = getComponentDescription().getMonitoring()!=null? getComponentDescription().getMonitoring().booleanValue(): false; PublishEventLevel elm = getComponentDescription().getMonitoring()!=null? getComponentDescription().getMonitoring(): null; // todo: remove this? currently the level cannot be turned on due to missing interceptor boolean moni = elm!=null && !PublishEventLevel.OFF.equals(elm); IInternalService is = BasicServiceInvocationHandler.createProvidedServiceProxy( getInternalAccess(), getComponentAdapter(), service, null, type, BasicServiceInvocationHandler.PROXYTYPE_DECOUPLED, null, isCopy(), isRealtime(), getModel().getResourceIdentifier(), moni, null); return is; }
/** * Terminate all extensions. */ public IFuture<Void> terminateExtensions() { // Hack!!! When init fails , terminateExtensions() can not be called on component thread // as component already terminated. assert !getComponentAdapter().isExternalThread() || IComponentDescription.STATE_TERMINATED.equals(getComponentDescription().getState()); Future<Void> ret = new Future<Void>(); IExtensionInstance[] exts = getExtensions(); CounterResultListener<Void> lis = new CounterResultListener<Void>(exts.length, false, new DelegationResultListener<Void>(ret)); for(int i=0; i<exts.length; i++) { exts[i].terminate().addResultListener(lis); } return ret; }
else if(getComponentDescription().getCause()!=null) event.setCause(getComponentDescription().getCause().createNext());//event.getSourceIdentifier().toString()));
event.setProperty("details", getComponentDescription());
final Future<IInternalService> ret = new Future<IInternalService>(); PublishEventLevel elm = getComponentDescription().getMonitoring()!=null? getComponentDescription().getMonitoring(): null;