/** * If set true, this OSGiComponent will register itself when start() is * called, or immediately if start has already been called. If set false * and the component is already registered, it will be unregistered. * By default this is set to true. * @param enabled true to enable self-registration of the OSGiComponent */ public void setSelfRegistrationEnabled(boolean enabled){ mySelfRegistrationEnabledFlag = enabled; if(mySelfRegistrationEnabledFlag && mySelfRegistration == null){ registerSelf(); }else if(!mySelfRegistrationEnabledFlag && myServiceRegistration != null){ unregisterSelf(); } } /**
@Override public void dispose(){ getLogger().info("Disposing of OSGi Component with class {}", this.getClass()); getLogger().debug("Component Detail {}", myService); stopLifecycle(); clearAllListeners(); if(myDependenciesTracker != null){ myDependenciesTracker.dispose(); myDependenciesTracker = null; } unregister(); unregisterSelf(); myContext = null; if(myRegistrationProperties != null){ myRegistrationProperties.clear(); } if(myUniqueProperties != null){ myUniqueProperties.clear(); } myRegistrationClassNames = null; myLifecycleProvider = null; myService = null; } /**