Search in sources :

Example 6 with ServiceRegistryException

use of org.jboss.msc.service.ServiceRegistryException in project wildfly by wildfly.

the class SingletonServiceActivator method activate.

@Override
public void activate(ServiceActivatorContext context) {
    try {
        SingletonServiceBuilderFactory factory = (SingletonServiceBuilderFactory) context.getServiceRegistry().getRequiredService(SingletonServiceName.BUILDER.getServiceName(CONTAINER_NAME)).awaitValue();
        ServiceTarget target = context.getServiceTarget();
        install(target, factory, SERVICE_A_NAME, SERVICE_A_PREFERRED_NODE);
        install(target, factory, SERVICE_B_NAME, SERVICE_B_PREFERRED_NODE);
    } catch (InterruptedException e) {
        throw new ServiceRegistryException(e);
    }
}
Also used : SingletonServiceBuilderFactory(org.wildfly.clustering.singleton.SingletonServiceBuilderFactory) ServiceTarget(org.jboss.msc.service.ServiceTarget) ServiceRegistryException(org.jboss.msc.service.ServiceRegistryException)

Example 7 with ServiceRegistryException

use of org.jboss.msc.service.ServiceRegistryException in project wildfly by wildfly.

the class NodeServiceActivator method activate.

@Override
public void activate(ServiceActivatorContext context) {
    ServiceTarget target = context.getServiceTarget();
    try {
        SingletonServiceBuilderFactory factory = (SingletonServiceBuilderFactory) context.getServiceRegistry().getRequiredService(ServiceName.parse(SingletonDefaultCacheRequirement.SINGLETON_SERVICE_BUILDER_FACTORY.resolve(CONTAINER_NAME))).awaitValue();
        install(target, factory, DEFAULT_SERVICE_NAME, 1);
        install(target, factory, QUORUM_SERVICE_NAME, 2);
    } catch (InterruptedException e) {
        throw new ServiceRegistryException(e);
    }
}
Also used : SingletonServiceBuilderFactory(org.wildfly.clustering.singleton.SingletonServiceBuilderFactory) ServiceTarget(org.jboss.msc.service.ServiceTarget) ServiceRegistryException(org.jboss.msc.service.ServiceRegistryException)

Aggregations

ServiceRegistryException (org.jboss.msc.service.ServiceRegistryException)7 HashMap (java.util.HashMap)3 ValidatorFactory (javax.validation.ValidatorFactory)3 CapabilityServiceSupport (org.jboss.as.controller.capability.CapabilityServiceSupport)3 ProxyBeanManager (org.jboss.as.jpa.beanmanager.ProxyBeanManager)3 PhaseOnePersistenceUnitServiceImpl (org.jboss.as.jpa.service.PhaseOnePersistenceUnitServiceImpl)3 ServiceName (org.jboss.msc.service.ServiceName)3 BeanManager (javax.enterprise.inject.spi.BeanManager)2 TransactionManager (javax.transaction.TransactionManager)2 TransactionSynchronizationRegistry (javax.transaction.TransactionSynchronizationRegistry)2 BeanManagerAfterDeploymentValidation (org.jboss.as.jpa.beanmanager.BeanManagerAfterDeploymentValidation)2 PersistenceUnitServiceImpl (org.jboss.as.jpa.service.PersistenceUnitServiceImpl)2 PersistenceUnitService (org.jboss.as.jpa.spi.PersistenceUnitService)2 ServiceTarget (org.jboss.msc.service.ServiceTarget)2 SingletonPolicy (org.wildfly.clustering.singleton.SingletonPolicy)2 SingletonServiceBuilderFactory (org.wildfly.clustering.singleton.SingletonServiceBuilderFactory)2 ImmediateValue (org.jboss.msc.value.ImmediateValue)1 InjectedValue (org.jboss.msc.value.InjectedValue)1 Group (org.wildfly.clustering.group.Group)1