Examples of ClusteredBackingCacheEntryStoreConfig


Examples of org.jboss.as.ejb3.cache.impl.backing.clustering.ClusteredBackingCacheEntryStoreConfig

    @Override
    Collection<ServiceController<?>> installRuntimeServices(OperationContext context, ModelNode operation, ModelNode model, ServiceVerificationHandler verificationHandler) throws OperationFailedException {
        final String name = PathAddress.pathAddress(operation.get(ModelDescriptionConstants.ADDRESS)).getLastElement().getValue();
        ClusteredBackingCacheEntryStoreSourceService<?, ?, ?> service = new ClusteredBackingCacheEntryStoreSourceService<Serializable, Cacheable<Serializable>, Serializable>(name);
        ClusteredBackingCacheEntryStoreConfig config = service.getValue();
        config.setCacheContainer(ClusterPassivationStoreResourceDefinition.CACHE_CONTAINER.resolveModelAttribute(context, model).asString());
        ModelNode beanCacheNode = ClusterPassivationStoreResourceDefinition.BEAN_CACHE.resolveModelAttribute(context, model);
        if (beanCacheNode.isDefined()) {
            config.setBeanCache(beanCacheNode.asString());
        }
        config.setClientMappingCache(ClusterPassivationStoreResourceDefinition.CLIENT_MAPPINGS_CACHE.resolveModelAttribute(context, model).asString());
        config.setPassivateEventsOnReplicate(ClusterPassivationStoreResourceDefinition.PASSIVATE_EVENTS_ON_REPLICATE.resolveModelAttribute(context, model).asBoolean());

        ServiceName serviceName = ClusteredBackingCacheEntryStoreSourceService.getPassivationStoreClusterNameServiceName(name);
        ServiceRegistry registry = context.getServiceRegistry(true);
        if (registry.getService(serviceName) != null) {
            context.removeService(serviceName);
        }
        InjectedValue<String> clusterName = new InjectedValue<String>();
        ServiceController<?> controller = context.getServiceTarget().addService(serviceName, new ValueService<String>(clusterName))
                .addDependency(ClusteredBackingCacheEntryStoreSourceService.getCacheContainerClusterNameServiceName(config.getCacheContainer()), String.class, clusterName)
                .setInitialMode(ServiceController.Mode.ON_DEMAND)
                .install();
        return Arrays.asList(this.installBackingCacheEntryStoreSourceService(service, context, model, verificationHandler), controller);
    }
View Full Code Here

Examples of org.jboss.as.ejb3.cache.impl.backing.clustering.ClusteredBackingCacheEntryStoreConfig

    @Override
    protected BackingCacheEntryStoreSourceService<?, ?, ?, ?> createService(ModelNode model) {
        String name = model.require(EJB3SubsystemModel.NAME).asString();
        ClusteredBackingCacheEntryStoreSourceService<?, ?, ?> service = new ClusteredBackingCacheEntryStoreSourceService<Serializable, Cacheable<Serializable>, Serializable>(name);
        ClusteredBackingCacheEntryStoreConfig config = service.getValue();
        if (model.hasDefined(EJB3SubsystemModel.CACHE_CONTAINER)) {
            config.setCacheContainer(model.get(EJB3SubsystemModel.CACHE_CONTAINER).asString());
        }
        if (model.hasDefined(EJB3SubsystemModel.BEAN_CACHE)) {
            config.setBeanCache(model.get(EJB3SubsystemModel.BEAN_CACHE).asString());
        }
        if (model.hasDefined(EJB3SubsystemModel.CLIENT_MAPPINGS_CACHE)) {
            config.setClientMappingCache(model.get(EJB3SubsystemModel.CLIENT_MAPPINGS_CACHE).asString());
        }
        if (model.hasDefined(EJB3SubsystemModel.PASSIVATE_EVENTS_ON_REPLICATE)) {
            config.setPassivateEventsOnReplicate(model.get(EJB3SubsystemModel.PASSIVATE_EVENTS_ON_REPLICATE).asBoolean());
        }
        return service;
    }
View Full Code Here

Examples of org.jboss.as.ejb3.cache.impl.backing.clustering.ClusteredBackingCacheEntryStoreConfig

    @Override
    Collection<ServiceController<?>> installRuntimeServices(OperationContext context, ModelNode model, ServiceVerificationHandler verificationHandler) throws OperationFailedException {
        String name = model.require(EJB3SubsystemModel.NAME).asString();
        ClusteredBackingCacheEntryStoreSourceService<?, ?, ?> service = new ClusteredBackingCacheEntryStoreSourceService<Serializable, Cacheable<Serializable>, Serializable>(name);
        ClusteredBackingCacheEntryStoreConfig config = service.getValue();
        if (model.hasDefined(EJB3SubsystemModel.CACHE_CONTAINER)) {
            config.setCacheContainer(model.get(EJB3SubsystemModel.CACHE_CONTAINER).asString());
        }
        if (model.hasDefined(EJB3SubsystemModel.BEAN_CACHE)) {
            config.setBeanCache(model.get(EJB3SubsystemModel.BEAN_CACHE).asString());
        }
        if (model.hasDefined(EJB3SubsystemModel.CLIENT_MAPPINGS_CACHE)) {
            config.setClientMappingCache(model.get(EJB3SubsystemModel.CLIENT_MAPPINGS_CACHE).asString());
        }
        if (model.hasDefined(EJB3SubsystemModel.PASSIVATE_EVENTS_ON_REPLICATE)) {
            config.setPassivateEventsOnReplicate(model.get(EJB3SubsystemModel.PASSIVATE_EVENTS_ON_REPLICATE).asBoolean());
        }
        ServiceName serviceName = ClusteredBackingCacheEntryStoreSourceService.getPassivationStoreClusterNameServiceName(name);
        ServiceRegistry registry = context.getServiceRegistry(true);
        if (registry.getService(serviceName) != null) {
            context.removeService(serviceName);
        }
        InjectedValue<String> clusterName = new InjectedValue<String>();
        ServiceController<?> controller = context.getServiceTarget().addService(serviceName, new ValueService<String>(clusterName))
                .addDependency(ClusteredBackingCacheEntryStoreSourceService.getCacheContainerClusterNameServiceName(config.getCacheContainer()), String.class, clusterName)
                .setInitialMode(ServiceController.Mode.ON_DEMAND)
                .install()
        ;
        return Arrays.<ServiceController<?>>asList(this.installBackingCacheEntryStoreSourceService(service, context, model, verificationHandler), controller);
    }
View Full Code Here

Examples of org.jboss.as.ejb3.cache.impl.backing.clustering.ClusteredBackingCacheEntryStoreConfig

    @Override
    protected BackingCacheEntryStoreSourceService<?, ?, ?, ?> createService(ModelNode model) {
        String name = model.require(EJB3SubsystemModel.NAME).asString();
        ClusteredBackingCacheEntryStoreSourceService<?, ?, ?> service = new ClusteredBackingCacheEntryStoreSourceService<Serializable, Cacheable<Serializable>, Serializable>(name);
        ClusteredBackingCacheEntryStoreConfig config = service.getValue();
        if (model.hasDefined(EJB3SubsystemModel.BACKING_CACHE)) {
            config.setBackingCache(model.get(EJB3SubsystemModel.BACKING_CACHE).asString());
        }
        if (model.hasDefined(EJB3SubsystemModel.PASSIVATE_EVENTS_ON_REPLICATE)) {
            config.setPassivateEventsOnReplicate(model.get(EJB3SubsystemModel.PASSIVATE_EVENTS_ON_REPLICATE).asBoolean());
        }
        return service;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.