use of org.jboss.as.ejb3.subsystem.deployment.InstalledComponent in project wildfly by wildfly.
the class EjbManagementDeploymentUnitProcessor method uninstallManagementResource.
private void uninstallManagementResource(final InstalledComponent component, DeploymentUnit deploymentUnit) {
component.getType().getRuntimeHandler().unregisterComponent(component.getAddress());
// Deregister possible /service=timer-service
Resource root = deploymentUnit.getAttachment(DEPLOYMENT_RESOURCE);
Resource subResource = root.getChild(component.getAddress().getParent().getLastElement());
if (subResource != null) {
Resource componentResource = subResource.getChild(component.getAddress().getLastElement());
if (componentResource != null) {
componentResource.removeChild(EJB3SubsystemModel.TIMER_SERVICE_PATH);
}
}
}
use of org.jboss.as.ejb3.subsystem.deployment.InstalledComponent in project wildfly by wildfly.
the class EjbManagementDeploymentUnitProcessor method installManagementResource.
private void installManagementResource(ComponentConfiguration configuration, DeploymentUnit deploymentUnit) {
final EJBComponentType type = EJBComponentType.getComponentType(configuration);
PathAddress addr = getComponentAddress(type, configuration, deploymentUnit);
final AbstractEJBComponentRuntimeHandler<?> handler = type.getRuntimeHandler();
handler.registerComponent(addr, configuration.getComponentDescription().getStartServiceName());
deploymentUnit.addToAttachmentList(EjbDeploymentAttachmentKeys.MANAGED_COMPONENTS, new InstalledComponent(type, addr));
final DeploymentResourceSupport deploymentResourceSupport = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_RESOURCE_SUPPORT);
deploymentResourceSupport.getDeploymentSubModel(EJB3Extension.SUBSYSTEM_NAME, addr.getLastElement());
final EJBComponentDescription description = (EJBComponentDescription) configuration.getComponentDescription();
if (description.isTimerServiceRequired()) {
final PathAddress timerServiceAddress = PathAddress.pathAddress(addr.getLastElement(), EJB3SubsystemModel.TIMER_SERVICE_PATH);
final TimerServiceResource timerServiceResource = ((TimerServiceImpl) description.getTimerService()).getResource();
deploymentResourceSupport.registerDeploymentSubResource(EJB3Extension.SUBSYSTEM_NAME, timerServiceAddress, timerServiceResource);
}
}
Aggregations