Package org.glassfish.ha.store.api

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


            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: " +
            backingStore + "; ha-enabled: " + HAEnabled + " ==> " + conf);
    }
View Full Code Here


    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

        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

            }
            this.backingStore = factory.createBackingStore(conf);
        } catch (Exception ex) {
            _logger.log(Level.WARNING, "ejb.sfsb_builder_instantiate_backing_store_exception", persistenceStoreType);
            _logger.log(Level.WARNING, "", ex);
            throw new BackingStoreException(_logger.getResourceBundle().getString(
                    "ejb.sfsb_builder_instantiate_backing_store_exception"), ex);
        }
        _logger.log(Level.INFO, "ejb.sfsb_builder_instantiated_backing_store",
                new Object[]{backingStore, HAEnabled, conf});
    }
View Full Code Here

            }
            this.backingStore = factory.createBackingStore(conf);
        } catch (Exception ex) {
            _logger.log(Level.WARNING, "ejb.sfsb_builder_instantiate_backing_store_exception", persistenceStoreType);
            _logger.log(Level.WARNING, "", ex);
            throw new BackingStoreException(_logger.getResourceBundle().getString(
                    "ejb.sfsb_builder_instantiate_backing_store_exception"), ex);
        }
        _logger.log(Level.INFO, "ejb.sfsb_builder_instantiated_backing_store",
                new Object[]{backingStore, HAEnabled, conf});
    }
View Full Code Here

                factory = habitat.getComponent(BackingStoreFactory.class, "noop");
            }
            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: " +
            backingStore + "; ha-enabled: " + HAEnabled + " ==> " + conf);
    }
View Full Code Here

            }
            this.backingStore = factory.createBackingStore(conf);
        } catch (Exception ex) {
            _logger.log(Level.WARNING, SFSB_BUILDER_INSTANTIATE_BACKING_STORE_EXCEPTION,
                    new Object[]{persistenceStoreType, ex});
            throw new BackingStoreException("Could not instantiate backing store for type [" +
                    persistenceStoreType + "]", ex);
        }
        _logger.log(Level.INFO, SFSB_BUILDER_INSTANTIATED_BACKING_STORE, new Object[]{backingStore, HAEnabled, conf});
    }
View Full Code Here

     */
    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.");
        }

        return factory;
    }
View Full Code Here

TOP

Related Classes of org.glassfish.ha.store.api.BackingStoreException

Copyright © 2018 www.massapicom. 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.