final ServiceController<?> raService = phaseContext.getServiceRegistry().getService( ConnectorServices.RESOURCEADAPTERS_SERVICE); if (raService != null) RaServicesFactory.createDeploymentService(registration, connectorXmlDescriptor, module, serviceTarget, deploymentUnitName, deploymentUnit.getServiceName(), deploymentUnitName, raxml, deploymentResource, phaseContext.getServiceRegistry());
CallbackHandler callbackHandler = getCallbackHandler(phaseContext.getServiceRegistry(), clusterUserName, clusterSecurityRealm); if (callbackHandler != null) { defaultAuthenticationConfiguration = defaultAuthenticationConfiguration.useCallbackHandler(callbackHandler); CallbackHandler nodeCallbackHandler = getCallbackHandler(phaseContext.getServiceRegistry(), userName, securityRealm); if (nodeCallbackHandler != null) { nodeAuthenticationConfiguration = nodeAuthenticationConfiguration.useCallbackHandler(nodeCallbackHandler);
public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final ComponentRegistry componentRegistry = new ComponentRegistry(phaseContext.getServiceRegistry());
@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); // Ideally, we would just install the next phase using the singleton policy, however deployment unit phases do not currently support restarts // 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); } } } }
bindBeanManager(serviceTarget, beanManagerServiceName, moduleContextServiceName, dependencies, phaseContext.getServiceRegistry()); if (component.getNamingMode() == ComponentNamingMode.CREATE) { final ServiceName compContextServiceName = ContextNames.contextServiceNameOfComponent(moduleDescription.getApplicationName(), moduleDescription.getModuleName(), component.getComponentName()); bindBeanManager(serviceTarget, beanManagerServiceName, compContextServiceName, dependencies, phaseContext.getServiceRegistry());
final ServiceName deliveryGroupServiceName = MdbDeliveryGroupResourceDefinition.getDeliveryGroupServiceName( mdbDescription.getDeliveryGroup()); if (phaseContext.getServiceRegistry().getService(deliveryGroupServiceName) == null) { throw EjbLogger.DEPLOYMENT_LOGGER.missingMdbDeliveryGroup(mdbDescription.getDeliveryGroup());
@Override public void deploy(DeploymentPhaseContext phaseContext) { DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); Module module = deploymentUnit.getAttachment(Attachments.MODULE); SmallRyeConfigBuilder builder = new SmallRyeConfigBuilder(); builder.forClassLoader(module.getClassLoader()) .addDefaultSources() .addDiscoveredSources() .addDiscoveredConverters(); addConfigSourcesFromServices(builder, phaseContext.getServiceRegistry(), module.getClassLoader()); Config config = builder.build(); deploymentUnit.putAttachment(CONFIG, config); ConfigProviderResolver configProviderResolver = deploymentUnit.getAttachment(CONFIG_PROVIDER_RESOLVER); configProviderResolver.registerConfig(config, module.getClassLoader()); }
public static boolean isClustered(DeploymentPhaseContext context) { return isClustered( context.getServiceRegistry() ); }
static boolean isElytronEnabled(DeploymentPhaseContext phaseContext) { String securityDomain = getSecurityDomain(phaseContext.getDeploymentUnit()); ServiceName serviceName = ServiceName.parse(new StringBuilder(UNDERTOW_APPLICATION_SECURITY_DOMAIN).append(securityDomain).toString()); return phaseContext.getServiceRegistry().getService(serviceName) != null; }
static boolean isElytronEnabled(DeploymentPhaseContext phaseContext) { String securityDomain = getSecurityDomain(phaseContext.getDeploymentUnit()); ServiceName serviceName = ServiceName.parse(new StringBuilder(UNDERTOW_APPLICATION_SECURITY_DOMAIN).append(securityDomain).toString()); return phaseContext.getServiceRegistry().getService(serviceName) != null; }
private void addInfinispanCaches(DeploymentPhaseContext context) { if (context.getServiceRegistry().getService(cacheContainerService) != null) { ServiceTarget st = context.getServiceTarget(); st.addDependency(cacheContainerService); st.addDependency(cacheContainerService.append("realms")); st.addDependency(cacheContainerService.append("users")); st.addDependency(cacheContainerService.append("sessions")); st.addDependency(cacheContainerService.append("loginFailures")); } }
public void getResourceValue(final InjectionSource.ResolutionContext context, final ServiceBuilder<?> serviceBuilder, final DeploymentPhaseContext phaseContext, final Injector<ManagedReferenceFactory> injector) throws DeploymentUnitProcessingException { if (targetsPooledConnectionFactory(getActiveMQServerName(properties), resourceAdapter, phaseContext.getServiceRegistry())) { startActiveMQDestination(context, serviceBuilder, phaseContext, injector); } else { // delegate to the resource-adapter subsystem to create a generic JCA admin object. AdministeredObjectDefinitionInjectionSource aodis = new AdministeredObjectDefinitionInjectionSource(jndiName, className, resourceAdapter); aodis.setInterface(interfaceName); aodis.setDescription(description); // transfer all the generic properties for (Map.Entry<String, String> property : properties.entrySet()) { aodis.addProperty(property.getKey(), property.getValue()); } aodis.getResourceValue(context, serviceBuilder, phaseContext, injector); } }
/** {@inheritDoc} */ public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final ExtensionInfo extensionInfo = deploymentUnit.getAttachment(Attachments.EXTENSION_INFORMATION); if (extensionInfo == null) { return; } final ServiceController<?> extensionIndexController = phaseContext.getServiceRegistry().getRequiredService( Services.JBOSS_DEPLOYMENT_EXTENSION_INDEX); final ExtensionIndex extensionIndexService = (ExtensionIndex) extensionIndexController.getValue(); final ModuleIdentifier moduleIdentifier = deploymentUnit.getAttachment(Attachments.MODULE_IDENTIFIER); extensionIndexService.addDeployedExtension(moduleIdentifier, extensionInfo); }
/** {@inheritDoc} */ public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final ExtensionInfo extensionInfo = deploymentUnit.getAttachment(Attachments.EXTENSION_INFORMATION); if (extensionInfo == null) { return; } final ServiceController<?> extensionIndexController = phaseContext.getServiceRegistry().getRequiredService( Services.JBOSS_DEPLOYMENT_EXTENSION_INDEX); final ExtensionIndex extensionIndexService = (ExtensionIndex) extensionIndexController.getValue(); final ModuleIdentifier moduleIdentifier = deploymentUnit.getAttachment(Attachments.MODULE_IDENTIFIER); extensionIndexService.addDeployedExtension(moduleIdentifier, extensionInfo); }
/** {@inheritDoc} */ public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final ExtensionInfo extensionInfo = deploymentUnit.getAttachment(Attachments.EXTENSION_INFORMATION); if (extensionInfo == null) { return; } final ServiceController<?> extensionIndexController = phaseContext.getServiceRegistry().getRequiredService( Services.JBOSS_DEPLOYMENT_EXTENSION_INDEX); final ExtensionIndex extensionIndexService = (ExtensionIndex) extensionIndexController.getValue(); final ModuleIdentifier moduleIdentifier = deploymentUnit.getAttachment(Attachments.MODULE_IDENTIFIER); extensionIndexService.addDeployedExtension(moduleIdentifier, extensionInfo); }
/** {@inheritDoc} */ public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final ExtensionInfo extensionInfo = deploymentUnit.getAttachment(Attachments.EXTENSION_INFORMATION); if (extensionInfo == null) { return; } final ServiceController<?> extensionIndexController = phaseContext.getServiceRegistry().getRequiredService( Services.JBOSS_DEPLOYMENT_EXTENSION_INDEX); final ExtensionIndex extensionIndexService = (ExtensionIndex) extensionIndexController.getValue(); final ModuleIdentifier moduleIdentifier = deploymentUnit.getAttachment(Attachments.MODULE_IDENTIFIER); extensionIndexService.addDeployedExtension(moduleIdentifier, extensionInfo); }
@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(); } }
private void restoreStorageState(final DeploymentPhaseContext phaseContext, final Deployment deployment) { ServiceRegistry serviceRegistry = phaseContext.getServiceRegistry(); BundleStorage storageProvider = (BundleStorage) serviceRegistry.getRequiredService(IntegrationServices.BUNDLE_STORAGE).getValue(); StorageState storageState = storageProvider.getStorageState(deployment.getLocation()); if (storageState != null) { deployment.setAutoStart(storageState.isPersistentlyStarted()); deployment.addAttachment(StorageState.class, storageState); } } }
private void restoreStorageState(final DeploymentPhaseContext phaseContext, final Deployment deployment) { ServiceRegistry serviceRegistry = phaseContext.getServiceRegistry(); StorageManager storageProvider = (StorageManager) serviceRegistry.getRequiredService(IntegrationServices.STORAGE_MANAGER_PLUGIN).getValue(); StorageState storageState = storageProvider.getStorageState(deployment.getLocation()); if (storageState != null) { deployment.setAutoStart(storageState.isPersistentlyStarted()); deployment.putAttachment(STORAGE_STATE_KEY, storageState); } }
private void markFederationDeployment(DeploymentPhaseContext phaseContext) { DeploymentUnit deployment = phaseContext.getDeploymentUnit(); ServiceRegistry serviceRegistry = phaseContext.getServiceRegistry(); ServiceController<?> federationService = serviceRegistry.getService(IdentityProviderService .createServiceName(deployment.getName())); if (federationService == null) { federationService = serviceRegistry.getService(ServiceProviderService.createServiceName(deployment.getName())); } if (federationService != null) { deployment.putAttachment(FEDERATION_ATTACHMENT_KEY, (PicketLinkFederationService<?>) federationService.getValue()); } }