Package org.glassfish.ha.store.api

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


            sb.append("}");
            _logger.finest(sb.toString());
        }
        ReplicationManagerBase mgr
            = (ReplicationManagerBase)this.getManager();
        BackingStore replicator = mgr.getBackingStore();
        if(_logger.isLoggable(Level.FINE)) {
            _logger.fine("ReplicationStore>>doValveSave replicator: " + replicator);
            _logger.fine("ReplicationStore>>doValveSave version:" + session.getVersion());                      
        }       
        SimpleMetadata simpleMetadata =
            SimpleMetadataFactory.createSimpleMetadata(session.getVersion()//version
                session.getLastAccessedTime(), //lastaccesstime
                session.getMaxInactiveInterval()*1000L, //maxinactiveinterval
                sessionState); //state
        if (_logger.isLoggable(Level.FINEST)) {
            _logger.finest("In doValveSave metadata is " + simpleMetadata);
        }
        try {
            HASession haSess = (HASession)session;
            replicator.save(session.getIdInternal(), //id
                    simpleMetadata, haSess.isPersistent());

            if (_logger.isLoggable(Level.FINE)) {
                _logger.fine("Save succeeded.");
            }
View Full Code Here


    public void stop() {
        try {
            super.stop();
            ReplicationManagerBase mgr
             = (ReplicationManagerBase)this.getManager();
            BackingStore backingStore = mgr.getBackingStore();
            backingStore.destroy();
        } catch (BackingStoreException e) {

        } catch (LifecycleException le) {
        
        }
View Full Code Here

     */
    public void doSave(Session session) throws IOException {
        byte[] sessionState = this.getByteArray(session, isReplicationCompressionEnabled());
        ReplicationManagerBase mgr
            = (ReplicationManagerBase)this.getManager();
        BackingStore backingStore = mgr.getBackingStore();
        if(_logger.isLoggable(Level.FINE)) {
            _logger.fine("ReplicationStore>>save: backing store : " + backingStore);
        }
        SimpleMetadata simpleMetadata =
            SimpleMetadataFactory.createSimpleMetadata(session.getVersion()//version
                session.getLastAccessedTime(), //lastaccesstime
                session.getMaxInactiveInterval()*1000L, //maxinactiveinterval
                sessionState); //state

        try {
            backingStore.save(session.getIdInternal(), //id
                    simpleMetadata, !((HASession)session).isPersistent())//TODO: Revist the last param
        } catch (BackingStoreException ex) {
            IOException ex1 =
                (IOException) new IOException("Error during save: " + ex.getMessage()).initCause(ex);
            throw ex1;
View Full Code Here

        if(_logger.isLoggable(Level.FINE)) {
            _logger.fine("ReplicationStore>>doRemove");
        }
        ReplicationManagerBase mgr
            = (ReplicationManagerBase)this.getManager();
        BackingStore replicator = mgr.getBackingStore();
        if(_logger.isLoggable(Level.FINE)) {
            _logger.fine("ReplicationStore>>doRemove: replicator: " + replicator);                      
        }       
        try {
            replicator.remove(id);
        } catch (BackingStoreException ex) {
            _logger.log(Level.WARNING, "Exception during removing synchronized from backing store", ex);
        }
    }    
View Full Code Here

        if(_logger.isLoggable(Level.FINE)) {
            _logger.fine("ReplicationStore>>removeSynchronized");                      
        }        
        ReplicationManagerBase mgr
            = (ReplicationManagerBase)this.getManager();
        BackingStore replicator = mgr.getBackingStore();
        if(_logger.isLoggable(Level.FINE)) {
            _logger.fine("ReplicationStore>>removeSynchronized: replicator: " + replicator);                      
        }       
        try {
            replicator.remove(id);
        } catch (BackingStoreException ex) {
            _logger.log(Level.WARNING, "Exception during removing synchronized from backing store", ex);
        }
    }
View Full Code Here

        ReplicationManagerBase mgr
            = (ReplicationManagerBase)this.getManager();
        if(mgr == null) {
            return result;
        }
        BackingStore backingStore = mgr.getBackingStore();
        if (backingStore != null) {
            try {
                result = backingStore.removeExpired(mgr.getMaxInactiveInterval());
            } catch (BackingStoreException ex) {
                _logger.log(Level.WARNING, "Exception during removing expired session from backing store", ex);
            }
        }
        if(_logger.isLoggable(Level.FINE)) {
View Full Code Here

    }

    BackingStore getBackingStore() {
        ReplicationManagerBase mgr
                = (ReplicationManagerBase) this.getManager();
        BackingStore replicator = mgr.getBackingStore();
        return replicator;
    }
View Full Code Here

     */   
    public void updateLastAccessTime(Session session) throws IOException {
       
        ReplicationManagerBase mgr
            = (ReplicationManagerBase)this.getManager();
        BackingStore backingStore = mgr.getBackingStore();
        if(_logger.isLoggable(Level.FINE)) {
            _logger.fine("ReplicationStore>>updateLastAccessTime: replicator: " + backingStore);                      
        }        
        try {
            backingStore.updateTimestamp(session.getIdInternal(), ""+session.getVersion(),
                    ((BaseHASession)session).getLastAccessedTimeInternal());
        } catch (BackingStoreException ex) {
            //FIXME
        }
    }       
View Full Code Here

   
    public int getSize() throws IOException {
        int result = 0;
        ReplicationManagerBase mgr
            = (ReplicationManagerBase)this.getManager();
        BackingStore replicator = mgr.getBackingStore();
        if(_logger.isLoggable(Level.FINE)) {
            _logger.fine("ReplicationStore>>getSize: replicator: " + replicator);                      
        }        
        try {
            result = replicator.size();
        } catch (BackingStoreException ex) {
            if (_logger.isLoggable(Level.FINE)) {
                _logger.log(Level.FINE, "Exception is getSize",ex);   
            }
View Full Code Here

            userName = session.getPrincipal().getName();
            ((BaseHASession)session).setUserName(userName);
        }       
        ReplicationManagerBase mgr
            = (ReplicationManagerBase)this.getManager();
        BackingStore replicator = mgr.getBackingStore();                   
        if(_logger.isLoggable(Level.FINE)) {
            _logger.fine("ReplicationAttributeStore>>save: replicator: " + replicator);                   
        }        
        CompositeMetadata compositeMetadata
            = createCompositeMetadata(modAttrSession);
               
        try {
            if (_logger.isLoggable(Level.FINE)) {
                _logger.fine("CompositeMetadata is " + compositeMetadata + " id is " + session.getIdInternal());
            }
            replicator.save(session.getIdInternal(), //id
                    compositeMetadata, !((HASession) session).isPersistent());
            modAttrSession.resetAttributeState();
            postSaveUpdate(modAttrSession);
        } catch (BackingStoreException ex) {
            //FIXME
View Full Code Here

TOP

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

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.