use of org.jboss.as.ejb3.subsystem.ApplicationSecurityDomainService.Registration in project wildfly by wildfly.
the class EjbClientContextSetupProcessor method deploy.
@Override
public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
final Module module = deploymentUnit.getAttachment(org.jboss.as.server.deployment.Attachments.MODULE);
if (module == null) {
return;
}
RegistrationService registrationService = new RegistrationService(module);
ServiceName registrationServiceName = deploymentUnit.getServiceName().append("ejb3", "client-context", "registration-service");
final ServiceName profileServiceName = deploymentUnit.getAttachment(EjbDeploymentAttachmentKeys.EJB_REMOTING_PROFILE_SERVICE_NAME);
final ServiceBuilder<Void> builder = phaseContext.getServiceTarget().addService(registrationServiceName, registrationService).addDependency(getEJBClientContextServiceName(phaseContext), EJBClientContextService.class, registrationService.ejbClientContextInjectedValue).addDependency(getDiscoveryServiceName(phaseContext), Discovery.class, registrationService.discoveryInjector);
if (profileServiceName != null) {
builder.addDependency(profileServiceName, RemotingProfileService.class, registrationService.profileServiceInjectedValue);
}
builder.install();
final EEModuleDescription moduleDescription = deploymentUnit.getAttachment(Attachments.EE_MODULE_DESCRIPTION);
if (moduleDescription == null) {
return;
}
//we need to make sure all our components have a dependency on the EJB client context registration, which in turn implies a dependency on the context
for (final ComponentDescription component : moduleDescription.getComponentDescriptions()) {
component.addDependency(registrationServiceName, ServiceBuilder.DependencyType.REQUIRED);
}
}
use of org.jboss.as.ejb3.subsystem.ApplicationSecurityDomainService.Registration in project wildfly by wildfly.
the class EJBSecurityDomainService method start.
@Override
public synchronized void start(StartContext context) throws StartException {
ApplicationSecurityDomain applicationSecurityDomain = getApplicationSecurityDomain();
BiFunction<String, ClassLoader, Registration> securityFunction = applicationSecurityDomain != null ? applicationSecurityDomain.getSecurityFunction() : null;
if (securityFunction != null) {
final String deploymentName = deploymentUnit.getParent() == null ? deploymentUnit.getName() : deploymentUnit.getParent().getName() + "." + deploymentUnit.getName();
final Module module = deploymentUnit.getAttachment(Attachments.MODULE);
final ClassLoader classLoader = module.getClassLoader();
registration = securityFunction.apply(deploymentName, classLoader);
}
}
Aggregations