@Override void configureAdditionalDependencies( OperationContext context, ServiceBuilder<? extends AbstractListenerService> serviceBuilder, ModelNode model, AbstractListenerService service) throws OperationFailedException { serviceBuilder.addDependency( HttpListenerAdd.REGISTRY_SERVICE_NAME, ListenerRegistry.class, ((HttpListenerService) service).getHttpListenerRegistry()); final String securityRealm = HttpsListenerResourceDefinition.SECURITY_REALM .resolveModelAttribute(context, model) .asString(); SecurityRealm.ServiceUtil.addDependency( serviceBuilder, ((HttpsListenerService) service).getSecurityRealm(), securityRealm, false); }
static ServiceController<FilterService> install( String name, ServiceTarget serviceTarget, ModelNode model, OperationContext operationContext) throws OperationFailedException { String securityKey = null; ModelNode securityKeyNode = ModClusterDefinition.SECURITY_KEY.resolveModelAttribute(operationContext, model); if (securityKeyNode.isDefined()) { securityKey = securityKeyNode.asString(); } String managementAccessPredicateString = null; ModelNode managementAccessPredicateNode = ModClusterDefinition.MANAGEMENT_ACCESS_PREDICATE.resolveModelAttribute( operationContext, model); if (managementAccessPredicateNode.isDefined()) { managementAccessPredicateString = managementAccessPredicateNode.asString(); } Predicate managementAccessPredicate = null; if (managementAccessPredicateString != null) { managementAccessPredicate = PredicateParser.parse( managementAccessPredicateString, ModClusterService.class.getClassLoader()); } final ModelNode securityRealm = ModClusterDefinition.SECURITY_REALM.resolveModelAttribute(operationContext, model); ModClusterService service = new ModClusterService( model, ModClusterDefinition.HEALTH_CHECK_INTERVAL .resolveModelAttribute(operationContext, model) .asInt(), ModClusterDefinition.MAX_REQUEST_TIME .resolveModelAttribute(operationContext, model) .asInt(), ModClusterDefinition.BROKEN_NODE_TIMEOUT .resolveModelAttribute(operationContext, model) .asInt(), ModClusterDefinition.ADVERTISE_FREQUENCY .resolveModelAttribute(operationContext, model) .asInt(), ModClusterDefinition.ADVERTISE_PATH .resolveModelAttribute(operationContext, model) .asString(), ModClusterDefinition.ADVERTISE_PROTOCOL .resolveModelAttribute(operationContext, model) .asString(), securityKey, managementAccessPredicate, ModClusterDefinition.CONNECTIONS_PER_THREAD .resolveModelAttribute(operationContext, model) .asInt(), ModClusterDefinition.CACHED_CONNECTIONS_PER_THREAD .resolveModelAttribute(operationContext, model) .asInt(), ModClusterDefinition.CONNECTION_IDLE_TIMEOUT .resolveModelAttribute(operationContext, model) .asInt(), ModClusterDefinition.REQUEST_QUEUE_SIZE .resolveModelAttribute(operationContext, model) .asInt(), ModClusterDefinition.USE_ALIAS .resolveModelAttribute(operationContext, model) .asBoolean()); ServiceBuilder<FilterService> builder = serviceTarget.addService(UndertowService.FILTER.append(name), service); builder.addDependency( SocketBinding.JBOSS_BINDING_NAME.append( ModClusterDefinition.MANAGEMENT_SOCKET_BINDING .resolveModelAttribute(operationContext, model) .asString()), SocketBinding.class, service.managementSocketBinding); builder.addDependency( SocketBinding.JBOSS_BINDING_NAME.append( ModClusterDefinition.ADVERTISE_SOCKET_BINDING .resolveModelAttribute(operationContext, model) .asString()), SocketBinding.class, service.advertiseSocketBinding); builder.addDependency( IOServices.WORKER.append( ModClusterDefinition.WORKER.resolveModelAttribute(operationContext, model).asString()), XnioWorker.class, service.workerInjectedValue); if (securityRealm.isDefined()) { SecurityRealm.ServiceUtil.addDependency( builder, service.securityRealm, securityRealm.asString(), false); } return builder.install(); }