/** * If this is the last component calling stop, then stop the change services. * @param component the component */ public static void stop(Component component) { stop(component.getName()); }
/** * If this is the first component calling start, then start the change services. * @param component the component */ public static void start(Component component) { start(component.getName()); }
private Component initializeComponent(String className) throws Exception { Class<Component> clazz = (Class<Component>) getBundle().loadClass(className); Component component = clazz.newInstance(); // load configuration for a component - SY components all use the same package // naming conventions so grab the config name from the package name. For custom // components (non-SY), use the name of the component returned from Component.getName(). String configName = className.contains("org.switchyard.component") && className.indexOf(".deploy") > 0 ? className.substring(0, className.indexOf(".deploy")) : component.getName(); Configuration config = loadConfiguration(configName); // invoke the component's init method with config loaded from config admin - the // destroy() method is called in ComponentRegistryImpl.unregisterComponent() component.init(config); return component; }
private Component initializeComponent(String className) throws Exception { Class<Component> clazz = (Class<Component>) getBundle().loadClass(className); Component component = clazz.newInstance(); // load configuration for a component - SY components all use the same package // naming conventions so grab the config name from the package name. For custom // components (non-SY), use the name of the component returned from Component.getName(). String configName = className.contains("org.switchyard.component") && className.indexOf(".deploy") > 0 ? className.substring(0, className.indexOf(".deploy")) : component.getName(); Configuration config = loadConfiguration(configName); // invoke the component's init method with config loaded from config admin - the // destroy() method is called in ComponentRegistryImpl.unregisterComponent() component.init(config); return component; }