Package com.sun.enterprise.ee.web.sessmgmt

Examples of com.sun.enterprise.ee.web.sessmgmt.ReplicationState


         */
        BaseCache replicaCache = getReplicaCache();
        if(replicaCache != null) {
            replicaCache.remove(id);
        }
        ReplicationState sessionState = loadTimerFromRemoteActiveCache(
                id, String.valueOf(expat.getVersion()), expat.getInstanceName());
        if (_logger.isLoggable(Level.FINE)) {
            _logger.fine("ServletTimerStoreImpl>>loadFromActiveCache:id="
                    + id + ", sessionState=" + sessionState);
        }
View Full Code Here


        if(id == null) {
            return result;
        }
        SipTransactionPersistentManager repMgr
            = (SipTransactionPersistentManager)this.getSipSessionManager();
        ReplicationState localCachedState
            = repMgr.removeFromServletTimerReplicationCache(id);
        //check if we got a hit from our own replica cache
        //and check if we can trust it. If so save and return it immediately
        boolean trustCachedState = canTrustLocallyCachedState(id, version, localCachedState);
        ReplicationState bestState = null;
        if(_logger.isLoggable(Level.FINE)) {
            _logger.fine("ServletTimerStoreImpl>>__load:id= " + id + ", localCachedState=" +
                    localCachedState + ", trustCachedState=" + trustCachedState);
        }
        if(trustCachedState) {
            bestState = localCachedState;
        } else {
            ReplicationState broadcastResultState =
                    findServletTimerViaBroadcastOrUnicast(id, version);
            bestState = ReplicationState.getBestResult(localCachedState, broadcastResultState);
            if(_logger.isLoggable(Level.FINE)) {
                _logger.fine("ServletTimerStoreImpl>>__load:id=" + id + ", broadcastResultState " +
                        "from broadcast or unicast=" + broadcastResultState + ", bestState = " + bestState);
View Full Code Here

        }
        if(_logger.isLoggable(Level.FINE)) {
            _logger.fine("ServletTimerStoreImpl>>findServletTimerViaBroadcast: replicator: " + replicator);
        }

        ReplicationState queryResult = jxtaReplicator != null ?
                jxtaReplicator.__load(id, version) : null;
        return queryResult;
    }
View Full Code Here

    private ReplicationState loadTimerFromRemoteActiveCache(String id,
                                                              String version,
                                                              String instanceName)
            throws BackingStoreException {
        ReplicationState returnState = findServletTimerViaUnicast(id, version, instanceName);
        if (returnState != null && returnState.getState() != null) {
            __addToRemotelyLoadedSessionIds(id);
            removeExpatListElementFor(id);
        }
        return returnState;
    }
View Full Code Here

        return sendUnicastLoadQuery(id, version, instanceName);
    }

    SimpleMetadata loadUnicast(String id, String version, String instanceName)
        throws BackingStoreException {
        ReplicationState returnState = sendUnicastLoadQuery(id, version, instanceName);
        SimpleMetadata result = ReplicationState.createSimpleMetadataFrom(
                returnState, isReplicationCompressionEnabled());
        if(result != null) {
            __addToRemotelyLoadedSessionIds(id); // Maintain this id, we need to remove state replica sessions after the next save.
        }
View Full Code Here

        BackingStore replicator = mgr.getServletTimerBackingStore();
        if(!(replicator instanceof JxtaBackingStoreImpl)) {
            return null;
        }
        JxtaBackingStoreImpl jxtaReplicator = (JxtaBackingStoreImpl)replicator;
        ReplicationState transmitState = null;
        byte[] timerState = ReplicationUtil.getByteArray(haTimer, isReplicationCompressionEnabled());

        SimpleMetadata simpleMetadata =
            SimpleMetadataFactory.createSimpleMetadata(
                haTimer.getVersion(),
View Full Code Here

        throws IOException {
        //send load advisory to instanceName
        SipTransactionPersistentManager mgr
            = (SipTransactionPersistentManager)getSipSessionManager();
        String theCommand = mgr.MESSAGE_LOAD_ADVISORY_SERVLET_TIMER;
        ReplicationState loadAdvisoryState
            = ReplicationState.createUnicastLoadAdvisoryState(MODE_SIP, id, this.getApplicationId(), 0L, mgr.getInstanceName(), theCommand);
        JxtaReplicationSender sender
            = JxtaReplicationSender.createInstance();
        //sender.sendOverPropagatedPipe(loadAdvisoryState, instanceName, false);
        sender.sendReplicationAdvisoryState(loadAdvisoryState, instanceName);
View Full Code Here

    void sendUnicastLoadAcknowledgement(String id, String instanceName, String bekey) {
        //send load received ack to instanceName
        SipTransactionPersistentManager mgr
            = (SipTransactionPersistentManager)getSipSessionManager();
        String theCommand = mgr.MESSAGE_BROADCAST_LOAD_RECEIVED_SERVLET_TIMER;
        ReplicationState loadReceivedState =
            ReplicationState.createBroadcastLoadReceivedState(MODE_SIP, id, this.getApplicationId(), 0L, mgr.getInstanceName(), theCommand);
  loadReceivedState.setProperty(
      ReplicationState.IGNORE_REMOVE_INSTANCE_NAME, bekey);
        JxtaReplicationSender sender
            = JxtaReplicationSender.createInstance();
        sender.sendOverPropagatedPipe(loadReceivedState, instanceName, false);
        //if we want to batch unicast load acks use next line
View Full Code Here

    ReplicationState sendUnicastLoadQuery(String id, String version, String instanceName) {
        //send load query to instanceName via unicast
        SipTransactionPersistentManager mgr
            = (SipTransactionPersistentManager)getSipSessionManager();
        String theCommand = mgr.LOAD_SERVLET_TIMER_COMMAND;
        ReplicationState loadState
            = ReplicationState.createUnicastLoadState(MODE_SIP, id, this.getApplicationId(), ReplicationUtil.parseLong(version), mgr.getInstanceName(), theCommand);
        JxtaReplicationSender sender
            = JxtaReplicationSender.createInstance();
        ReplicationState returnState
            = sender.sendReplicationLoadState(loadState, instanceName, useReplicationUnicastLoadBatching);
        return returnState;
    }
View Full Code Here

     * @param beKey the beKey
     */
    protected void sendLoadAcknowledgement(ReplicationState bestState, String command, String beKey) {
        // Send acknowledgement of load receipt
        // No response to wait for in this case
        ReplicationState loadReceivedState =
            ReplicationState.createBroadcastLoadReceivedState(
                MODE_SIP, (String)bestState.getId(),
                getApplicationId(), bestState.getVersion(),
                ReplicationUtil.getInstanceName(), command);
        sendLoadAcknowledgement(loadReceivedState, beKey);
View Full Code Here

TOP

Related Classes of com.sun.enterprise.ee.web.sessmgmt.ReplicationState

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.