cvs commit: jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/tcp ReplicationValve.java SimpleTcpCluster.java

2004-07-22 Thread fhanik
fhanik  2004/07/22 08:41:15

  Modified:modules/cluster/src/share/org/apache/catalina/cluster
ClusterManager.java
   modules/cluster/src/share/org/apache/catalina/cluster/session
DeltaManager.java SessionMessageImpl.java
SimpleTcpReplicationManager.java
   modules/cluster/src/share/org/apache/catalina/cluster/tcp
ReplicationValve.java SimpleTcpCluster.java
  Added:   modules/cluster/src/share/org/apache/catalina/cluster/session
SessionMessage.java
  Removed: modules/cluster/src/share/org/apache/catalina/cluster
SessionMessage.java
  Log:
  Moved the session message to the session package, it is completely unrelated to all 
other cluster activities
  
  Revision  ChangesPath
  1.6   +2 -2  
jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/ClusterManager.java
  
  Index: ClusterManager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/ClusterManager.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ClusterManager.java   26 May 2004 16:31:15 -  1.5
  +++ ClusterManager.java   22 Jul 2004 15:41:15 -  1.6
  @@ -36,7 +36,7 @@
   * receiving replication messages.
   * @param msg - the message received.
   */
  -   public void messageDataReceived(SessionMessage msg);
  +   public void messageDataReceived(ClusterMessage msg);
   
  /**
   * When the request has been completed, the replication valve
  @@ -48,7 +48,7 @@
   * @param sessionId - the sessionId that just completed.
   * @return a SessionMessage to be sent,
   */
  -   public SessionMessage requestCompleted(String sessionId);
  +   public ClusterMessage requestCompleted(String sessionId);
   
  /**
   * When the manager expires session not tied to a request.
  
  
  
  1.29  +9 -5  
jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/session/DeltaManager.java
  
  Index: DeltaManager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/session/DeltaManager.java,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- DeltaManager.java 1 Jul 2004 09:44:26 -   1.28
  +++ DeltaManager.java 22 Jul 2004 15:41:15 -  1.29
  @@ -40,7 +40,7 @@
   
   import org.apache.catalina.session.ManagerBase;
   import org.apache.catalina.cluster.ClusterManager;
  -import org.apache.catalina.cluster.SessionMessage;
  +import org.apache.catalina.cluster.ClusterMessage;
   import org.apache.catalina.cluster.Member;
   import org.apache.catalina.cluster.CatalinaCluster;
   
  @@ -753,8 +753,12 @@
   * receiving replication messages.
   * @param msg - the message received.
   */
  -   public void messageDataReceived(SessionMessage msg) {
  -   messageReceived(msg, 
msg.getAddress()!=null?(Member)msg.getAddress():null);
  +   public void messageDataReceived(ClusterMessage cmsg) {
  +   if ( cmsg instanceof SessionMessage ) {
  +   SessionMessage msg = (SessionMessage)cmsg;
  +   messageReceived(msg,
  +   msg.getAddress() != null ? (Member) msg.getAddress() 
: null);
  +   }
  }
   
  /**
  @@ -767,7 +771,7 @@
   * @param sessionId - the sessionId that just completed.
   * @return a SessionMessage to be sent,
   */
  -   public SessionMessage requestCompleted(String sessionId) {
  +   public ClusterMessage requestCompleted(String sessionId) {
  try {
  DeltaSession session = (DeltaSession) findSession(sessionId);
  DeltaRequest deltaRequest = session.getDeltaRequest();
  
  
  
  1.3   +1 -1  
jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/session/SessionMessageImpl.java
  
  Index: SessionMessageImpl.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/session/SessionMessageImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SessionMessageImpl.java   29 May 2004 02:43:58 -  1.2
  +++ SessionMessageImpl.java   22 Jul 2004 15:41:15 -  1.3
  @@ -1,6 +1,6 @@
   package org.apache.catalina.cluster.session;
   
  -import org.apache.catalina.cluster.SessionMessage;
  +
   import org.apache.catalina.cluster.Member;
   /**
* pTitle: /p
  
  
  
  1.31  +8 -4  

Re: cvs commit: jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/tcp replicationvalve.java simpletcpcluster.java

2004-07-22 Thread CDZone
THIS IS AN AUTOMATED RESPONSE FROM CDZONE

Thank you for contacting us.

If your enquiry is covered by the list below please visit
our web site at http://www.cdzone.co.uk/accounts where you can:

  * Check your order status - we are unable to provide any more
detailed information about delivery times than that shown on
your order status page
  * Obtain your password to access our site
  * Report shipments lost or damaged in the post
  * Report items faulty or sent in error
  * Add or change your email address
  * Change your delivery address
  * Change your payment details

If your query is not covered by the above please write back to us including
the tracking number 26645787D300F4785112151D95F949AD in the
subject of your message to avoid receiving this message again. Please don't
request tracklists, sleeve scans, etc. If we have the information it will be on
the web site. If your request is covered by the above listed items we will be
unable to assist you personally - please use the web site.

The top 20 lines of your message were:

 fhanik  2004/07/22 08:41:15
 
   Modified:modules/cluster/src/share/org/apache/catalina/cluster
 ClusterManager.java
modules/cluster/src/share/org/apache/catalina/cluster/session
 DeltaManager.java SessionMessageImpl.java
 SimpleTcpReplicationManager.java
modules/cluster/src/share/org/apache/catalina/cluster/tcp
 ReplicationValve.java SimpleTcpCluster.java
   Added:   modules/cluster/src/share/org/apache/catalina/cluster/session
 SessionMessage.java
   Removed: modules/cluster/src/share/org/apache/catalina/cluster
 SessionMessage.java
   Log:
   Moved the session message to the session package, it is completely unrelated to 
 all other cluster activities
   
   Revision  ChangesPath
   1.6   +2 -2  
 jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/ClusterManager.java
   
   Index: ClusterManager.java



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/tcp ReplicationValve.java SimpleTcpCluster.java

2004-01-12 Thread fhanik
fhanik  2004/01/11 23:50:07

  Modified:modules/cluster/src/share/org/apache/catalina/cluster
ClusterManager.java
   modules/cluster/src/share/org/apache/catalina/cluster/session
DeltaManager.java DeltaRequest.java
DeltaSession.java SimpleTcpReplicationManager.java
   modules/cluster/src/share/org/apache/catalina/cluster/tcp
ReplicationValve.java SimpleTcpCluster.java
  Log:
  skeleton of delta replication is complete.
  
  Revision  ChangesPath
  1.2   +18 -2 
jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/ClusterManager.java
  
  Index: ClusterManager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/ClusterManager.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ClusterManager.java   15 Nov 2003 00:58:20 -  1.1
  +++ ClusterManager.java   12 Jan 2004 07:50:06 -  1.2
  @@ -73,6 +73,8 @@
*/
   
   import org.apache.catalina.Manager;
  +import org.apache.catalina.cluster.tcp.SimpleTcpCluster;
  +
   
   public interface ClusterManager extends Manager {
   
  @@ -103,5 +105,19 @@
   * @return
   */
  public String[] getInvalidatedSessions();
  +   
  +   /**
  +* Return the name of the manager, typically the context name such as /replicator
  +* @return String
  +*/
  +   public String getName();
  +   
  +   public void setName(String name);
  +   
  +   public void setExpireSessionsOnShutdown(boolean expireSessionsOnShutdown);
  +   
  +   public void setUseDirtyFlag(boolean useDirtyFlag);
  +   
  +   public void setCluster(SimpleTcpCluster cluster);
   
   }
  
  
  
  1.3   +107 -54   
jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/session/DeltaManager.java
  
  Index: DeltaManager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/session/DeltaManager.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DeltaManager.java 12 Jan 2004 05:23:10 -  1.2
  +++ DeltaManager.java 12 Jan 2004 07:50:06 -  1.3
  @@ -174,10 +174,12 @@
   
   private SimpleTcpCluster cluster = null;
   private boolean stateTransferred;
  +private boolean useDirtyFlag;
  +private boolean expireSessionsOnShutdown;
  +private boolean printToScreen;
   // - Constructor
  -public DeltaManager(SimpleTcpCluster cluster) {
  +public DeltaManager() {
   super();
  -this.cluster = cluster;
   }
   
   // - Properties
  @@ -350,13 +352,7 @@
   }
   
 // Recycle or create a Session instance
  -  Session session = getNewDeltaSession();
  -
  -  // Initialize the properties of the new session and return it
  -  session.setNew(true);
  -  session.setValid(true);
  -  session.setCreationTime(System.currentTimeMillis());
  -  session.setMaxInactiveInterval(this.maxInactiveInterval);
  +  DeltaSession session = getNewDeltaSession();
 String sessionId = generateSessionId();
   
 String jvmRoute = getJvmRoute();
  @@ -376,7 +372,16 @@
 }
   
 session.setId(sessionId);
  +  session.resetDeltaRequest();
  +  // Initialize the properties of the new session and return it
  +  session.setNew(true);
  +  session.setValid(true);
  +  session.setCreationTime(System.currentTimeMillis());
  +  session.setMaxInactiveInterval(this.maxInactiveInterval);
  +
 sessionCounter++;
  +  
  +  
 if ( distribute ) {
 SessionMessage msg = new SessionMessage(
 getName(),
  @@ -384,8 +389,9 @@
 null,
 sessionId);
 cluster.send(msg);
  +  session.resetDeltaRequest();
 }
  -
  +  
 return (session);
   
   }
  @@ -400,7 +406,28 @@
   }
   
   
  -
  +private DeltaRequest loadDeltaRequest(byte[] data) throws
  +ClassNotFoundException, IOException {
  +ByteArrayInputStream fis = null;
  +ReplicationStream ois = null;
  +Loader loader = null;
  +ClassLoader classLoader = null;
  +fis = new ByteArrayInputStream(data);
  +BufferedInputStream bis = new BufferedInputStream(fis);
  +ois = new ReplicationStream(fis,container.getLoader().getClassLoader());
  +DeltaRequest dreq = (DeltaRequest)ois.readObject();
  +ois.close();
  +return dreq;
  +}
  +
  +private byte[] 

cvs commit: jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/tcp ReplicationValve.java SimpleTcpCluster.java

2004-01-12 Thread fhanik
fhanik  2004/01/12 21:26:59

  Modified:modules/cluster/src/share/org/apache/catalina/cluster/session
DeltaManager.java DeltaSession.java
   modules/cluster/src/share/org/apache/catalina/cluster/tcp
ReplicationValve.java SimpleTcpCluster.java
  Log:
  Implemented distributed expiration of sessions.
  
  Revision  ChangesPath
  1.6   +14 -7 
jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/session/DeltaManager.java
  
  Index: DeltaManager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/session/DeltaManager.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- DeltaManager.java 13 Jan 2004 04:22:28 -  1.5
  +++ DeltaManager.java 13 Jan 2004 05:26:59 -  1.6
  @@ -808,6 +808,14 @@
  }
  
  }
  +   
  +   protected void sessionExpired(String id) {
  +   SessionMessage msg = new SessionMessage(getName(), 
  +   
SessionMessage.EVT_SESSION_EXPIRED,
  +   null,
  +   id);
  +   cluster.send(msg);
  +   }
  
  /**
   * When the manager expires session not tied to a request.
  @@ -856,10 +864,9 @@
  break;
  }
  case SessionMessage.EVT_SESSION_EXPIRED: {
  -   Session session = findSession(msg.getSessionID());
  +   DeltaSession session = 
(DeltaSession)findSession(msg.getSessionID());
  if (session != null) {
  -   session.expire();
  -   this.remove(session);
  +   session.expire(true,false);
  } //end if
  break;
  }
  
  
  
  1.8   +29 -11
jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/session/DeltaSession.java
  
  Index: DeltaSession.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/session/DeltaSession.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- DeltaSession.java 13 Jan 2004 04:22:28 -  1.7
  +++ DeltaSession.java 13 Jan 2004 05:26:59 -  1.8
  @@ -347,7 +347,7 @@
* @param primarySession
*/
   public void setPrimarySession(boolean primarySession) {
  -   this.isPrimarySession=primarySession;
  +this.isPrimarySession=primarySession;
   }
   
   /**
  @@ -543,7 +543,7 @@
   if (isValid  interval == 0) {
   expire();
   } else {
  -if ( addDeltaRequest ) deltaRequest.setMaxInactiveInterval(interval);
  +if ( addDeltaRequest  (deltaRequest!=null) ) 
deltaRequest.setMaxInactiveInterval(interval);
   }
   
   }
  @@ -559,7 +559,7 @@
   }
   public void setNew(boolean isNew, boolean addDeltaRequest) {
   this.isNew = isNew;
  -if (addDeltaRequest) deltaRequest.setNew(isNew);
  +if (addDeltaRequest  (deltaRequest!=null)) deltaRequest.setNew(isNew);
   }
   
   
  @@ -592,7 +592,7 @@
   Principal oldPrincipal = this.principal;
   this.principal = principal;
   support.firePropertyChange(principal, oldPrincipal, this.principal);
  -if (addDeltaRequest) deltaRequest.setPrincipal(principal);
  +if (addDeltaRequest  (deltaRequest!=null)) 
deltaRequest.setPrincipal(principal);
   }
   
   
  @@ -624,6 +624,8 @@
*/
   public boolean isValid() {
   
  +
  +
   if (this.expiring){
   return true;
   }
  @@ -631,12 +633,16 @@
   if (!this.isValid ) {
   return false;
   }
  -
  +
   if (maxInactiveInterval = 0) {
   long timeNow = System.currentTimeMillis();
   int timeIdle = (int) ((timeNow - lastAccessedTime) / 1000L);
   if ( (timeIdle = maxInactiveInterval)  (isPrimarySession()) ) {
   expire(true);
  +} else if ( timeIdle = (2*maxInactiveInterval) ) {
  +//if the session has been idle twice as long as allowed,
  +//the primary session has probably crashed
  +expire(true);
   }
   }
   
  @@ -704,10 +710,16 @@
*  this session?
*/
   public void expire(boolean notify) {
  +expire(notify,true);
  +}
  +
  +public void expire(boolean notify, boolean notifyCluster) {
   
   // Mark this 

cvs commit: jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/tcp ReplicationValve.java SimpleTcpCluster.java

2003-11-14 Thread fhanik
fhanik  2003/11/14 16:58:20

  Modified:modules/cluster/src/share/org/apache/catalina/cluster/session
DeltaSession.java SimpleTcpReplicationManager.java
   modules/cluster/src/share/org/apache/catalina/cluster/tcp
ReplicationValve.java SimpleTcpCluster.java
  Added:   modules/cluster/src/share/org/apache/catalina/cluster
ClusterManager.java ClusterSession.java
SessionMessage.java
  Removed: modules/cluster/src/share/org/apache/catalina/cluster/session
ClusterManager.java ClusterSession.java
SessionMessage.java
  Log:
  refactored files to be used in a better way, more intuitive to extend,implement and 
configure
  
  Revision  ChangesPath
  1.1  
jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/ClusterManager.java
  
  Index: ClusterManager.java
  ===
  /*
   * $Header: 
/home/cvs/jakarta-tomcat-catalina/modules/cluster/src/share/org/apache/catalina/cluster/ClusterManager.java,v
 1.1 2003/11/15 00:58:20 fhanik Exp $
   * $Revision: 1.1 $
   * $Date: 2003/11/15 00:58:20 $
   *
   * 
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *notice, this list of conditions and the following disclaimer in
   *the documentation and/or other materials provided with the
   *distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *any, must include the following acknowlegement:
   *   This product includes software developed by the
   *Apache Software Foundation (http://www.apache.org/).
   *Alternately, this acknowlegement may appear in the software itself,
   *if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names The Jakarta Project, Tomcat, and Apache Software
   *Foundation must not be used to endorse or promote products derived
   *from this software without prior written permission. For written
   *permission, please contact [EMAIL PROTECTED]
   *
   * 5. Products derived from this software may not be called Apache
   *nor may Apache appear in their names without prior written
   *permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * 
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * http://www.apache.org/.
   *
   * [Additional notices, if required by prior licensing conditions]
   *
   */
  
  package org.apache.catalina.cluster;
  
  /**
   * The common interface used by all cluster manager.
   * This is so that we can have a more pluggable way
   * of swapping session managers for different algorithms.
   *
   * @author Filip Hanik
  
   */
  
  import org.apache.catalina.Manager;
  
  public interface ClusterManager extends Manager {
  
 /**
  * A message was received from another node, this
  * is the callback method to implement if you are interested in
  * receiving replication messages.
  * @param msg - the message received.
  */
 public void messageDataReceived(SessionMessage msg);
  
 /**
  * When the request has been completed, the replication valve
  * will notify the manager, and the manager will decide whether
  * any replication is needed or not.
  * If there is a need for replication, the manager will
  *