use of org.jboss.as.server.deployment.DeploymentUnit in project wildfly by wildfly.
the class JaccEjbDeploymentProcessor method getJaccServiceName.
private ServiceName getJaccServiceName(DeploymentUnit deploymentUnit) {
final DeploymentUnit parentDU = deploymentUnit.getParent();
// Jakarta Enterprise Beans maybe included directly in war deployment
ServiceName jaccServiceName = deploymentUnit.getServiceName().append(JaccService.SERVICE_NAME).append("ejb");
// Qualify the service name properly with parent DU
if (parentDU != null) {
jaccServiceName = jaccServiceName.append(parentDU.getName());
}
return jaccServiceName;
}
use of org.jboss.as.server.deployment.DeploymentUnit in project wildfly by wildfly.
the class JaccEjbDeploymentProcessor method deploy.
@Override
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
if (deploymentContainsEjbs(deploymentUnit) == false) {
return;
}
AbstractSecurityDeployer<?> deployer = null;
deployer = new EjbSecurityDeployer();
JaccService<?> service = deployer.deploy(deploymentUnit);
if (service != null) {
final DeploymentUnit parentDU = deploymentUnit.getParent();
// Jakarta Enterprise Beans maybe included directly in war deployment
ServiceName jaccServiceName = getJaccServiceName(deploymentUnit);
final ServiceTarget serviceTarget = phaseContext.getServiceTarget();
ServiceBuilder<?> builder = serviceTarget.addService(jaccServiceName, service);
if (parentDU != null) {
// add dependency to parent policy
builder.addDependency(parentDU.getServiceName().append(JaccService.SERVICE_NAME), PolicyConfiguration.class, service.getParentPolicyInjector());
}
CapabilityServiceSupport capabilitySupport = deploymentUnit.getAttachment(Attachments.CAPABILITY_SERVICE_SUPPORT);
builder.addDependencies(capabilitySupport.getCapabilityServiceName(jaccCapabilityName));
builder.setInitialMode(Mode.ACTIVE).install();
}
}
use of org.jboss.as.server.deployment.DeploymentUnit in project wildfly by wildfly.
the class SingletonDeploymentDependencyProcessor method deploy.
@Override
public void deploy(DeploymentPhaseContext context) throws DeploymentUnitProcessingException {
DeploymentUnit unit = context.getDeploymentUnit();
if (unit.getParent() == null) {
SingletonDeploymentConfiguration config = unit.getAttachment(CONFIGURATION_KEY);
if (config != null) {
CapabilityServiceSupport support = unit.getAttachment(Attachments.CAPABILITY_SERVICE_SUPPORT);
context.addDependency(SingletonServiceNameFactory.SINGLETON_POLICY.getServiceName(support, config.getPolicy()), SingletonDeploymentProcessor.POLICY_KEY);
}
}
}
use of org.jboss.as.server.deployment.DeploymentUnit in project wildfly by wildfly.
the class SingletonDeploymentProcessor method deploy.
@Override
public void deploy(DeploymentPhaseContext context) throws DeploymentUnitProcessingException {
DeploymentUnit unit = context.getDeploymentUnit();
if (unit.getParent() == null) {
SingletonPolicy policy = context.getAttachment(POLICY_KEY);
if (policy != null) {
CapabilityServiceSupport support = unit.getAttachment(Attachments.CAPABILITY_SERVICE_SUPPORT);
// Restart the deployment using the attached phase builder, but only if a builder was not already attached
if (unit.putAttachment(Attachments.DEPLOYMENT_UNIT_PHASE_BUILDER, new SingletonDeploymentUnitPhaseBuilder(support, policy)) == null) {
SingletonLogger.ROOT_LOGGER.singletonDeploymentDetected(policy);
ServiceController<?> controller = context.getServiceRegistry().getRequiredService(unit.getServiceName());
controller.addListener(this);
controller.setMode(Mode.NEVER);
}
}
}
}
use of org.jboss.as.server.deployment.DeploymentUnit in project wildfly by wildfly.
the class StaticInterceptorsDependenciesDeploymentUnitProcessor method deploy.
@Override
public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
final ModuleLoader moduleLoader = Module.getBootModuleLoader();
final ModuleSpecification deploymentModuleSpec = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
for (final String interceptorModule : interceptorModules) {
final ModuleIdentifier interceptorModuleId = ModuleIdentifier.create(interceptorModule);
deploymentModuleSpec.addSystemDependency(new ModuleDependency(moduleLoader, interceptorModuleId, false, false, true, false));
}
}
Aggregations