Return-Path: Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: (qmail 10804 invoked from network); 17 May 2006 17:43:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 17 May 2006 17:43:43 -0000 Received: (qmail 59029 invoked by uid 500); 17 May 2006 17:43:37 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 58962 invoked by uid 500); 17 May 2006 17:43:36 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 58950 invoked by uid 500); 17 May 2006 17:43:36 -0000 Delivered-To: apmail-jakarta-tomcat-dev@jakarta.apache.org Received: (qmail 58947 invoked by uid 99); 17 May 2006 17:43:36 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 May 2006 10:43:36 -0700 X-ASF-Spam-Status: No, hits=0.6 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [140.211.166.113] (HELO eris.apache.org) (140.211.166.113) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 May 2006 10:43:35 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 85CBE1A9835; Wed, 17 May 2006 10:43:15 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r407338 - in /tomcat/container/tc5.5.x/modules/groupcom: ./ src/share/org/apache/catalina/tribes/ src/share/org/apache/catalina/tribes/group/ src/share/org/apache/catalina/tribes/transport/ Date: Wed, 17 May 2006 17:43:14 -0000 To: tomcat-dev@jakarta.apache.org From: fhanik@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20060517174315.85CBE1A9835@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: fhanik Date: Wed May 17 10:43:13 2006 New Revision: 407338 URL: http://svn.apache.org/viewvc?rev=407338&view=rev Log: Added in heartbeat interface Added: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/Heartbeat.java Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/ChannelInterceptor.java tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/ChannelReceiver.java tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/ChannelSender.java tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/group/GroupChannel.java tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/ReceiverBase.java tomcat/container/tc5.5.x/modules/groupcom/to-do.txt Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/ChannelInterceptor.java URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/ChannelInterceptor.java?rev=407338&r1=407337&r2=407338&view=diff ============================================================================== --- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/ChannelInterceptor.java (original) +++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/ChannelInterceptor.java Wed May 17 10:43:13 2006 @@ -28,7 +28,7 @@ * @version $Revision: 304032 $, $Date: 2005-07-27 10:11:55 -0500 (Wed, 27 Jul 2005) $ */ -public interface ChannelInterceptor extends MembershipListener { +public interface ChannelInterceptor extends MembershipListener, Heartbeat { /** * An interceptor can react to a message based on a set bit on the Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/ChannelReceiver.java URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/ChannelReceiver.java?rev=407338&r1=407337&r2=407338&view=diff ============================================================================== --- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/ChannelReceiver.java (original) +++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/ChannelReceiver.java Wed May 17 10:43:13 2006 @@ -25,7 +25,7 @@ * @author Filip Hanik * @version $Revision: 379904 $, $Date: 2006-02-22 15:16:25 -0600 (Wed, 22 Feb 2006) $ */ -public interface ChannelReceiver { +public interface ChannelReceiver extends Heartbeat { /** * Start listening for incoming messages on the host/port * @throws java.io.IOException Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/ChannelSender.java URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/ChannelSender.java?rev=407338&r1=407337&r2=407338&view=diff ============================================================================== --- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/ChannelSender.java (original) +++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/ChannelSender.java Wed May 17 10:43:13 2006 @@ -26,7 +26,7 @@ * @author Filip Hanik * @version $Revision: 379904 $, $Date: 2006-02-22 15:16:25 -0600 (Wed, 22 Feb 2006) $ */ -public interface ChannelSender +public interface ChannelSender extends Heartbeat { /** * Notify the sender of a member being added to the group.
Added: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/Heartbeat.java URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/Heartbeat.java?rev=407338&view=auto ============================================================================== --- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/Heartbeat.java (added) +++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/Heartbeat.java Wed May 17 10:43:13 2006 @@ -0,0 +1,33 @@ +/* + * Copyright 1999,2004-2005 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.catalina.tribes; + +/** + * Can be implemented by the ChannelListener and Membership listeners to receive heartbeat + * notifications from the Channel + * @author Filip Hanik + * @version 1.0 + * @see Channel + * @see Channel#heartbeat() + */ +public interface Heartbeat { + + /** + * Heartbeat invokation for resources cleanup etc + */ + public void heartbeat(); + +} \ No newline at end of file Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/group/GroupChannel.java URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/group/GroupChannel.java?rev=407338&r1=407337&r2=407338&view=diff ============================================================================== --- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/group/GroupChannel.java (original) +++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/group/GroupChannel.java Wed May 17 10:43:13 2006 @@ -37,6 +37,7 @@ import org.apache.catalina.tribes.io.ChannelData; import org.apache.catalina.tribes.io.XByteBuffer; import org.apache.catalina.tribes.UniqueId; +import org.apache.catalina.tribes.Heartbeat; /** * The default implementation of a Channel.
@@ -141,6 +142,17 @@ */ public void heartbeat() { super.heartbeat(); + Iterator i = membershipListeners.iterator(); + while ( i.hasNext() ) { + Object o = i.next(); + if ( o instanceof Heartbeat ) ((Heartbeat)o).heartbeat(); + } + i = channelListeners.iterator(); + while ( i.hasNext() ) { + Object o = i.next(); + if ( o instanceof Heartbeat ) ((Heartbeat)o).heartbeat(); + } + } Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/ReceiverBase.java URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/ReceiverBase.java?rev=407338&r1=407337&r2=407338&view=diff ============================================================================== --- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/ReceiverBase.java (original) +++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/transport/ReceiverBase.java Wed May 17 10:43:13 2006 @@ -362,4 +362,8 @@ public void setTimeout(int timeout) { this.timeout = timeout; } + + public void heartbeat() { + //empty operation + } } Modified: tomcat/container/tc5.5.x/modules/groupcom/to-do.txt URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/modules/groupcom/to-do.txt?rev=407338&r1=407337&r2=407338&view=diff ============================================================================== --- tomcat/container/tc5.5.x/modules/groupcom/to-do.txt (original) +++ tomcat/container/tc5.5.x/modules/groupcom/to-do.txt Wed May 17 10:43:13 2006 @@ -40,6 +40,22 @@ Code Tasks: =========================================== + +46. Heartbeat Interface, to notify listeners as well + +44. Soft membership failure detection, ie if a webapp is stopped, but + the AbstractReplicatedMap doesn't broadcast a stop message + This is one potential solution: + 1. keep a static WeakHashMap of all map implementations running + so that we can share one heartbeat thread for timeouts + 2. everytime a message is received, update the last check time for that + member so that we don't need the thread to actively check + 3. when the thread wakes up, it will check maps that are outside + the valid range for check time, + 4. send a RPC message, if no reply, remove the map from itself + Other solution, use the TcpFailureDetector, catch send errors + + 45. McastServiceImpl.receive should have a SO_TIMEOUT so that we can check for members dropping on the same thread @@ -270,16 +286,3 @@ component, only the listener Notes: Completed. added in correct startup sequences. -44. Soft membership failure detection, ie if a webapp is stopped, but - the AbstractReplicatedMap doesn't broadcast a stop message - This is one potential solution: - 1. keep a static WeakHashMap of all map implementations running - so that we can share one heartbeat thread for timeouts - 2. everytime a message is received, update the last check time for that - member so that we don't need the thread to actively check - 3. when the thread wakes up, it will check maps that are outside - the valid range for check time, - 4. send a RPC message, if no reply, remove the map from itself - Other solution, use the TcpFailureDetector, catch send errors -Notes: The TcpFailureDetector will add this functionality by intercepting - a send failure and promote that as a member disappeared \ No newline at end of file --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org