public void destroy() { List<DeploymentAspect> managerAspects = new ArrayList<DeploymentAspect>(); managerAspects.addAll(manager.getDeploymentAspects()); Iterator<DeploymentAspect> it = aspects.iterator(); while (it.hasNext()) { DeploymentAspect aspect = it.next(); managerAspects.remove(aspect); } manager.setDeploymentAspects(managerAspects); }
throwSortException(sortedAspects, allAspects); manager.setDeploymentAspects(sortedAspects);
protected void undeploy(Deployment deployment) throws Exception { List<DeploymentAspect> aspects = getDeploymentAspects(); ClassLoader origClassLoader = WildFlySecurityManager.getCurrentContextClassLoaderPrivileged(); try { WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(ClassLoaderProvider.getDefaultProvider().getServerIntegrationClassLoader()); DeploymentAspectManager dam = new DeploymentAspectManagerImpl(); dam.setDeploymentAspects(aspects); dam.undeploy(deployment); } finally { WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(origClassLoader); } }
protected void undeploy(Deployment deployment) throws Exception { List<DeploymentAspect> aspects = getDeploymentAspects(); ClassLoader origClassLoader = WildFlySecurityManager.getCurrentContextClassLoaderPrivileged(); try { WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(ClassLoaderProvider.getDefaultProvider().getServerIntegrationClassLoader()); DeploymentAspectManager dam = new DeploymentAspectManagerImpl(); dam.setDeploymentAspects(aspects); dam.undeploy(deployment); } finally { WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(origClassLoader); } }
@Override public void destroy(Context context) throws Exception { List<Endpoint> eps = context.getEndpoints(); if (eps == null || eps.isEmpty()) { return; } Deployment deployment = eps.get(0).getService().getDeployment(); List<DeploymentAspect> aspects = getDeploymentAspects(); try { stopWebApp(deployment.getAttachment(StandardContext.class)); } finally { ClassLoader origClassLoader = SecurityActions.getContextClassLoader(); try { SecurityActions.setContextClassLoader(ClassLoaderProvider.getDefaultProvider().getServerIntegrationClassLoader()); DeploymentAspectManager dam = new DeploymentAspectManagerImpl(); dam.setDeploymentAspects(aspects); dam.undeploy(deployment); } finally { SecurityActions.setContextClassLoader(origClassLoader); } } }
/** * Triggers the WS deployment aspects, which process the deployment and * install the endpoint services. * * @param target * @param unit */ protected void doDeploy(ServiceTarget target, DeploymentUnit unit) { List<DeploymentAspect> aspects = getDeploymentAspects(); ClassLoader origClassLoader = WildFlySecurityManager.getCurrentContextClassLoaderPrivileged(); Deployment dep = null; try { WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(ClassLoaderProvider.getDefaultProvider().getServerIntegrationClassLoader()); dep = unit.getAttachment(WSAttachmentKeys.DEPLOYMENT_KEY); dep.addAttachment(ServiceTarget.class, target); DeploymentAspectManager dam = new DeploymentAspectManagerImpl(); dam.setDeploymentAspects(aspects); dam.deploy(dep); } finally { if (dep != null) { dep.removeAttachment(ServiceTarget.class); } WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(origClassLoader); } }
/** * Triggers the WS deployment aspects, which process the deployment and * install the endpoint services. * * @param target * @param unit */ protected void doDeploy(ServiceTarget target, DeploymentUnit unit) { List<DeploymentAspect> aspects = getDeploymentAspects(); ClassLoader origClassLoader = WildFlySecurityManager.getCurrentContextClassLoaderPrivileged(); Deployment dep = null; try { WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(ClassLoaderProvider.getDefaultProvider().getServerIntegrationClassLoader()); dep = unit.getAttachment(WSAttachmentKeys.DEPLOYMENT_KEY); dep.addAttachment(ServiceTarget.class, target); DeploymentAspectManager dam = new DeploymentAspectManagerImpl(); dam.setDeploymentAspects(aspects); dam.deploy(dep); } finally { if (dep != null) { dep.removeAttachment(ServiceTarget.class); } WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(origClassLoader); } }
dep.addAttachment(ServiceTarget.class, target); DeploymentAspectManager dam = new DeploymentAspectManagerImpl(); dam.setDeploymentAspects(aspects); dam.deploy(dep);