static String getCacheName(ServiceName deploymentUnitServiceName, String beanManagerFactoryName) { List<String> parts = new ArrayList<>(3); if (Services.JBOSS_DEPLOYMENT_SUB_UNIT.isParentOf(deploymentUnitServiceName)) { parts.add(deploymentUnitServiceName.getParent().getSimpleName()); } parts.add(deploymentUnitServiceName.getSimpleName()); parts.add(beanManagerFactoryName); return String.join("/", parts); }
/** * Constructs a new {@link XAResourceRecovery} builder. */ public XAResourceRecoveryServiceConfigurator(PathAddress cacheAddress) { super(CACHE.getServiceName(cacheAddress).append("recovery")); this.cache = new ServiceSupplierDependency<>(this.getServiceName().getParent()); }
final File root = connectorXmlDescriptor == null ? null : connectorXmlDescriptor.getRoot(); DEPLOYMENT_CONNECTOR_LOGGER.debugf("DEPLOYMENT name = %s", deploymentName); final boolean fromModule = duServiceName.getParent().equals(RaOperationUtil.RAR_MODULE); final WildFLyRaDeployer raDeployer = new WildFLyRaDeployer(context.getChildTarget(), url, deploymentName, root, classLoader, cmd, activation, deploymentServiceName, fromModule);
configServiceName = baseServiceName.append(configServiceName); this.containerName = ((configServiceName.length() > 3) ? configServiceName.getParent() : configServiceName).getSimpleName(); String templateCacheName = (configServiceName.length() > 3) ? configServiceName.getSimpleName() : null; String cacheName = this.configuration.getDeploymentName();
@Override public Set<ObjectName> getEndpoints() { String contextPath; String endpointName; StringBuilder name; final Set<ObjectName> retVal = new CopyOnWriteArraySet<>(); for (final ServiceName sname : endpoints.keySet()) { contextPath = sname.getParent().getSimpleName().substring(8); endpointName = sname.getSimpleName(); name = new StringBuilder(Endpoint.SEPID_DOMAIN + ":"); name.append(Endpoint.SEPID_PROPERTY_CONTEXT + "=").append(contextPath).append(","); name.append(Endpoint.SEPID_PROPERTY_ENDPOINT + "=").append(endpointName); retVal.add(ObjectNameFactory.create(name.toString())); } return retVal; }
@Override public Set<ObjectName> getEndpoints() { Set<ObjectName> endpoints = new CopyOnWriteArraySet<ObjectName>(); for (ServiceName sname : currentServiceContainer().getServiceNames()) { if (sname.getCanonicalName().startsWith(endpointPrefix)) { String contextPath = sname.getParent().getSimpleName().substring(8); String endpointName = sname.getSimpleName(); final StringBuilder name = new StringBuilder(Endpoint.SEPID_DOMAIN + ":"); name.append(Endpoint.SEPID_PROPERTY_CONTEXT + "=").append(contextPath).append(","); name.append(Endpoint.SEPID_PROPERTY_ENDPOINT + "=").append(endpointName); endpoints.add(ObjectNameFactory.create(name.toString())); } } return endpoints; }
/** * Constructs a new {@link XAResourceRecovery} builder. */ public XAResourceRecoveryServiceConfigurator(PathAddress cacheAddress) { super(CACHE.getServiceName(cacheAddress).append("recovery")); this.cache = new ServiceSupplierDependency<>(this.getServiceName().getParent()); }
@Override public Collection<Resource> members(RequestContext ctx) throws Exception { LinkedList<Resource> members = new LinkedList<>(); List<ServiceName> names = this.serviceContainer.getServiceNames(); for (ServiceName name : names) { if (Services.NETWORK_SERVER.equals(name.getParent())) { members.add(new NetworkServerResource(this, name.getSimpleName(), (NetworkServer) this.serviceContainer.getService(name).getValue())); } else if (Services.LOCAL_SERVER.equals(name.getParent())) { members.add(new LocalServerResource(this, name.getSimpleName(), (LocalServer) this.serviceContainer.getService(name).getValue())); } } return members; }
@Override protected ServiceController<Void> installActivateService(ServiceTarget serviceTarget, Set<XBundle> resolvedBundles) { return new BootstrapActivateIntegration(getServiceName().getParent(), resolvedBundles).install(serviceTarget, getServiceListener()); } }
@Override protected ServiceController<Void> installActivateService(ServiceTarget serviceTarget, Set<ServiceName> resolvedServices) { return new BootstrapActivateIntegration(getServiceName().getParent(), resolvedServices).install(serviceTarget, getServiceListener()); } }
static String getCacheName(ServiceName deploymentUnitServiceName) { if (Services.JBOSS_DEPLOYMENT_SUB_UNIT.isParentOf(deploymentUnitServiceName)) { return deploymentUnitServiceName.getParent().getSimpleName() + "/" + deploymentUnitServiceName.getSimpleName(); } return deploymentUnitServiceName.getSimpleName(); }
@Override protected ServiceController<Void> installResolveService(ServiceTarget serviceTarget, Set<ServiceName> installedServices) { return new BootstrapResolveIntegration(getServiceName().getParent(), installedServices).install(serviceTarget, getServiceListener()); }
@Override protected ServiceController<Void> installResolveService(ServiceTarget serviceTarget, Set<XBundleRevision> installedRevisions) { return new BootstrapResolveIntegration(getServiceName().getParent(), installedRevisions).install(serviceTarget, getServiceListener()); }
@Override protected void serviceStarted(ServiceController<? extends Object> controller) { ServiceName serviceName = controller.getName(); LOGGER.tracef("ServiceStarted: %s", serviceName); // Get the {@link Deployment} from the {@link RootDeploymentUnitService} ServiceContainer serviceContainer = controller.getServiceContainer(); ServiceController<?> depUnitController = serviceContainer.getRequiredService(serviceName.getParent()); DeploymentUnit depUnit = (DeploymentUnit) depUnitController.getValue(); Deployment deployment = depUnit.getAttachment(OSGiConstants.DEPLOYMENT_KEY); if (deployment != null) { deployments.add(deployment); } }
@Override protected void serviceStarted(ServiceController<? extends Object> controller) { ServiceName serviceName = controller.getName(); LOGGER.tracef("ServiceStarted: %s", serviceName); // Get the {@link Deployment} from the {@link RootDeploymentUnitService} ServiceContainer serviceContainer = controller.getServiceContainer(); ServiceController<?> depUnitController = serviceContainer.getRequiredService(serviceName.getParent()); DeploymentUnit depUnit = (DeploymentUnit) depUnitController.getValue(); Deployment deployment = depUnit.getAttachment(OSGiConstants.DEPLOYMENT_KEY); if (deployment != null) { deployments.add(deployment); } }
@Override protected void executeRuntimeStep(OperationContext context, ModelNode operation) throws OperationFailedException { try { ServiceName serviceName = managerUtil.serviceName(operation); ServiceController<?> serviceContainer = null; if(serviceName.getParent().getCanonicalName().equals(KEY_MANAGER_CAPABILITY)){ serviceContainer = getRequiredService(context.getServiceRegistry(false), serviceName, KeyManager.class); } else if (serviceName.getParent().getCanonicalName().equals(TRUST_MANAGER_CAPABILITY)) { serviceContainer = getRequiredService(context.getServiceRegistry(false), serviceName, TrustManager.class); } serviceContainer.getService().stop(null); serviceContainer.getService().start(null); } catch (Exception e) { throw new OperationFailedException(e); } } };
private boolean activateInternal(Activation activation, ServiceVerificationHandler verificationHandler) { boolean activate = activated.compareAndSet(false, true); if (activate) { LOGGER.debugf("Activating %sly", activation); ServiceTarget serviceTarget = builder.getServiceTarget(); builder.installServices(FrameworkPhase.INIT, serviceTarget, verificationHandler); builder.installServices(FrameworkPhase.ACTIVE, serviceTarget, verificationHandler); ServiceName serviceName = Services.FRAMEWORK_ACTIVE.getParent().append(activation.toString(), "ACTIVATOR"); switch (activation) { case EAGER: EagerActivatorService.addService(serviceTarget, serviceName, verificationHandler); break; case LAZY: LazyActivatorService.addService(serviceTarget, serviceName, verificationHandler); break; } } return activate; }
private boolean activateInternal(Activation activation, ServiceVerificationHandler verificationHandler) { boolean activate = activated.compareAndSet(false, true); if (activate) { LOGGER.debugf("Activating %sly", activation); ServiceTarget serviceTarget = builder.getServiceTarget(); builder.installServices(FrameworkPhase.INIT, serviceTarget, verificationHandler); builder.installServices(FrameworkPhase.ACTIVE, serviceTarget, verificationHandler); ServiceName serviceName = Services.FRAMEWORK_ACTIVE.getParent().append(activation.toString(), "ACTIVATOR"); switch (activation) { case EAGER: EagerActivatorService.addService(serviceTarget, serviceName, verificationHandler); break; case LAZY: LazyActivatorService.addService(serviceTarget, serviceName, verificationHandler); break; } } return activate; }
String simpleName = serviceName.getSimpleName(); if (JBOSS_DEPLOYMENT.isParentOf(serviceName) && simpleName.equals(Phase.INSTALL.toString())) { ServiceName parentName = serviceName.getParent(); ServiceController<?> parentController = serviceContainer.getService(parentName); DeploymentUnit depUnit = (DeploymentUnit) parentController.getValue(); String simpleName = serviceName.getSimpleName(); if(JBOSS_DEPLOYMENT.isParentOf(serviceName) && simpleName.equals(Phase.DEPENDENCIES.toString())) { ServiceName parentName = serviceName.getParent(); ServiceController<?> parentController = serviceContainer.getService(parentName); DeploymentUnit depUnit = (DeploymentUnit) parentController.getValue();
@Override public <T extends OutgoingDistributableSessionData> org.jboss.as.clustering.web.DistributedCacheManager<T> getDistributedCacheManager(LocalDistributableSessionManager manager) throws ClusteringNotSupportedException { @SuppressWarnings("unchecked") Registry<String, Void> jvmRouteRegistry = this.registry.getValue(); @SuppressWarnings("unchecked") AdvancedCache<String, Map<Object, Object>> cache = this.cache.getValue().getAdvancedCache(); if (!cache.getCacheConfiguration().invocationBatching().enabled()) { ServiceName cacheServiceName = this.getCacheServiceName(manager.getReplicationConfig()); throw new ClusteringNotSupportedException(MESSAGES.failedToConfigureWebApp(cacheServiceName.getParent().getSimpleName(), cacheServiceName.getSimpleName())); } BatchingManager batchingManager = new TransactionBatchingManager(cache.getTransactionManager()); SessionAttributeStorage<T> storage = this.storageFactory.createStorage(manager.getReplicationConfig().getReplicationGranularity(), this.marshallerFactory.createMarshaller(manager)); return new DistributedCacheManager<T>(manager, new AtomicMapCache<String, Object, Object>(cache), jvmRouteRegistry, this.lockManager.getOptionalValue(), storage, batchingManager, this.invoker, this.affinityFactory.getValue()); }