geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jawar...@apache.org
Subject svn commit: r680793 - in /geronimo/server/branches/2.1/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat: cluster/ChannelInterceptorGBean.java cluster/StaticMemberGBean.java interceptor/DisableMcastInterceptor.java
Date Tue, 29 Jul 2008 18:00:50 GMT
Author: jawarner
Date: Tue Jul 29 11:00:49 2008
New Revision: 680793

URL: http://svn.apache.org/viewvc?rev=680793&view=rev
Log:
GERONIMO-3759: Geronimo Tomcat Clustering: No GBeans for adding Static Members

Added:
    geronimo/server/branches/2.1/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/cluster/StaticMemberGBean.java
      - copied unchanged from r680780, geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/cluster/StaticMemberGBean.java
    geronimo/server/branches/2.1/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/interceptor/DisableMcastInterceptor.java
      - copied unchanged from r680780, geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/interceptor/DisableMcastInterceptor.java
Modified:
    geronimo/server/branches/2.1/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/cluster/ChannelInterceptorGBean.java

Modified: geronimo/server/branches/2.1/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/cluster/ChannelInterceptorGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/cluster/ChannelInterceptorGBean.java?rev=680793&r1=680792&r2=680793&view=diff
==============================================================================
--- geronimo/server/branches/2.1/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/cluster/ChannelInterceptorGBean.java
(original)
+++ geronimo/server/branches/2.1/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/cluster/ChannelInterceptorGBean.java
Tue Jul 29 11:00:49 2008
@@ -24,6 +24,8 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.catalina.tribes.ChannelInterceptor;
+import org.apache.catalina.tribes.group.interceptors.StaticMembershipInterceptor;
+import org.apache.catalina.tribes.membership.StaticMember;
 
 public class ChannelInterceptorGBean extends BaseGBean {
 
@@ -39,7 +41,8 @@
         nextInterceptor = null;
     }
 
-    public ChannelInterceptorGBean(String className, Map initParams, ChannelInterceptorGBean
nextInterceptor) throws Exception {
+    public ChannelInterceptorGBean(String className, Map initParams,
+       StaticMemberGBean staticMember, ChannelInterceptorGBean nextInterceptor) throws Exception
{
 
         super(); // TODO: make it an attribute
 
@@ -64,6 +67,21 @@
         // Set the parameters
         setParameters(interceptor, initParams);
 
+        //Add the static member
+        boolean addNextStaticMember = true;
+        
+        while (addNextStaticMember) {
+            if (staticMember != null && interceptor instanceof StaticMembershipInterceptor){
+                StaticMembershipInterceptor staticMembershipInterceptor= (StaticMembershipInterceptor)
interceptor;
+                staticMembershipInterceptor.addStaticMember((StaticMember)staticMember.getInternalObject());
+                if ( addNextStaticMember = (staticMember.getNextStaticMember() != null) ?
true : false ) {
+                    staticMember = (StaticMemberGBean) staticMember.getNextStaticMember();
+                }
+            } else {
+                addNextStaticMember = false;
+            }
+        }
+
     }
 
     public Object getInternalObject() {
@@ -92,12 +110,14 @@
         GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic("ChannelInterceptor",
ChannelInterceptorGBean.class, J2EE_TYPE);
         infoFactory.addAttribute("className", String.class, true);
         infoFactory.addAttribute("initParams", Map.class, true);
+        infoFactory.addReference("StaticMember", StaticMemberGBean.class, StaticMemberGBean.J2EE_TYPE);
         infoFactory.addReference("NextInterceptor", ChannelInterceptorGBean.class, J2EE_TYPE);
         infoFactory.addOperation("getInternalObject", "Object");
         infoFactory.addOperation("getNextInterceptor","ChannelInterceptorGBean");
         infoFactory.setConstructor(new String[] { 
                 "className", 
                 "initParams", 
+                "StaticMember", 
                 "NextInterceptor" });
         
         GBEAN_INFO = infoFactory.getBeanInfo();
@@ -106,4 +126,4 @@
     public static GBeanInfo getGBeanInfo() {
         return GBEAN_INFO;
     }
-}
\ No newline at end of file
+}



Mime
View raw message