try SecurityActions.setContextClassLoader(aspect.getLoader()); aspect.start(dep);
@Override public void undeploy(final DeploymentUnit unit) { if (isWebServiceDeployment(unit)) { final Deployment dep = ASHelper.getRequiredAttachment(unit, WSAttachmentKeys.DEPLOYMENT_KEY); WSLogger.ROOT_LOGGER.tracef("%s stop: %s", aspect, unit.getName()); ClassLoader origClassLoader = WildFlySecurityManager.getCurrentContextClassLoaderPrivileged(); try { WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(aspect.getLoader()); aspect.stop(dep); } finally { WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(origClassLoader); } } }
/** * If undeployed unit is related to web services this method delegates * to deployment aspect and calls its stop() and destroy() methods. * * @param unit deployment unit */ @Override protected void internalUndeploy(final DeploymentUnit unit) { if (ASHelper.isWebServiceDeployment(unit)) { this.log.debug(this.aspect + " stop: " + unit.getName()); final Deployment dep = ASHelper.getRequiredAttachment(unit, Deployment.class); if (this.aspect.canHandle(dep)) { //set the context classloader using the proper one from the deployment aspect ClassLoader deployerClassLoader = SecurityActions.getContextClassLoader(); try { SecurityActions.setContextClassLoader(this.aspect.getLoader()); this.aspect.stop(dep); } finally { SecurityActions.setContextClassLoader(deployerClassLoader); } } } }
@Override public void undeploy(final DeploymentUnit unit) { if (isWebServiceDeployment(unit)) { final Deployment dep = ASHelper.getRequiredAttachment(unit, WSAttachmentKeys.DEPLOYMENT_KEY); WSLogger.ROOT_LOGGER.tracef("%s stop: %s", aspect, unit.getName()); ClassLoader origClassLoader = WildFlySecurityManager.getCurrentContextClassLoaderPrivileged(); try { WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(aspect.getLoader()); aspect.stop(dep); } finally { WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(origClassLoader); } } }
/** * If deployed unit is related to web services this method delegates * to deployment aspect and calls its create() and start() methods. * * @param unit deployment unit * @throws DeploymentException on deployment failure */ @Override protected void internalDeploy(final DeploymentUnit unit) throws DeploymentException { if (ASHelper.isWebServiceDeployment(unit)) { this.log.debug(this.aspect + " start: " + unit.getName()); final Deployment dep = ASHelper.getRequiredAttachment(unit, Deployment.class); if (this.aspect.canHandle(dep)) { //set the context classloader using the proper one from the deployment aspect ClassLoader deployerClassLoader = SecurityActions.getContextClassLoader(); try { SecurityActions.setContextClassLoader(this.aspect.getLoader()); this.aspect.start(dep); } finally { SecurityActions.setContextClassLoader(deployerClassLoader); } } } }
@Override public void undeploy(final DeploymentUnit unit) { if (isWebServiceDeployment(unit)) { final Deployment dep = ASHelper.getRequiredAttachment(unit, WSAttachmentKeys.DEPLOYMENT_KEY); if (aspect.canHandle(dep)) { ROOT_LOGGER.aspectStop(aspect, unit.getName()); ClassLoader origClassLoader = SecurityActions.getContextClassLoader(); try { SecurityActions.setContextClassLoader(aspect.getLoader()); aspect.stop(dep); } finally { SecurityActions.setContextClassLoader(origClassLoader); } } } }
@Override public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit unit = phaseContext.getDeploymentUnit(); if (isWebServiceDeployment(unit)) { ensureAspectInitialized(); final Deployment dep = ASHelper.getRequiredAttachment(unit, WSAttachmentKeys.DEPLOYMENT_KEY); WSLogger.ROOT_LOGGER.tracef("%s start: %s", aspect, unit.getName()); ClassLoader origClassLoader = WildFlySecurityManager.getCurrentContextClassLoaderPrivileged(); try { WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(aspect.getLoader()); dep.addAttachment(ServiceTarget.class, phaseContext.getServiceTarget()); aspect.start(dep); dep.removeAttachment(ServiceTarget.class); } finally { WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(origClassLoader); } } }
@Override public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit unit = phaseContext.getDeploymentUnit(); if (isWebServiceDeployment(unit)) { ensureAspectInitialized(); final Deployment dep = ASHelper.getRequiredAttachment(unit, WSAttachmentKeys.DEPLOYMENT_KEY); WSLogger.ROOT_LOGGER.tracef("%s start: %s", aspect, unit.getName()); ClassLoader origClassLoader = WildFlySecurityManager.getCurrentContextClassLoaderPrivileged(); try { WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(aspect.getLoader()); dep.addAttachment(ServiceTarget.class, phaseContext.getServiceTarget()); aspect.start(dep); dep.removeAttachment(ServiceTarget.class); } finally { WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(origClassLoader); } } }
@Override public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit unit = phaseContext.getDeploymentUnit(); if (isWebServiceDeployment(unit)) { ensureAspectInitialized(); final Deployment dep = ASHelper.getRequiredAttachment(unit, WSAttachmentKeys.DEPLOYMENT_KEY); if (aspect.canHandle(dep)) { ROOT_LOGGER.aspectStart(aspect, unit.getName()); ClassLoader origClassLoader = SecurityActions.getContextClassLoader(); try { SecurityActions.setContextClassLoader(aspect.getLoader()); dep.addAttachment(ServiceTarget.class, phaseContext.getServiceTarget()); aspect.start(dep); dep.removeAttachment(ServiceTarget.class); } finally { SecurityActions.setContextClassLoader(origClassLoader); } } } }