Examples of BackingStoreFactory


Examples of org.glassfish.ha.store.api.BackingStoreFactory

    @Override
    public void createBackingStore(String persistenceType, String storeName, Class<T> metadataClass, Map<String, Object> vendorMap) {
        if (_logger.isLoggable(Level.FINE)) {
            _logger.fine("Create backing store invoked with persistence type " + persistenceType + " and store name " + storeName);
        }
        BackingStoreFactory factory = services.getService(BackingStoreFactory.class, persistenceType);
        BackingStoreConfiguration<String, T> conf = new BackingStoreConfiguration<String, T>();

        if(gmsAdapterService.isGmsEnabled()) {
            clusterName = gmsAdapterService.getGMSAdapter().getClusterName();
            instanceName = gmsAdapterService.getGMSAdapter().getModule().getInstanceName();
        }
        conf.setStoreName(storeName)
                .setClusterName(clusterName)
                .setInstanceName(instanceName)
                .setStoreType(persistenceType)
                .setKeyClazz(String.class).setValueClazz(metadataClass)
                .setClassLoader(this.getClass().getClassLoader());
        if (vendorMap != null) {
            conf.getVendorSpecificSettings().putAll(vendorMap);
        }

        try {
            if (_logger.isLoggable(Level.FINE)) {
                _logger.fine("About to create backing store " + conf);
            }
            this.backingStore = factory.createBackingStore(conf);
        } catch (BackingStoreException e) {
            _logger.log(Level.WARNING, "Could not create backing store", e)
        }
        Object obj = conf.getVendorSpecificSettings().get("key.mapper");
        if (obj != null && obj instanceof GlassFishHAReplicaPredictor) {
View Full Code Here

Examples of org.glassfish.ha.store.api.BackingStoreFactory

                    new BackingStoreConfiguration<String, NonceInfo>();
            bsConfig.setClusterName(props.get(CNonceCacheFactory.CLUSTER_NAME_PROP)).
                    setInstanceName(props.get(CNonceCacheFactory.INSTANCE_NAME_PROP)).
                    setStoreName(storeName).setKeyClazz(String.class)
                    .setValueClazz(NonceInfo.class);
            BackingStoreFactory bsFactory = services.getService(BackingStoreFactory.class, BS_TYPE_REPLICATED);
            backingStore = bsFactory.createBackingStore(bsConfig);
        } catch (BackingStoreException ex) {
            logger.log(Level.WARNING, null, ex);
        }
    }
View Full Code Here

Examples of org.glassfish.ha.store.api.BackingStoreFactory

    public ResponseStorage(final String endpointUid) {
        StickyReplicationManager<String, PendingResponseIdentifiers> responseIdentifiersManager = null;
        PendingMessageDataReplicationManager responseManager = null;
        if (HighAvailabilityProvider.INSTANCE.isHaEnvironmentConfigured()) {
            final BackingStoreFactory bsf = HighAvailabilityProvider.INSTANCE.getBackingStoreFactory(HighAvailabilityProvider.StoreType.IN_MEMORY);

            responseIdentifiersManager = new StickyReplicationManager<String, PendingResponseIdentifiers>(
                    endpointUid + "_MC_PENDING_MESSAGE_IDENTIFIERS_MAP_MANAGER",
                    HighAvailabilityProvider.INSTANCE.createBackingStore(
                    bsf,
View Full Code Here

Examples of org.glassfish.ha.store.api.BackingStoreFactory

            bsConfig.getVendorSpecificSettings().put("max.idle.timeout.in.seconds", maxNonceAge / 1000L);
            //bsConfig.getVendorSpecificSettings().put("local.caching", true);
            //bsConfig.setClassLoader(this.getClass().getClassLoader());
            //not sure whether this statement required or not ?
            bsConfig.getVendorSpecificSettings().put(BackingStoreConfiguration.START_GMS, true);
            final BackingStoreFactory bsFactory = HighAvailabilityProvider.INSTANCE.getBackingStoreFactory(HighAvailabilityProvider.StoreType.IN_MEMORY);
            backingStore = bsFactory.createBackingStore(bsConfig);
            localCache = new NonceCache(maxNonceAge);
            singleThreadScheduledExecutor.scheduleAtFixedRate(new nonceCleanupTask(), this.maxNonceAge, this.maxNonceAge, TimeUnit.MILLISECONDS);
        } catch (BackingStoreException ex) {
            LOGGER.log(Level.SEVERE, LogStringsMessages.WSS_0826_ERROR_INITIALIZE_BACKINGSTORE(), ex);
        }
View Full Code Here

Examples of org.glassfish.ha.store.api.BackingStoreFactory

     * @return
     * @throws DuplicateFactoryRegistrationException
     *
     */
    public static synchronized BackingStoreFactory register(String type, BackingStoreFactory factory) {
        BackingStoreFactory oldFactory = factories.put(type, factory);
        Logger.getLogger(BackingStoreFactoryRegistry.class.getName()).log(Level.INFO, "Registered "
                + factory.getClass().getName() + " for persistence-type = " + type
                + " in BackingStoreFactoryRegistry");

        return oldFactory;
View Full Code Here

Examples of org.glassfish.ha.store.api.BackingStoreFactory

     * type has not yet been instantiated then an instance is
     * created using the public no-arg constructor.
     */
    public static synchronized BackingStoreFactory getFactoryInstance(String type)
            throws BackingStoreException {
        BackingStoreFactory factory = factories.get(type);
        if (factory == null) {
            throw new BackingStoreException("Backing store for " +
                    "persistence-type " + type + " is not registered.");
        }

View Full Code Here

Examples of org.glassfish.ha.store.api.BackingStoreFactory

        this.sequenceInactivityTimeout = configuration.getRmFeature().getSequenceInactivityTimeout();

        this.actualConcurrentInboundSequences = new AtomicLong(0);
        this.maxConcurrentInboundSequences = configuration.getRmFeature().getMaxConcurrentSessions();

        final BackingStoreFactory bsFactory = HighAvailabilityProvider.INSTANCE.getBackingStoreFactory(HighAvailabilityProvider.StoreType.IN_MEMORY);
       
        /*
         * We need to explicitly set the classloader that loads the Metro module classes
         * to workaround the GF HA issue http://java.net/jira/browse/GLASSFISH-15084
         * when value class is from the Java core lib.
         */
        final String boundSequencesBsName = uniqueEndpointId + "_BOUND_SEQUENCE_BS";
        final BackingStoreConfiguration<StickyKey, String> boundSequencesBsConfig = HighAvailabilityProvider.INSTANCE.initBackingStoreConfiguration(
                boundSequencesBsName,
                StickyKey.class,
                String.class);
        boundSequencesBsConfig.setClassLoader(this.getClass().getClassLoader());               
        final BackingStore<StickyKey, String> boundSequencesBs;
        try {
            boundSequencesBs = bsFactory.createBackingStore(boundSequencesBsConfig);
        } catch (BackingStoreException ex) {
            throw new RxRuntimeException(LocalizationMessages.WSRM_1142_ERROR_CREATING_HA_BACKING_STORE(boundSequencesBsName), ex);
        }
        this.boundSequences = HighlyAvailableMap.createSticky(
                uniqueEndpointId + "_BOUND_SEQUENCE_MAP", boundSequencesBs);
View Full Code Here

Examples of org.glassfish.ha.store.api.BackingStoreFactory

   
    /** Creates a new instance of SessionManagerImpl */
    public SessionManagerImpl(WSEndpoint endpoint, boolean isSC) {
        if (isSC){
            final BackingStoreFactory bsFactory = HighAvailabilityProvider.INSTANCE.getBackingStoreFactory(HighAvailabilityProvider.StoreType.IN_MEMORY);
            this.sctBs = HighAvailabilityProvider.INSTANCE.createBackingStore(
                bsFactory,
                endpoint.getServiceName() + ":" + endpoint.getPortName()+ "_SCT_BS",
                StickyKey.class,
                HASecurityContextTokenInfo.class);
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.