Examples of SessionMessage


Examples of org.apache.catalina.cluster.SessionMessage

      sessionCounter++;
     
     
      if ( distribute ) {
          SessionMessage msg = new SessionMessage(
              getName(),
              SessionMessage.EVT_SESSION_CREATED,
              null,
              sessionId);
          cluster.send(msg);
View Full Code Here

Examples of org.apache.catalina.cluster.SessionMessage

                return;
            }

            if (cluster.getMembers().length > 0) {
                Member mbr = cluster.getMembers()[0];
                SessionMessage msg =
                    new SessionMessage(this.getName(),
                                       SessionMessage.EVT_GET_ALL_SESSIONS,
                                       null,
                                       "GET-ALL");
                cluster.send(msg, mbr);
                log.warn("Manager["+getName()+"], requesting session state from "+mbr+
View Full Code Here

Examples of org.apache.catalina.cluster.SessionMessage

        */
       public SessionMessage requestCompleted(String sessionId) {
           try {
               DeltaSession session = (DeltaSession) findSession(sessionId);
               DeltaRequest deltaRequest = session.getDeltaRequest();
               SessionMessage msg = null;
               if (deltaRequest.getSize() > 0) {
  
                   byte[] data = unloadDeltaRequest(deltaRequest);
                   msg = new SessionMessage(name, SessionMessage.EVT_SESSION_DELTA,
                                            data, sessionId);
                   session.resetDeltaRequest();
               } else if ( !session.isPrimarySession() ) {
                   msg = new SessionMessage(getName(),
                                         SessionMessage.EVT_SESSION_ACCESSED,
                                         null,
                                         sessionId);
               }
               session.setPrimarySession(true);
View Full Code Here

Examples of org.apache.catalina.cluster.SessionMessage

           }
  
       }
      
       protected void sessionExpired(String id) {
           SessionMessage msg = new SessionMessage(getName(),
                                                   SessionMessage.EVT_SESSION_EXPIRED,
                                                   null,
                                                   id);
           cluster.send(msg);
       }
View Full Code Here

Examples of org.apache.catalina.cluster.SessionMessage

               log.debug("Received SessionMessage of type=" + msg.getEventTypeString()+" from "+sender);
               switch (msg.getEventType()) {
                   case SessionMessage.EVT_GET_ALL_SESSIONS: {
                       //get a list of all the session from this manager
                       byte[] data = doUnload();
                       SessionMessage newmsg = new SessionMessage(name,
                           SessionMessage.EVT_ALL_SESSION_DATA,
                           data, "");
                       cluster.send(newmsg, sender);
                       break;
                   }
View Full Code Here

Examples of org.apache.catalina.cluster.SessionMessage

        {
            msg.setAddress(membershipService.getLocalMember());
            Member destination = dest;
           
            if ( msg instanceof SessionMessage ) {
                SessionMessage smsg = (SessionMessage) msg;
                //if we request session state, send to the oldest of members
                if ((destination == null) &&
                    (smsg.getEventType() == SessionMessage.EVT_GET_ALL_SESSIONS) &&
                    (membershipService.getMembers().length > 0)) {
                        destination = membershipService.getMembers()[0];
                }//end if
            }//end if
            msg.setTimestamp(System.currentTimeMillis());
View Full Code Here

Examples of org.apache.catalina.cluster.SessionMessage

                new ReplicationStream(new java.io.ByteArrayInputStream(data),
                                      getClass().getClassLoader());
            Object myobj = stream.readObject();
            if ( myobj != null && myobj instanceof SessionMessage ) {
               
                SessionMessage msg = (SessionMessage)myobj;
                log.debug("Assuming clocks are synched: Replication took="+(System.currentTimeMillis()-msg.getTimestamp())+" ms.");
                String ctxname = msg.getContextName();
                //check if the message is a EVT_GET_ALL_SESSIONS,
                //if so, wait until we are fully started up
                if ( ctxname == null ) {
                    java.util.Iterator i = managers.keySet().iterator();
                    while ( i.hasNext() ) {
View Full Code Here

Examples of org.apache.catalina.cluster.SessionMessage

     
      sessionCounter++;
     
     
      if ( distribute ) {
          SessionMessage msg = new SessionMessageImpl(
              getName(),
              SessionMessage.EVT_SESSION_CREATED,
              null,
              sessionId,
              sessionId+System.currentTimeMillis());
View Full Code Here

Examples of org.apache.catalina.cluster.SessionMessage

                return;
            }

            if (cluster.getMembers().length > 0) {
                Member mbr = cluster.getMembers()[0];
                SessionMessage msg =
                    new SessionMessageImpl(this.getName(),
                                       SessionMessage.EVT_GET_ALL_SESSIONS,
                                       null,
                                       "GET-ALL",
                                       "GET-ALL-"+getName());
View Full Code Here

Examples of org.apache.catalina.cluster.SessionMessage

        */
       public SessionMessage requestCompleted(String sessionId) {
           try {
               DeltaSession session = (DeltaSession) findSession(sessionId);
               DeltaRequest deltaRequest = session.getDeltaRequest();
               SessionMessage msg = null;
               if (deltaRequest.getSize() > 0) {
  
                   byte[] data = unloadDeltaRequest(deltaRequest);
                   msg = new SessionMessageImpl(name, SessionMessage.EVT_SESSION_DELTA,
                                            data, sessionId,
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.