Examples of BackingStoreFactory


Examples of com.sun.appserv.ha.spi.BackingStoreFactory

    /**
     * create and set the backing store
     * @param commandMap map used to translate commands
     */    
    BackingStore createBackingStore(Map commandMap, String sipType) {
        BackingStoreFactory storeFactory = new JxtaBackingStoreFactory();
        BackingStoreRegistry backingStoreRegistry
            = BackingStoreRegistry.getInstance();
        Properties inputEnv
            = backingStoreRegistry.getFactoryClassEnv(getPassedInPersistenceType());
        Properties env = (Properties)inputEnv.clone();       
        //does this manager & backing store support duplicate id semantics
        //for batch replication usage
        env.put(DUPLICATE_IDS_SEMANTICS_PROPERTY, Boolean.valueOf(this.isDuplicateIdsSemanticsAllowed()));
        env.put(COMMAND_MAP, commandMap);
        if(sipType != null && (sipType.equals(SIP_TYPE_SAS) || sipType.equals(SIP_TYPE_SS) || sipType.equals(SIP_TYPE_ST))) {
            env.put(SUPPRESS_LOAD_ACK_PROPERTY, Boolean.TRUE);
        }
        //does this manager & backing store support replication compression
        env.put(REPLICATION_COMPRESSION_PROPERTY, Boolean.valueOf(this.isReplicationCompressionEnabled()));
        env.put(SESSION_MANAGER_PROPERTY, this);
        BackingStore backingStore = null;
        try {
            backingStore = storeFactory.createBackingStore(
                        this.getApplicationId(), //appid
                        String.class,
                        SimpleMetadata.class,     //type
                        env);
        } catch (BackingStoreException ex) {
View Full Code Here

Examples of lt.baltic_amadeus.jqbridge.providers.BackingStoreFactory

            decayInterval = 300000L;
            log.warn("option.msgid.decayInterval is very small, increasing to " + decayInterval);
        }
        assocCache = new TreeMap();
        idMap = new HashMap();
        BackingStoreFactory backStoreFactory = new MemoryBackingStore();
        backStoreFactory.init(conf, "memory");
        AssociationBackingStore backStore1 = backStoreFactory.createAssociationBackingStore();
        backStore1.loadAllAssociations(this);
        backStore = backStore1;
    }
View Full Code Here

Examples of org.glassfish.enterprise.ha.store.spi.BackingStoreFactory

     */
    public static final <S, T> BackingStore<S, T> createBackingStore(
            String storeType, String storeName, Class<S> keyClazz, Class<T> entryClazz)
            throws BackingStoreException {
        BackingStore<S, T> store = null;
        BackingStoreFactory factory = null;
        try {
            factory = BackingStoreFactoryRegistry.getFactoryInstance(storeType);
        } catch (BackingStoreException bse) {
            throw bse;
        } catch (Exception ex) {
            throw new BackingStoreException(ex.getMessage(), ex);
        }
        if (factory != null) {
            try {
                Class metaData = StoreEntryMetadataCache.getMetadata(storeName, entryClazz);
                store = factory.createBackingStore(storeName, metaData);
            } catch (Throwable th) {
                throw new BackingStoreException("Exception during createBackingStore", th);
            }
        }
        return store;
View Full Code Here

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

    @Override
    public <T extends Serializable> void  createBackingStore(String persistenceType, String storeName, Class<T> metadataClass, HashMap vendorMap) {
        if (_logger.isLoggable(Level.FINE)) {
            _logger.fine("Create backing store invoked with persistence type " + persistenceType + " and store name " + storeName);
        }
        BackingStoreFactory factory = habitat.getComponent(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

                persistenceStoreType = "file";
            }
        }


        BackingStoreFactory factory = null;
        try {
            factory = habitat.getComponent(BackingStoreFactory.class, persistenceStoreType);
        } catch (Exception ex) {
            _logger.log(Level.WARNING, "Could not instantiate backing store factory for type: " + persistenceStoreType, ex);
            persistenceStoreType = "noop";
            try {
                factory = habitat.getComponent(BackingStoreFactory.class, persistenceStoreType);
            } catch (Exception ex2) {
                _logger.log(Level.WARNING, "Could not instantiate backing store factory for type: " + persistenceStoreType, ex2);
                throw new BackingStoreException("Could not instantiate BackingStore Factory for persistence type: " + persistenceStoreType, ex);
            }
        }

        BackingStoreConfiguration<Serializable, SimpleMetadata> conf = new BackingStoreConfiguration<Serializable, SimpleMetadata>();
        String storeName = ejbDescriptor.getName() + "-" + ejbDescriptor.getUniqueId() + "-BackingStore";

        _logger.log(Level.INFO, "StatefulContainerBuilder.buildStoreManager() storeName: " + storeName);
       
        String subDirName = "";

        subDirName += ejbDescriptor.getName() + "-" + ejbDescriptor.getUniqueId();
       
        conf.setShortUniqueName(""+ejbDescriptor.getUniqueId()).setStoreName(storeName)
                .setStoreType(persistenceStoreType)
                .setBaseDirectory(new File(ejbContainerConfig.getSessionStore(), subDirName))
                .setKeyClazz(Serializable.class)
                .setValueClazz(SimpleMetadata.class)
                .setClassLoader(StatefulContainerBuilder.class.getClassLoader());


        Map<String, Object> vendorMap = conf.getVendorSpecificSettings();
        vendorMap.put("local.caching", true);
        vendorMap.put("start.gms", false);
        vendorMap.put("async.replication", asyncReplication);
        vendorMap.put("broadcast.remove.expired", false);
        vendorMap.put("value.class.is.thread.safe", true);
        vendorMap.put("key.transformer", keyGen);

        if (gmsAdapterService != null) {
            GMSAdapter gmsAdapter = gmsAdapterService.getGMSAdapter();
            if (gmsAdapter != null) {
                conf.setClusterName(gmsAdapter.getClusterName());
                conf.setInstanceName(gmsAdapter.getModule().getInstanceName());
            }
        }


        try {
            sfsbContainer.setSfsbHaPersistenceType(persistenceStoreType);
            this.backingStore = factory.createBackingStore(conf);
        } catch (Exception ex) {
            _logger.log(Level.WARNING, "Could not instantiate BackingStore for persistence type: " + persistenceStoreType, ex);
            throw new BackingStoreException("Could not instantiate BackingStore for persistence type: " + persistenceStoreType, ex);
        }
        _logger.log(Level.WARNING, "StatefulContainerbuilder instantiated store: " +
View Full Code Here

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

    @Override
    public <T extends Serializable> void  createBackingStore(String persistenceType, String storeName, Class<T> metadataClass, HashMap vendorMap) {
        if (_logger.isLoggable(Level.FINE)) {
            _logger.fine("Create backing store invoked with persistence type " + persistenceType + " and store name " + storeName);
        }
        BackingStoreFactory factory = habitat.getComponent(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

   
    protected static synchronized BackingStore getSsoEntryMetadataBackingStore(
            String persistenceType, String storeName, Habitat habitat) {

        if (ssoEntryMetadataBackingStore == null) {
            BackingStoreFactory factory = habitat.getComponent(BackingStoreFactory.class, persistenceType);
            BackingStoreConfiguration<String, HASingleSignOnEntryMetadata> conf =
                    new BackingStoreConfiguration<String, HASingleSignOnEntryMetadata>();

            String clusterName = "";
            String instanceName = "";
            GMSAdapterService gmsAdapterService = habitat.getComponent(GMSAdapterService.class);
            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(HASingleSignOnEntryMetadata.class);

            try {
                ssoEntryMetadataBackingStore = factory.createBackingStore(conf);
            } catch (BackingStoreException e) {
                e.printStackTrace()
            }
        }
View Full Code Here

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

    Events events;

    @Override
    public <K extends Serializable, V extends Serializable> BackingStore<K, V> createBackingStore(BackingStoreConfiguration<K, V> conf) throws BackingStoreException {
        try {
            BackingStoreFactory storeFactory = habitat.getService(BackingStoreFactory.class, "shoal-backing-store-factory");
            return storeFactory.createBackingStore(conf);
        } catch (Exception ex) {
            throw new BackingStoreException("Exception while created shoal cache", ex);
        }
    }
View Full Code Here

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

    }

    @Override
    public BackingStoreTransaction createBackingStoreTransaction() {
        try {
            BackingStoreFactory storeFactory = habitat.getService(BackingStoreFactory.class, "shoal-backing-store-factory");
            return storeFactory.createBackingStoreTransaction();
        } catch (Exception ex) {
            //FIXME avoid runtime exception
            throw new RuntimeException("Exception while created shoal cache", ex);
        }
    }
View Full Code Here

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

    Events events;

    @Override
    public <K extends Serializable, V extends Serializable> BackingStore<K, V> createBackingStore(BackingStoreConfiguration<K, V> conf) throws BackingStoreException {
        try {
            BackingStoreFactory storeFactory = habitat.getService(BackingStoreFactory.class, "shoal-backing-store-factory");
            return storeFactory.createBackingStore(conf);
        } catch (IllegalStateException ex) {
            String msg = "ReplicatedBackingStore requires GMS to be running in the target cluster before the application is deployed. ";
            throw new BackingStoreException("Exception while creating replicated BackingStore. " + msg, ex);
        } catch (Exception ex) {
            throw new BackingStoreException("Exception while creating shoal cache", ex);
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.