public boolean canDeployToComponent(String componentName) { Component comp = this.registry.getComponent(componentName); if (comp != null) { // TODO: check component state ServiceUnitManager mgr = comp.getComponent().getServiceUnitManager(); return mgr != null; } return false; }
public boolean isDeployedServiceUnit(String componentName, String suName) throws Exception { Component comp = this.registry.getComponent(componentName); if (comp != null) { Unit[] units = comp.getUnits(); for (int i = 0; i < units.length; i++) { if (units[i].getName().equals(suName)) { return true; } } } return false; }
public String[] getDeployedServiceUnitList(String componentName) throws Exception { Component component = this.registry.getComponent(componentName); if (component == null) { throw new JBIException("Component not installed: " + componentName); } Unit[] units = component.getUnits(); String[] names = new String[units.length]; for (int i = 0; i < units.length; i++) { names[i] = units[i].getName(); } return names; }
public String[] getDeployedServiceAssembliesForComponent(String componentName) throws Exception { Component component = this.registry.getComponent(componentName); if (component == null) { throw new JBIException("Component not installed: " + componentName); } if (component != null) { Unit[] units = component.getUnits(); Set names = new HashSet(); for (int i = 0; i < units.length; i++) { names.add(units[i].getAssembly().getName()); } return (String[]) names.toArray(new String[names.size()]); } return null; }