axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chamik...@apache.org
Subject svn commit: r538069 - in /webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/cluster: listeners/ tribes/ tribes/configuration/ tribes/context/
Date Tue, 15 May 2007 06:34:26 GMT
Author: chamikara
Date: Mon May 14 23:34:25 2007
New Revision: 538069

URL: http://svn.apache.org/viewvc?view=rev&rev=538069
Log:
Added some debug logs for clustering

Modified:
    webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/cluster/listeners/DefaultContextManagerListener.java
    webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/cluster/tribes/TribesClusterManager.java
    webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/cluster/tribes/configuration/TribesConfigurationManager.java
    webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/cluster/tribes/context/TribesContextManager.java

Modified: webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/cluster/listeners/DefaultContextManagerListener.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/cluster/listeners/DefaultContextManagerListener.java?view=diff&rev=538069&r1=538068&r2=538069
==============================================================================
--- webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/cluster/listeners/DefaultContextManagerListener.java
(original)
+++ webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/cluster/listeners/DefaultContextManagerListener.java
Mon May 14 23:34:25 2007
@@ -48,6 +48,9 @@
 
 	public void contextAdded(ContextEvent event) {
 		
+    	if (log.isDebugEnabled())
+			log.debug("Enter: DefaultContextManagerListener::contextAdded");
+    	
 		try {
 			
 			if (event.getContextType()==ContextType.SERVICE_GROUP_CONTEXT) {
@@ -69,6 +72,8 @@
 			e.printStackTrace();
 		}
 		
+    	if (log.isDebugEnabled())
+			log.debug("Exit: DefaultContextManagerListener::contextAdded");
 	}
 
 	public void contextRemoved(ContextEvent event) {
@@ -77,6 +82,9 @@
 
 	public void contextUpdated(ContextEvent event) {
 
+    	if (log.isDebugEnabled())
+			log.debug("Enter: DefaultContextManagerListener::contextUpdated");
+    	
 		if (event.getContextType()==ContextType.SERVICE_GROUP_CONTEXT) {
 			
 			ServiceGroupContext srvGrpCtx = configurationContext.getServiceGroupContext(
@@ -113,6 +121,9 @@
 			}
 
 		}
+		
+    	if (log.isDebugEnabled())
+			log.debug("Exit: DefaultContextManagerListener::contextUpdated");
 	}
 
 	public void setConfigurationContext(ConfigurationContext configurationContext) {

Modified: webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/cluster/tribes/TribesClusterManager.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/cluster/tribes/TribesClusterManager.java?view=diff&rev=538069&r1=538068&r2=538069
==============================================================================
--- webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/cluster/tribes/TribesClusterManager.java
(original)
+++ webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/cluster/tribes/TribesClusterManager.java
Mon May 14 23:34:25 2007
@@ -69,7 +69,10 @@
 	}
 
 	public void init() throws ClusteringFault {
-		log.debug("Initializing tribes");
+		
+    	if (log.isDebugEnabled())
+			log.debug("Enter: TribesClusterManager::init");
+    	
 		ChannelSender sender = new ChannelSender ();
 
         ChannelListener listener = new ChannelListener (configurationManager, contextManager);
@@ -102,9 +105,16 @@
 			listener.setContextManager(contextManager);
 
 		} catch (ChannelException e) {
+			
+	    	if (log.isDebugEnabled())
+				log.debug("Exit: TribesClusterManager::init");
+	    	
 			String message = "Error starting Tribes channel";
 			throw new ClusteringFault (message, e);
 		}
+		
+    	if (log.isDebugEnabled())
+			log.debug("Exit: TribesClusterManager::init");
 	}
 
 //	private void registerTribesInfoService(ConfigurationContext configContext2) throws ClusteringFault
{
@@ -162,13 +172,24 @@
 	}
 
 	public void shutdown() throws ClusteringFault {
+		
+    	if (log.isDebugEnabled())
+			log.debug("Enter: TribesClusterManager::shutdown");
+    	
 		if (channel!=null) {
 			try {
 				channel.stop(Channel.DEFAULT);
 			} catch (ChannelException e) {
+				
+		    	if (log.isDebugEnabled())
+					log.debug("Exit: TribesClusterManager::shutdown");
+		    	
 				throw new ClusteringFault (e);
 			}
 		}
+		
+    	if (log.isDebugEnabled())
+			log.debug("Exit: TribesClusterManager::shutdown");
 	}
 
 	

Modified: webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/cluster/tribes/configuration/TribesConfigurationManager.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/cluster/tribes/configuration/TribesConfigurationManager.java?view=diff&rev=538069&r1=538068&r2=538069
==============================================================================
--- webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/cluster/tribes/configuration/TribesConfigurationManager.java
(original)
+++ webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/cluster/tribes/configuration/TribesConfigurationManager.java
Mon May 14 23:34:25 2007
@@ -21,6 +21,7 @@
 import org.apache.axis2.cluster.configuration.ConfigurationEvent;
 import org.apache.axis2.cluster.configuration.ConfigurationManager;
 import org.apache.axis2.cluster.configuration.ConfigurationManagerListener;
+import org.apache.axis2.cluster.listeners.DefaultContextManagerListener;
 import org.apache.axis2.cluster.tribes.ChannelSender;
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.description.Parameter;
@@ -28,6 +29,8 @@
 import org.apache.catalina.tribes.Channel;
 import org.apache.catalina.tribes.ChannelException;
 import org.apache.catalina.tribes.Member;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.axiom.om.OMElement;
 
 import java.util.*;
@@ -38,7 +41,8 @@
     private ChannelSender sender = null;
     private ConfigurationContext configurationContext = null;
     private Map parameters = new HashMap();
-
+	private static final Log log = LogFactory.getLog(TribesConfigurationManager.class);
+	
     public TribesConfigurationManager() {
         listeners = new ArrayList();
     }
@@ -52,46 +56,102 @@
     }
 
     public void applyPolicy(String serviceGroupName, String policy) throws ClusteringFault
{
+    	
+    	if (log.isDebugEnabled())
+			log.debug("Enter: TribesConfigurationManager::applyPolicy");
+    	
         ConfigurationCommand command = new ConfigurationCommand(CommandType.APPLY_POLICY);
         command.setServiceName(serviceGroupName);
         command.setPolicy(policy);
         send(command);
+        
+    	if (log.isDebugEnabled())
+			log.debug("Exit: TribesConfigurationManager::applyPolicy");
     }
 
     public void commit() throws ClusteringFault {
+    	
+    	if (log.isDebugEnabled())
+			log.debug("Enter: TribesConfigurationManager::commit");
+    	
         ConfigurationCommand command = new ConfigurationCommand(CommandType.COMMIT);
         send(command);
+        
+    	if (log.isDebugEnabled())
+			log.debug("Exit: TribesConfigurationManager::commit");
     }
 
     public void exceptionOccurred(Throwable throwable) throws ClusteringFault {
+    	
+    	if (log.isDebugEnabled())
+			log.debug("Enter: TribesConfigurationManager::exceptionOccurred");
+    	
         send(throwable);
+        
+    	if (log.isDebugEnabled())
+			log.debug("Exit: TribesConfigurationManager::exceptionOccurred");
     }
 
     public void loadServiceGroups(String[] serviceGroupNames) throws ClusteringFault {
+    	
+    	if (log.isDebugEnabled())
+			log.debug("Enter: TribesConfigurationManager::loadServiceGroups");
+    	
         ConfigurationCommand command = new ConfigurationCommand(CommandType.LOAD_SERVICE_GROUPS);
         command.setServiceGroupNames(serviceGroupNames);
         send(command);
+        
+    	if (log.isDebugEnabled())
+			log.debug("Exit: TribesConfigurationManager::loadServiceGroups");
     }
 
     public void prepare() throws ClusteringFault {
+    	
+    	if (log.isDebugEnabled())
+			log.debug("Enter: TribesConfigurationManager::prepare");
+    	
         ConfigurationCommand command = new ConfigurationCommand(CommandType.PREPARE);
         send(command);
+        
+    	if (log.isDebugEnabled())
+			log.debug("Exit: TribesConfigurationManager::prepare");
     }
 
     public void reloadConfiguration() throws ClusteringFault {
+    	
+    	if (log.isDebugEnabled())
+			log.debug("Enter: TribesConfigurationManager::reloadConfiguration");
+    	
         ConfigurationCommand command = new ConfigurationCommand(CommandType.RELOAD_CONFIGURATION);
         send(command);
+        
+    	if (log.isDebugEnabled())
+			log.debug("Exit: TribesConfigurationManager::reloadConfiguration");
     }
 
     public void rollback() throws ClusteringFault {
+    	
+    	if (log.isDebugEnabled())
+			log.debug("Enter: TribesConfigurationManager::rollback");
+    	
         ConfigurationCommand command = new ConfigurationCommand(CommandType.ROLLBACK);
         send(command);
+        
+    	if (log.isDebugEnabled())
+			log.debug("Exit: TribesConfigurationManager::rollback");
     }
 
     public void unloadServiceGroups(String[] serviceGroupNames) throws ClusteringFault {
+    	
+    	if (log.isDebugEnabled())
+			log.debug("Enter: TribesConfigurationManager::unloadServiceGroups");
+    	
         ConfigurationCommand command = new ConfigurationCommand(CommandType.UNLOAD_SERVICE_GROUPS);
         command.setServiceGroupNames(serviceGroupNames);
         send(command);
+        
+    	if (log.isDebugEnabled())
+			log.debug("Exit: TribesConfigurationManager::unloadServiceGroups");
     }
 
     private void send(Throwable throwable) throws ClusteringFault {
@@ -118,6 +178,9 @@
 
     public void notifyListeners(int command, ConfigurationEvent event) {
 
+    	if (log.isDebugEnabled())
+			log.debug("Enter: TribesConfigurationManager::notifyListeners");
+    	
         for (Iterator it = listeners.iterator(); it.hasNext();) {
             ConfigurationManagerListener listener = (ConfigurationManagerListener) it.next();
 
@@ -137,6 +200,9 @@
                 listener.rollbackCalled(event);
             }
         }
+        
+    	if (log.isDebugEnabled())
+			log.debug("Exit: TribesConfigurationManager::notifyListeners");
     }
 
     public void setConfigurationContext(ConfigurationContext configurationContext) {

Modified: webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/cluster/tribes/context/TribesContextManager.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/cluster/tribes/context/TribesContextManager.java?view=diff&rev=538069&r1=538068&r2=538069
==============================================================================
--- webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/cluster/tribes/context/TribesContextManager.java
(original)
+++ webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/cluster/tribes/context/TribesContextManager.java
Mon May 14 23:34:25 2007
@@ -85,6 +85,10 @@
     }
 
     public void addContext(AbstractContext context) throws ClusteringFault {
+    	
+    	if (log.isDebugEnabled())
+			log.debug("Enter: TribesContextManager::addContext");
+    	
         ContextCommandMessage comMsg;
 
         String contextId = getContextID(context);
@@ -95,6 +99,10 @@
         if (context instanceof ServiceContext) {
 
             if (addedServiceCtxs.contains(parentContextId + contextId)) {
+            	
+            	if (log.isDebugEnabled())
+        			log.debug("Exit: TribesContextManager::addContext");
+            	
                 return; // this is a duplicate replication request
             }
 
@@ -128,6 +136,10 @@
         } else if (context instanceof ServiceGroupContext) {
 
             if (addedServiceGrpCtxs.contains(contextId)) {
+            	
+            	if (log.isDebugEnabled())
+        			log.debug("Exit: TribesContextManager::addContext");
+            	
                 return; // this is a duplicate replication request
             }
 
@@ -135,6 +147,10 @@
 
             // The new serialization code sets the service group name as it's id initially
             if (srvGrpCtx.getId().equals(srvGrpCtx.getDescription().getServiceGroupName()))
{
+            	
+            	if (log.isDebugEnabled())
+        			log.debug("Exit: TribesContextManager::addContext");
+            	
                 return;
             }
 
@@ -166,9 +182,16 @@
                 orphanedServiceCtxs.remove(srvGrpCtx.getDescription().getServiceGroupName());
             }
         }
+        
+    	if (log.isDebugEnabled())
+			log.debug("Exit: TribesContextManager::addContext");
     }
 
     public void removeContext(AbstractContext context) throws ClusteringFault {
+    	
+    	if (log.isDebugEnabled())
+			log.debug("Enter: TribesContextManager::removeContext");
+    	
         ContextCommandMessage comMsg = null;
 
         String contextId = getContextID(context);
@@ -186,10 +209,16 @@
         }
 
         send(comMsg);
+        
+    	if (log.isDebugEnabled())
+			log.debug("Exit: TribesContextManager::removeContext");
     }
 
     public void updateState(AbstractContext context) throws ClusteringFault {
 
+    	if (log.isDebugEnabled())
+			log.debug("Enter: TribesContextManager::updateState");
+    	
         String contextId = getContextID(context);
         String parentContextId = getContextID(context.getParent());
 
@@ -221,6 +250,9 @@
                                                                  contextType);
 
         send(comMsg);
+        
+    	if (log.isDebugEnabled())
+			log.debug("Exit: TribesContextManager::updateState");
     }
 
     public boolean isContextClusterable(AbstractContext context) {



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message