use of org.jboss.as.ejb3.deployment.EjbSecurityDeployer in project wildfly by wildfly.
the class JaccEjbDeploymentProcessor method undeploy.
@Override
public void undeploy(DeploymentUnit deploymentUnit) {
AbstractSecurityDeployer<?> deployer = null;
deployer = new EjbSecurityDeployer();
deployer.undeploy(deploymentUnit);
// Jakarta Enterprise Beans maybe included directly in war deployment
ServiceName jaccServiceName = getJaccServiceName(deploymentUnit);
ServiceRegistry registry = deploymentUnit.getServiceRegistry();
if (registry != null) {
ServiceController<?> serviceController = registry.getService(jaccServiceName);
if (serviceController != null) {
serviceController.setMode(ServiceController.Mode.REMOVE);
}
}
}
use of org.jboss.as.ejb3.deployment.EjbSecurityDeployer 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();
}
}
Aggregations