Examples of RamPersistence


Examples of org.red5.server.persistence.RamPersistence

  private IPersistenceStore getStore(IScope scope, boolean persistent) {
    IPersistenceStore store;
    if (!persistent) {
      // Use special store for non-persistent shared objects
      if (!scope.hasAttribute(SO_TRANSIENT_STORE)) {
        store = new RamPersistence(scope);
        scope.setAttribute(SO_TRANSIENT_STORE, store);
        return store;
      }
      return (IPersistenceStore) scope.getAttribute(SO_TRANSIENT_STORE);
    }
    // Evaluate configuration for persistent shared objects
    if (!scope.hasAttribute(SO_PERSISTENCE_STORE)) {
      try {
        store = PersistenceUtils.getPersistenceStore(scope, persistenceClassName);
        log.info("Created persistence store {} for shared objects", store);
      } catch (Exception err) {
        log.warn("Could not create persistence store ({}) for shared objects, falling back to Ram persistence", persistenceClassName, err);
        store = new RamPersistence(scope);
      }
      scope.setAttribute(SO_PERSISTENCE_STORE, store);
      return store;
    }
    return (IPersistenceStore) scope.getAttribute(SO_PERSISTENCE_STORE);
View Full Code Here

Examples of org.red5.server.persistence.RamPersistence

    private IPersistenceStore getStore(IScope scope, boolean persistent) {
    IPersistenceStore store;
    if (!persistent) {
      // Use special store for non-persistent shared objects
      if (!scope.hasAttribute(SO_TRANSIENT_STORE)) {
        store = new RamPersistence(scope);
        scope.setAttribute(SO_TRANSIENT_STORE, store);
        return store;
      }

      return (IPersistenceStore) scope.getAttribute(SO_TRANSIENT_STORE);
    }

    // Evaluate configuration for persistent shared objects
    if (!scope.hasAttribute(SO_PERSISTENCE_STORE)) {
      try {
        store = PersistenceUtils.getPersistenceStore(scope,
            persistenceClassName);
        log.info("Created persistence store " + store
            + " for shared objects.");
      } catch (Exception err) {
        log
            .error(
                "Could not create persistence store for shared objects, falling back to Ram persistence.",
                err);
        store = new RamPersistence(scope);
      }
      scope.setAttribute(SO_PERSISTENCE_STORE, store);
      return store;
    }
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.