Search in sources :

Example 6 with IdentityServiceConfigurator

use of org.wildfly.clustering.service.IdentityServiceConfigurator in project wildfly by wildfly.

the class SingletonServiceHandler method installServices.

@Override
public void installServices(OperationContext context, ModelNode model) throws OperationFailedException {
    String defaultPolicy = DEFAULT.resolveModelAttribute(context, model).asString();
    ServiceTarget target = context.getServiceTarget();
    ServiceName serviceName = Capability.DEFAULT_POLICY.getServiceName(context.getCurrentAddress());
    ServiceName targetServiceName = SingletonServiceNameFactory.SINGLETON_POLICY.getServiceName(context, defaultPolicy);
    new IdentityServiceConfigurator<>(serviceName, targetServiceName).build(target).install();
    // Use legacy service installation for legacy capability
    ServiceName legacyServiceName = Capability.DEFAULT_LEGACY_POLICY.getServiceName(context.getCurrentAddress());
    new AliasServiceBuilder<>(legacyServiceName, targetServiceName, SingletonRequirement.SINGLETON_POLICY.getType()).build(target).install();
}
Also used : ServiceName(org.jboss.msc.service.ServiceName) ServiceTarget(org.jboss.msc.service.ServiceTarget) IdentityServiceConfigurator(org.wildfly.clustering.service.IdentityServiceConfigurator)

Example 7 with IdentityServiceConfigurator

use of org.wildfly.clustering.service.IdentityServiceConfigurator in project wildfly by wildfly.

the class ChannelServiceHandler method installServices.

@Override
public void installServices(OperationContext context, ModelNode model) throws OperationFailedException {
    PathAddress address = context.getCurrentAddress();
    String name = context.getCurrentAddressValue();
    String stack = STACK.resolveModelAttribute(context, model).asString();
    ServiceTarget target = context.getServiceTarget();
    new ChannelClusterServiceConfigurator(address).configure(context, model).build(target).install();
    ChannelServiceConfigurator channelBuilder = new ChannelServiceConfigurator(JCHANNEL, address).statisticsEnabled(STATISTICS_ENABLED.resolveModelAttribute(context, model).asBoolean());
    channelBuilder.configure(context, model).build(target).install();
    new IdentityServiceConfigurator<>(JCHANNEL_FACTORY.getServiceName(address), JGroupsRequirement.CHANNEL_FACTORY.getServiceName(context, stack)).build(target).install();
    new ForkChannelFactoryServiceConfigurator(FORK_CHANNEL_FACTORY, address.append(ForkResourceDefinition.pathElement(name))).configure(context, new ModelNode()).build(target).install();
    new ModuleServiceConfigurator(JCHANNEL_MODULE.getServiceName(address), MODULE).configure(context, model).build(target).setInitialMode(ServiceController.Mode.PASSIVE).install();
    new ServiceValueCaptorServiceConfigurator<>(this.registry.add(channelBuilder.getServiceName())).build(target).install();
    new BinderServiceConfigurator(JGroupsBindingFactory.createChannelBinding(name), JGroupsRequirement.CHANNEL.getServiceName(context, name)).build(target).install();
    new BinderServiceConfigurator(JGroupsBindingFactory.createChannelFactoryBinding(name), JGroupsRequirement.CHANNEL_FACTORY.getServiceName(context, name)).build(target).install();
    // Install group services for channel
    ServiceNameRegistry<ClusteringRequirement> registry = new CapabilityServiceNameRegistry<>(CLUSTERING_CAPABILITIES, address);
    for (GroupServiceConfiguratorProvider provider : ServiceLoader.load(DistributedGroupServiceConfiguratorProvider.class, DistributedGroupServiceConfiguratorProvider.class.getClassLoader())) {
        for (CapabilityServiceConfigurator configurator : provider.getServiceConfigurators(registry, name)) {
            JGroupsLogger.ROOT_LOGGER.debugf("Installing %s for channel %s", configurator.getServiceName(), name);
            configurator.configure(context).build(target).install();
        }
    }
}
Also used : CapabilityServiceNameRegistry(org.wildfly.clustering.spi.CapabilityServiceNameRegistry) BinderServiceConfigurator(org.jboss.as.clustering.naming.BinderServiceConfigurator) CapabilityServiceConfigurator(org.jboss.as.clustering.controller.CapabilityServiceConfigurator) ServiceTarget(org.jboss.msc.service.ServiceTarget) ServiceValueCaptorServiceConfigurator(org.jboss.as.clustering.controller.ServiceValueCaptorServiceConfigurator) DistributedGroupServiceConfiguratorProvider(org.wildfly.clustering.spi.DistributedGroupServiceConfiguratorProvider) GroupServiceConfiguratorProvider(org.wildfly.clustering.spi.GroupServiceConfiguratorProvider) DistributedGroupServiceConfiguratorProvider(org.wildfly.clustering.spi.DistributedGroupServiceConfiguratorProvider) ModuleServiceConfigurator(org.jboss.as.clustering.controller.ModuleServiceConfigurator) PathAddress(org.jboss.as.controller.PathAddress) ClusteringRequirement(org.wildfly.clustering.spi.ClusteringRequirement) ModelNode(org.jboss.dmr.ModelNode) IdentityServiceConfigurator(org.wildfly.clustering.service.IdentityServiceConfigurator)

Example 8 with IdentityServiceConfigurator

use of org.wildfly.clustering.service.IdentityServiceConfigurator in project wildfly by wildfly.

the class ForkServiceHandler method installServices.

@Override
public void installServices(OperationContext context, ModelNode model) throws OperationFailedException {
    super.installServices(context, model);
    PathAddress address = context.getCurrentAddress();
    String name = address.getLastElement().getValue();
    String channel = address.getParent().getLastElement().getValue();
    ServiceTarget target = context.getServiceTarget();
    new IdentityServiceConfigurator<>(FORK_CHANNEL_SOURCE.getServiceName(address), JGroupsRequirement.CHANNEL_FACTORY.getServiceName(context, channel)).build(target).install();
    new IdentityServiceConfigurator<>(FORK_CHANNEL_MODULE.getServiceName(address), JGroupsRequirement.CHANNEL_MODULE.getServiceName(context, channel)).build(target).install();
    new IdentityServiceConfigurator<>(FORK_CHANNEL_CLUSTER.getServiceName(address), JGroupsRequirement.CHANNEL_CLUSTER.getServiceName(context, channel)).build(target).install();
    new ChannelServiceConfigurator(FORK_CHANNEL, address).configure(context, model).build(target).install();
    new BinderServiceConfigurator(JGroupsBindingFactory.createChannelBinding(name), JGroupsRequirement.CHANNEL.getServiceName(context, name)).build(target).install();
    new BinderServiceConfigurator(JGroupsBindingFactory.createChannelFactoryBinding(name), JGroupsRequirement.CHANNEL_FACTORY.getServiceName(context, name)).build(target).install();
    ServiceNameRegistry<ClusteringRequirement> registry = new CapabilityServiceNameRegistry<>(CLUSTERING_CAPABILITIES, address);
    for (IdentityGroupServiceConfiguratorProvider provider : ServiceLoader.load(IdentityGroupServiceConfiguratorProvider.class, IdentityGroupServiceConfiguratorProvider.class.getClassLoader())) {
        for (CapabilityServiceConfigurator configurator : provider.getServiceConfigurators(registry, name, channel)) {
            configurator.configure(context).build(target).install();
        }
    }
}
Also used : IdentityGroupServiceConfiguratorProvider(org.wildfly.clustering.spi.IdentityGroupServiceConfiguratorProvider) CapabilityServiceNameRegistry(org.wildfly.clustering.spi.CapabilityServiceNameRegistry) BinderServiceConfigurator(org.jboss.as.clustering.naming.BinderServiceConfigurator) CapabilityServiceConfigurator(org.jboss.as.clustering.controller.CapabilityServiceConfigurator) PathAddress(org.jboss.as.controller.PathAddress) ServiceTarget(org.jboss.msc.service.ServiceTarget) ClusteringRequirement(org.wildfly.clustering.spi.ClusteringRequirement) IdentityServiceConfigurator(org.wildfly.clustering.service.IdentityServiceConfigurator)

Aggregations

IdentityServiceConfigurator (org.wildfly.clustering.service.IdentityServiceConfigurator)8 ServiceTarget (org.jboss.msc.service.ServiceTarget)7 CapabilityServiceConfigurator (org.jboss.as.clustering.controller.CapabilityServiceConfigurator)5 BinderServiceConfigurator (org.jboss.as.clustering.naming.BinderServiceConfigurator)5 PathAddress (org.jboss.as.controller.PathAddress)5 CapabilityServiceNameRegistry (org.wildfly.clustering.spi.CapabilityServiceNameRegistry)5 ModelNode (org.jboss.dmr.ModelNode)3 ClusteringRequirement (org.wildfly.clustering.spi.ClusteringRequirement)3 Map (java.util.Map)2 Capability (org.jboss.as.clustering.controller.Capability)2 ModulesServiceConfigurator (org.jboss.as.clustering.controller.ModulesServiceConfigurator)2 ServiceValueCaptorServiceConfigurator (org.jboss.as.clustering.controller.ServiceValueCaptorServiceConfigurator)2 CacheFactoryBuilderServiceNameProvider (org.jboss.as.ejb3.cache.CacheFactoryBuilderServiceNameProvider)2 ServiceName (org.jboss.msc.service.ServiceName)2 ClusteringCacheRequirement (org.wildfly.clustering.spi.ClusteringCacheRequirement)2 IdentityGroupServiceConfiguratorProvider (org.wildfly.clustering.spi.IdentityGroupServiceConfiguratorProvider)2 ModuleServiceConfigurator (org.jboss.as.clustering.controller.ModuleServiceConfigurator)1 DistributableCacheFactoryBuilderServiceNameProvider (org.jboss.as.ejb3.cache.distributable.DistributableCacheFactoryBuilderServiceNameProvider)1 SimpleCacheFactoryBuilderServiceConfigurator (org.jboss.as.ejb3.cache.simple.SimpleCacheFactoryBuilderServiceConfigurator)1 ServiceRegistry (org.jboss.msc.service.ServiceRegistry)1