use of org.jboss.as.server.deployment.DeploymentUnit in project wildfly by wildfly.
the class WSLibraryFilterProcessor method deploy.
@Override
public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
final DeploymentUnit unit = phaseContext.getDeploymentUnit();
if (DeploymentTypeMarker.isType(DeploymentType.EAR, unit)) {
return;
}
final CompositeIndex index = unit.getAttachment(Attachments.COMPOSITE_ANNOTATION_INDEX);
if (index != null) {
//perform checks on included libraries only if there're actually WS endpoints in the deployment
if (hasWSEndpoints(index)) {
AttachmentList<ResourceRoot> resourceRoots = unit.getAttachment(RESOURCE_ROOTS);
if (resourceRoots != null) {
for (ResourceRoot root : resourceRoots) {
if (hasClassesFromPackage(root.getAttachment(ANNOTATION_INDEX), "org.apache.cxf")) {
throw WSLogger.ROOT_LOGGER.invalidLibraryInDeployment("Apache CXF", root.getRootName());
}
}
}
}
} else {
WSLogger.ROOT_LOGGER.tracef("Skipping WS annotation processing since no composite annotation index found in unit: %s", unit.getName());
}
}
use of org.jboss.as.server.deployment.DeploymentUnit in project wildfly by wildfly.
the class WSModelDeploymentProcessor method internalDeploy.
@Override
public void internalDeploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
final DeploymentUnit unit = phaseContext.getDeploymentUnit();
WSDeploymentBuilder.getInstance().build(unit);
if (isWebServiceDeployment(unit)) {
//note, this check works only after the WSDeploymentBuilder above has run
ServerConfigImpl config = (ServerConfigImpl) phaseContext.getServiceRegistry().getRequiredService(WSServices.CONFIG_SERVICE).getValue();
config.incrementWSDeploymentCount();
}
}
use of org.jboss.as.server.deployment.DeploymentUnit in project wildfly by wildfly.
the class AspectDeploymentProcessor method deploy.
@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);
}
}
}
use of org.jboss.as.server.deployment.DeploymentUnit in project wildfly by wildfly.
the class EndpointServiceDeploymentAspect method stop.
@Override
public void stop(Deployment dep) {
for (final Endpoint ep : dep.getService().getEndpoints()) {
if (ep.getLifecycleHandler() != null) {
ep.getLifecycleHandler().stop(ep);
}
if (stopServices) {
final DeploymentUnit unit = getRequiredAttachment(dep, DeploymentUnit.class);
EndpointService.uninstall(ep, unit);
}
}
}
use of org.jboss.as.server.deployment.DeploymentUnit in project wildfly by wildfly.
the class ModelDeploymentAspect method start.
@Override
public void start(final Deployment dep) {
final DeploymentUnit unit = dep.getAttachment(DeploymentUnit.class);
if (unit instanceof WSEndpointDeploymentUnit)
return;
final DeploymentResourceSupport deploymentResourceSupport = unit.getAttachment(Attachments.DEPLOYMENT_RESOURCE_SUPPORT);
for (final Endpoint endpoint : dep.getService().getEndpoints()) {
final ModelNode endpointModel;
try {
endpointModel = deploymentResourceSupport.getDeploymentSubModel(WSExtension.SUBSYSTEM_NAME, PathElement.pathElement(ENDPOINT, URLEncoder.encode(getId(endpoint), "UTF-8")));
} catch (final UnsupportedEncodingException e) {
throw new RuntimeException(e);
}
endpointModel.get(ENDPOINT_NAME).set(getName(endpoint));
endpointModel.get(ENDPOINT_CONTEXT).set(getContext(endpoint));
endpointModel.get(ENDPOINT_CLASS).set(endpoint.getTargetBeanName());
endpointModel.get(ENDPOINT_TYPE).set(endpoint.getType().toString());
endpointModel.get(ENDPOINT_WSDL).set(endpoint.getAddress() + "?wsdl");
}
}
Aggregations