/** * Create a new ServiceDeploymentDeployer. */ public ServiceDeploymentDeployer() { setDeploymentVisitor(new ServiceDeploymentVisitor()); setComponentVisitor(new ServiceMetaDataVisitor()); }
public void undeploy(DeploymentUnit unit, ServiceMetaData deployment) { removeServiceComponent(unit, deployment); } }
/** * Create a new ServiceClassLoaderDeployer. */ public ServiceClassLoaderDeployer() { super(ServiceDeployment.class); setOutput(ClassLoadingMetaData.class); setStage(DeploymentStages.POST_PARSE); setTopLevelOnly(true); }
loaderName = findLoaderName(unit.getClassLoader()); try create(context); try start(context); Throwable t = context.getProblem(); if (t != null) destroy(name); throw t; remove(name); throw t; ControllerContext serviceContext = getControllerContext(name); if (serviceContext != null) putContext(serviceContext, unit.getParent()); // we're component, use parent
/** * Populate the deployment's classloading metadata from a loader repository config * with parent delegation false. * * @param unit the deployment unit * @param loaderConfig the loader repository config * @return the classloading metadata * @throws DeploymentException for any error */ public static ClassLoadingMetaData create(DeploymentUnit unit, LoaderRepositoryConfig loaderConfig) throws DeploymentException { return create(unit, loaderConfig, false); }
public void undeploy(DeploymentUnit unit, ServiceMetaData deployment) { ObjectName name = deployment.getObjectName(); ControllerContext serviceContext = getControllerContext(name); if (serviceContext != null) removeContext(serviceContext, unit.getParent()); ServiceContext context = controller.getServiceContext(name); if (context != null) { stop(name); destroy(name); remove(name); } }
/** * Create a new SARDeployer. * * @throws IllegalArgumentException for a null kernel */ public SARDeployer() { super(ServiceDeployment.class); setSuffix("-service.xml"); // Enable the super class ManagedObjectCreator implementation setBuildManagedObject(true); setAllowMultipleFiles(true); }
/** * Create a new ServiceDeployer. * * @param controller the service controller * @throws IllegalArgumentException for a null controller */ public ServiceDeployer(ServiceController controller) { super(ServiceMetaData.class); if (controller == null) throw new IllegalArgumentException("Null controller"); this.controller = controller; setComponentsOnly(true); setUseUnitName(true); }
processXMLClasspath(unit, classPaths); if (index != -1) docStr = maskPasswords(docStr, index);
public void deploy(DeploymentUnit unit, ServiceMetaData deployment) throws DeploymentException { addServiceComponent(unit, deployment); }
private String maskPasswords(String original, int index) { StringBuilder sb = new StringBuilder(original); String modified; int startPasswdStringIndex = sb.indexOf(">", index); if (startPasswdStringIndex != -1) { // checks if the keyword 'password' was not in a comment if (sb.charAt(startPasswdStringIndex - 1) != '-') { int endPasswdStringIndex = sb.indexOf("<", startPasswdStringIndex); if (endPasswdStringIndex != -1) // shouldn't happen, but check anyway { sb.replace(startPasswdStringIndex + 1, endPasswdStringIndex, "****"); } } modified = sb.toString(); // unlikely event of more than one password index = modified.toLowerCase().indexOf("password", startPasswdStringIndex); if (index != -1) return maskPasswords(modified, index); return modified; } return original; } }
return maskPasswords(modified, index); return modified;
/** * Find first RealClassLoader instance * and return its ObjectName. * If none is found return defaultClassloader. * * @param cl the classloader * @return classloader's ObjectName */ protected ObjectName findLoaderName(ClassLoader cl) { if (cl == null) return defaultClassLoader; if (cl instanceof RealClassLoader) { RealClassLoader rcl = RealClassLoader.class.cast(cl); return rcl.getObjectName(); } return findLoaderName(cl.getParent()); }
VirtualFileFilter filter = new SARArchiveFilter(archives); List<VirtualFile> archiveFiles = codebaseFile.getChildren(filter); classpath.addAll(archiveFiles);
/** * Create classloading metadata from a loader repository config * with parent delegation false * * @param deploymentName the deployment name * @param loaderConfig the loader repository config * @return the classloading metadata * @throws DeploymentException for any error */ public static ClassLoadingMetaData create(String deploymentName, LoaderRepositoryConfig loaderConfig) throws DeploymentException { return create(deploymentName, loaderConfig, false); }
@Override public void deploy(DeploymentUnit unit, ServiceDeployment metaData) throws DeploymentException { ClassLoadingMetaData classLoadingMetaData = unit.getAttachment(ClassLoadingMetaData.class); if (classLoadingMetaData != null) return; LoaderRepositoryConfig config = metaData.getLoaderRepositoryConfig(); if (config != null) LoaderRepositoryConfigHelper.create(unit, config); } }
public void deploy(DeploymentUnit unit, ManagedConnectionFactoryDeploymentGroup deployment) throws DeploymentException { ClassLoadingMetaData classLoadingMetaData = unit.getAttachment(ClassLoadingMetaData.class); if (classLoadingMetaData != null) return; LoaderRepositoryConfig loaderConfig = deployment.getLoaderRepositoryConfig(); if (loaderConfig == null) return; LoaderRepositoryConfigHelper.create(unit, loaderConfig); } }
/** * Populate the deployment's classloading metadata from a loader repository config * * @param unit the deployment unit * @param loaderConfig the loader repository config * @param parentDelegation the default value for parent delegation * @return the classloading metadata * @throws DeploymentException for any error */ public static ClassLoadingMetaData create(DeploymentUnit unit, LoaderRepositoryConfig loaderConfig, boolean parentDelegation) throws DeploymentException { if (unit == null) throw new IllegalArgumentException("Null unit"); ClassLoadingMetaData clmd = unit.getAttachment(ClassLoadingMetaData.class); if (clmd != null) return clmd; clmd = create(unit.getName(), loaderConfig, parentDelegation); if (clmd != null) unit.addAttachment(ClassLoadingMetaData.class, clmd); return clmd; }
return LoaderRepositoryConfigHelper.create(name, repositoryConfig, parentDelegation);