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); }
@Override public String toString() { return this.getServiceName().getSimpleName(); } }
public DataSourceDefinitionService(ContextNames.BindInfo bindInfo, boolean transactional, AgroalDataSourceConfigurationSupplier dataSourceConfiguration, Supplier<TransactionSynchronizationRegistry> tsrSupplier) { this.dataSourceName = bindInfo.getParentContextServiceName().getSimpleName() + "." + bindInfo.getBindName().replace('/', '.'); this.jndiBinding = bindInfo.getBindName(); this.transactional = transactional; this.tsrSupplier = tsrSupplier; this.dataSourceConfiguration = dataSourceConfiguration; }
/** * Wait for the required service to start up and fail otherwise. This method is necessary when a runtime operation * uses a service that might have been created within a composite operation. * * This method will wait at most 100 millis. * * @param controller the service to wait for * @throws OperationFailedException if the service is not available, or the thread was interrupted. */ private static void waitForService(final ServiceController<?> controller) throws OperationFailedException { if (controller.getState() == ServiceController.State.UP) return; final StabilityMonitor monitor = new StabilityMonitor(); monitor.addController(controller); try { monitor.awaitStability(100, MILLISECONDS); } catch (final InterruptedException e) { Thread.currentThread().interrupt(); throw SecurityLogger.ROOT_LOGGER.interruptedWaitingForSecurityDomain(controller.getName().getSimpleName()); } finally { monitor.removeController(controller); } if (controller.getState() != ServiceController.State.UP) { throw SecurityLogger.ROOT_LOGGER.requiredSecurityDomainServiceNotAvailable(controller.getName().getSimpleName()); } }
for(ServiceName subServiceName: serviceRegistry.getServiceNames()) { if (parentName.isParentOf(subServiceName) && !subServiceName.getSimpleName().equals(ConnectorServices.STATISTICS_SUFFIX)) { builder.requires(subServiceName);
ServiceName serviceName = installer.install(serviceTarget, deploymentUnit, jtsEnabled); if (ServiceNames.WELD_SECURITY_SERVICES_SERVICE_NAME.getSimpleName().equals(serviceName.getSimpleName())) { securityServicesSupplier = weldBootstrapServiceBuilder.requires(serviceName); } else if (ServiceNames.WELD_TRANSACTION_SERVICES_SERVICE_NAME.getSimpleName().equals(serviceName.getSimpleName())) { weldTransactionServicesSupplier = weldBootstrapServiceBuilder.requires(serviceName);
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();
static String getCacheName(ServiceName deploymentUnitServiceName) { if (Services.JBOSS_DEPLOYMENT_SUB_UNIT.isParentOf(deploymentUnitServiceName)) { return deploymentUnitServiceName.getParent().getSimpleName() + "/" + deploymentUnitServiceName.getSimpleName(); } return deploymentUnitServiceName.getSimpleName(); }
@Inject public void lookupPartitionManager() { String partitionManagerJNDIUrl = this.extension.getPartitionManagerJNDIUrl(); try { String formattedJNDIName = partitionManagerJNDIUrl.replaceAll(ContextNames.JAVA_CONTEXT_SERVICE_NAME.getSimpleName() + ":", ""); this.partitionManager = (PartitionManager) new InitialContext().lookup(formattedJNDIName); } catch (NamingException e) { throw new RuntimeException("Error looking up PartitionManager from [" + partitionManagerJNDIUrl + "]", e); } }
@Override public String toString() { String uname = serviceName.getSimpleName(); String sname = serviceName.getCanonicalName(); return "ArquillianConfig[service=" + sname + ",unit=" + uname + ",tests=" + testClasses + "]"; } }
@Override public String toString() { return this.getServiceName().getSimpleName(); } }
@Override public void start(StartContext context) throws StartException { for (ServiceName serviceName : socketBindingNames) { SocketBinding binding = (SocketBinding) serviceContainer.getRequiredService(serviceName).getValue(); Dictionary<String, String> props = new Hashtable<String, String>(); props.put("socketBinding", serviceName.getSimpleName()); InetSocketAddress value = binding.getSocketAddress(); syscontext.registerService(InetSocketAddress.class.getName(), value, props); } } });
@Override public ServiceBuilder<SimpleShape> create(ServiceTarget target, ServiceName parent) { SquareService circleService = new SquareService(); return target.addService( ServiceName.of(parent, SquareService.SERVICE_NAME.getSimpleName()), circleService); }
@Override public void start(StartContext context) throws StartException { for (ServiceName serviceName : socketBindingNames) { SocketBinding binding = (SocketBinding) serviceContainer.getRequiredService(serviceName).getValue(); Dictionary<String, String> props = new Hashtable<String, String>(); props.put("socketBinding", serviceName.getSimpleName()); InetSocketAddress value = binding.getSocketAddress(); syscontext.registerService(InetSocketAddress.class, value, props); } } });
public String mbeanName(final String domain, final ServiceName name) { final ApplicationMetaData appMetaData = unit.getAttachment( ApplicationMetaData.ATTACHMENT_KEY ); return ObjectNameFactory.create( domain, new Hashtable<String, String>() { { put( "app", appMetaData.getApplicationName() ); put( "name", name.getSimpleName() ); } } ).toString(); }
private ActiveMQServerControl getServerControl(final OperationContext context, ModelNode operation) throws OperationFailedException { final ServiceName serviceName = MessagingServices.getActiveMQServiceName(PathAddress.pathAddress(operation.get(ModelDescriptionConstants.OP_ADDR))); ServiceController<?> service = context.getServiceRegistry(false).getService(serviceName); if (service == null || service.getState() != ServiceController.State.UP) { throw MessagingLogger.ROOT_LOGGER.activeMQServerNotInstalled(serviceName.getSimpleName()); } ActiveMQServer server = ActiveMQServer.class.cast(service.getValue()); return server.getActiveMQServerControl(); } }
private ActiveMQServerControl getServerControl(final OperationContext context, ModelNode operation) throws OperationFailedException { final ServiceName serviceName = MessagingServices.getActiveMQServiceName(PathAddress.pathAddress(operation.get(ModelDescriptionConstants.OP_ADDR))); ServiceController<?> service = context.getServiceRegistry(false).getService(serviceName); if (service == null || service.getState() != ServiceController.State.UP) { throw MessagingLogger.ROOT_LOGGER.activeMQServerNotInstalled(serviceName.getSimpleName()); } ActiveMQServer server = ActiveMQServer.class.cast(service.getValue()); return server.getActiveMQServerControl(); } }
public synchronized void stop(final StopContext context) { final String deploymentName = context.getController().getName().getSimpleName(); final String managementName = deploymentUnit.getAttachment(Attachments.MANAGEMENT_NAME); ServerLogger.DEPLOYMENT_LOGGER.stoppedDeployment(managementName, deploymentName, (int) (context.getElapsedTime() / 1000000L)); deploymentUnit = null; }
@Override public void start(final StartContext context) throws StartException { super.start(context); RemotingConnectorBindingInfoService.install(context.getChildTarget(), context.getController().getName().getSimpleName(), getSocketBinding(), Protocol.REMOTE); }
public synchronized void stop(final StopContext context) { final String deploymentName = context.getController().getName().getSimpleName(); final String managementName = deploymentUnit.getAttachment(Attachments.MANAGEMENT_NAME); if (deploymentUnit.getParent()==null) { ServerLogger.DEPLOYMENT_LOGGER.stoppedDeployment(managementName, deploymentName, (int) (context.getElapsedTime() / 1000000L)); } else { ServerLogger.DEPLOYMENT_LOGGER.stoppedSubDeployment(deploymentName, (int) (context.getElapsedTime() / 1000000L)); } deploymentUnit = null; monitor.removeController(context.getController()); monitor = null; }