/** * Check the target component: must be installed and started * * @param targetComponent * the targeted component name * @throws PetalsException * if the target component is not installed and started */ private boolean isTargetedComponentStartedOrStopped(String targetComponent) throws PetalsException { boolean result = false; ComponentLifeCycleMBean componentLifeCycle; if (adminService.isBinding(targetComponent)) { componentLifeCycle = adminService.getBindingComponentLifeCycleByName(targetComponent); } else { componentLifeCycle = adminService.getEngineComponentLifeCycleByName(targetComponent); } if (componentLifeCycle != null) { String currentState = componentLifeCycle.getCurrentState(); if (LifeCycleMBean.STARTED.equals(currentState) || LifeCycleMBean.STOPPED.equals(currentState)) { result = true; } } return result; }
public boolean startComponent(final String componentName) throws JBIException { this.log.start("Component Name : " + componentName); ParameterCheckHelper .isNullOrEmptyParameterWithLog(componentName, "componentName", this.log); ComponentLifeCycleMBean componentLifeCycle = null; if (this.adminService.isEngine(componentName)) { componentLifeCycle = this.adminService.getEngineComponentLifeCycleByName(componentName); } else { componentLifeCycle = this.adminService .getBindingComponentLifeCycleByName(componentName); } try { if (componentLifeCycle != null) { componentLifeCycle.start(); } else { throw new JBIException("The component '" + componentName + "' is not installed"); } } catch (final JBIException e) { this.log.error("Unable to start the component '" + componentName + "'", e); throw e; } this.log.info("Component '" + componentName + "' started"); this.log.end(); return true; }
componentLifeCycle.stop(); } finally { ((ComponentLifeCycle) componentLifeCycle).setForcedState(false);
componentLifeCycle.shutDown(); } finally { ((ComponentLifeCycle) componentLifeCycle).setForcedState(false);
ComponentLifeCycleMBean clc = lc.get(name); org.ow2.petals.kernel.ws.api.to.Component c = new org.ow2.petals.kernel.ws.api.to.Component(); c.setState(clc.getCurrentState()); c.setName(name); c.setType(BINDING); ComponentLifeCycleMBean clc = lc.get(name); org.ow2.petals.kernel.ws.api.to.Component c = new org.ow2.petals.kernel.ws.api.to.Component(); c.setState(clc.getCurrentState()); c.setName(name); c.setType(ENGINE);
private void forceShutdownComponent(String componentName) throws JBIException { this.log.call(); ComponentLifeCycleMBean componentLifeCycle = null; if (this.adminService.isEngine(componentName)) { componentLifeCycle = this.adminService.getEngineComponentLifeCycleByName(componentName); } else { componentLifeCycle = this.adminService .getBindingComponentLifeCycleByName(componentName); } if (componentLifeCycle != null) { final String compState = componentLifeCycle.getCurrentState(); if (javax.jbi.management.LifeCycleMBean.STARTED.equals(compState)) { this.stopComponent(componentName, true); this.shutdownComponent(componentName, true); } else if (javax.jbi.management.LifeCycleMBean.STOPPED.equals(compState)) { this.shutdownComponent(componentName, true); } } }
String componentState = componentLifeCycle.getCurrentState(); if ((INSTALLED.equals(this.state)) && (LifeCycleMBean.SHUTDOWN.equals(componentState) || LifeCycleMBean.UNKNOWN