/** * Set the class instance of the Component implementation for this BC or SE. * @param classInstance The Component class instance. */ public void setComponentInstance(javax.jbi.component.Component classInstance) { if ( null != classInstance ) { mComponentInstance = classInstance; mLifeCycleInstance = classInstance.getLifeCycle(); } }
public ComponentLifeCycle getLifeCycle() { if (lifeCycle == null) { lifeCycle = component.getLifeCycle(); } return lifeCycle; }
public ComponentLifeCycle getLifeCycle() { if (lifeCycle == null) { lifeCycle = component.getLifeCycle(); } return this; }
public ObjectName getExtensionMBeanName() throws JBIException { return component.getLifeCycle().getExtensionMBeanName(); }
private boolean isStarted(Component odeComponent) { boolean Result = true; try { // Get the ODE component started state by grabbing the internal field // of OdeLifeCycle. We cannot rely on the started state of the ODE // component bundle. // // TODO: add OdeLifeCycle.isStarted() and do a cast of odeComponent.getLifeCycle() accordingly. ComponentLifeCycle inst = odeComponent.getLifeCycle(); Field _started = inst.getClass().getDeclaredField("_started"); _started.setAccessible(true); Result = Boolean.TRUE.equals(_started.get(inst)); } catch (Exception e) { LOG.log(Level.WARNING, "Could not determine started state for ode component", e); } return Result; } }
/** * Register a service with the given metadata. * * @param component the component to register * @param properties the associated metadata */ @Override protected void doRegister(ComponentWrapper component, Map<String, ?> properties) throws JBIException { logger.info("JBI component registered with properties: {}", properties); ClassLoader cl = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(component.getClass().getClassLoader()); try { String name = (String) properties.get(NAME); ComponentContextImpl context = new ComponentContextImpl(this, component, properties); component.getComponent().getLifeCycle().init(context); if (name != null) { contexts.put(name, context); } else { logger.warn("Component has no name!"); } } finally { Thread.currentThread().setContextClassLoader(cl); } }
public void start(boolean saveState) throws JBIException { logger.info("Starting component " + getName()); if (state != State.Started) { if (state == State.Shutdown) { component.getLifeCycle().init(null); } fireEvent(LifeCycleEvent.LifeCycleEventType.Starting); component.getLifeCycle().start(); state = State.Started; if (saveState) { saveState(); } fireEvent(LifeCycleEvent.LifeCycleEventType.Started); } }
try { if (INIT.equals(action)) { getComponent().getLifeCycle().init(context); } else if (START.equals(action)) { getComponent().getLifeCycle().start(); } else if (STOP.equals(action)) { getComponent().getLifeCycle().stop(); } else if (SHUTDOWN.equals(action)) { getComponent().getLifeCycle().shutDown(); } else if (MBEANNAME.equals(action)) { objectName = getComponent().getLifeCycle().getExtensionMBeanName(); } else if (SHUTDOWNTHREAD.equals(action)) { result = false;
try { if (INIT.equals(action)) { getComponent().getLifeCycle().init(context); } else if (START.equals(action)) { getComponent().getLifeCycle().start(); } else if (STOP.equals(action)) { getComponent().getLifeCycle().stop(); } else if (SHUTDOWN.equals(action)) { getComponent().getLifeCycle().shutDown(); } else if (MBEANNAME.equals(action)) { objectName = getComponent().getLifeCycle() .getExtensionMBeanName(); } else if (SHUTDOWNTHREAD.equals(action)) {
public void stop(boolean saveState) throws JBIException { logger.info("Stopping component " + getName()); if (state == State.Started) { fireEvent(LifeCycleEvent.LifeCycleEventType.Stopping); // Stop component component.getLifeCycle().stop(); state = State.Stopped; if (saveState) { saveState(); } fireEvent(LifeCycleEvent.LifeCycleEventType.Stopped); } }
public void shutDown(boolean saveState, boolean force) throws JBIException { logger.info("Shutting down component " + getName()); if (state == State.Started) { stop(saveState); } if (state == State.Stopped) { fireEvent(LifeCycleEvent.LifeCycleEventType.ShuttingDown, force); // Shutdown component component.getLifeCycle().shutDown(); state = State.Shutdown; if (saveState) { saveState(); } fireEvent(LifeCycleEvent.LifeCycleEventType.ShutDown); } }
throw new javax.jbi.JBIException(msg); mLifeCycleInstance = mComponentInstance.getLifeCycle(); if ( null == mLifeCycleInstance )
if (this.componentContext.getComponent().getLifeCycle() != null) { ObjectName extName = this.componentContext.getComponent() .getLifeCycle().getExtensionMBeanName(); try { this.adminService.getMBeanServer().unregisterMBean(extName);
if (this.componentContext.getComponent().getLifeCycle() != null) { ObjectName extName = this.componentContext.getComponent().getLifeCycle() .getExtensionMBeanName(); if (extName != null) {