static public DeployableUnitInfo toDeployableUnitInfo(DeployableUnitDescriptor deployableUnitDescriptor) { String id = toString(deployableUnitDescriptor.getID()); /* * ammendonca ; if (deployableUnitDescriptor instanceof * DeployableUnitDescriptorEx) id = toString(((DeployableUnitDescriptorEx) * deployableUnitDescriptor) .getDeployableUnitID()); else id = null; */ return new DeployableUnitInfo(ComponentInfoUtils.toStringArray(deployableUnitDescriptor.getComponents()), deployableUnitDescriptor.getDeploymentDate(), deployableUnitDescriptor.getURL(), getDeployableUnitName(deployableUnitDescriptor), id); }
public ComponentID[] getComponents() { return deployableUnitDescriptor.getComponents(); }
public String getURL() { return deployableUnitDescriptor.getURL(); }
public Date getDeploymentDate() { return deployableUnitDescriptor.getDeploymentDate(); }
/** * Returns the {@link DeployableUnitDescriptor} for this deployable unit. * * @return */ public javax.slee.management.DeployableUnitDescriptor getSpecsDeployableUnitDescriptor() { Set<ComponentID> componentIDs = new HashSet<ComponentID>(); for (SleeComponent component : getDeployableUnitComponents()) { componentIDs.add(component.getComponentID()); } return new DeployableUnitDescriptor(getDeployableUnitID(), date, componentIDs.toArray(new ComponentID[0])); }
public DeployableUnitDescriptorEx(DeployableUnitDescriptor deployableUnitDescriptor, DeployableUnitID deployableUnitID) { super(deployableUnitID, new Date() /* FIXME */, deployableUnitDescriptor.getComponents()); this.deployableUnitDescriptor = deployableUnitDescriptor; this.deployableUnitID = deployableUnitID; }
static private String getDeployableUnitName(DeployableUnitDescriptor deployableUnitDescriptor) { File file = new File(deployableUnitDescriptor.getURL()); String name = file.getName(); if (name.endsWith(".jar")) name = name.substring(0, name.length() - ".jar".length()); return name; } }
/** * Returns the ServiceIDs of all services contained in the given deployable unit. */ private ServiceID[] getServices(DeployableUnitID duID) throws TCKTestErrorException { try { DeployableUnitDescriptor duDes = this.deploymentMBeanProxy.getDescriptor(duID); ComponentID[] componentIDs = duDes.getComponents(); ServiceID[] serviceIDs = new ServiceID[componentIDs.length]; int serviceCount = 0; for (int i = 0; i < componentIDs.length; i++) { if(componentIDs[i] instanceof ServiceID) serviceIDs[serviceCount++] = (ServiceID)componentIDs[i]; } if(serviceCount < serviceIDs.length) { ServiceID[] copyTo = new ServiceID[serviceCount]; System.arraycopy(serviceIDs,0,copyTo,0,serviceCount); serviceIDs = copyTo; } return serviceIDs; } catch(Exception e) { throw new TCKTestErrorException("Caught Exception while trying to get ServiceIDs from DeployableUnitID "+duID,e); } }
public DeployableUnitInfo[] searchDeployableUnits(String text) throws ManagementConsoleException { if (text == null || text.trim().equals("")) return null; String lowerCaseText = text.toLowerCase(); DeployableUnitDescriptor[] allDeployableUnitDescriptor = deploymentMBeanUtils.getDeployableUnitDescriptors(); ArrayList<DeployableUnitDescriptor> resultDeployableUnitDescriptorArrayList = new ArrayList<DeployableUnitDescriptor>(); DeployableUnitDescriptor[] resultDeployableUnitDescriptors; DeployableUnitInfo[] resultDeployableUnitInfos; for (int i = 0; i < allDeployableUnitDescriptor.length; i++) { DeployableUnitDescriptor deployableUnitDescriptor = allDeployableUnitDescriptor[i]; if (deployableUnitDescriptor.getURL() != null && deployableUnitDescriptor.getURL().toLowerCase().indexOf(lowerCaseText) > -1) resultDeployableUnitDescriptorArrayList.add(deployableUnitDescriptor); } if (resultDeployableUnitDescriptorArrayList.size() == 0) return null; resultDeployableUnitDescriptors = new DeployableUnitDescriptor[resultDeployableUnitDescriptorArrayList.size()]; resultDeployableUnitDescriptors = resultDeployableUnitDescriptorArrayList.toArray(resultDeployableUnitDescriptors); resultDeployableUnitInfos = DeployableUnitInfoUtils.toDeployableUnitInfos(resultDeployableUnitDescriptors); return resultDeployableUnitInfos; }
activateComponents( dud.getComponents() );
.getDeployableUnitIDtoDescriptorMap().put(deployableUnitId, descriptor); String url = descriptor.getURL(); this.getDeploymentCacheManager().getUrlToDeployableUnitIDMap().put( url, deployableUnitId);
public void stop(DeploymentInfo di) throws DeploymentException { log.info( "Undeploying: " + di.url ); try { DeployableUnitID did = (DeployableUnitID)di.metaData; // if the start failed did would be null if (did == null) return; DeployableUnitDescriptor dud = sleeDeploymentMBean.getDescriptor(did); deactivateComponents( dud.getComponents() ); sleeDeploymentMBean.uninstall(did); } catch (Exception e) { throw new DeploymentException( "problem stopping SLEE module: " + di.url, e ); } super.stop(di); }