[jboss-cvs] JBossAS SVN: r63247 - branches/JBoss_4_0_4_GA_CP/cluster/src/main/org/jboss/ha/framework/server.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue May 29 22:51:40 EDT 2007


Author: jiwils
Date: 2007-05-29 22:51:39 -0400 (Tue, 29 May 2007)
New Revision: 63247

Modified:
   branches/JBoss_4_0_4_GA_CP/cluster/src/main/org/jboss/ha/framework/server/FarmMemberService.java
Log:
Fix for [ASPATCH-221].  FarmMemberService.logException now *only* logs the exception via a logger; it does not also use Throwable.printStackTrace() as it did before now.

Modified: branches/JBoss_4_0_4_GA_CP/cluster/src/main/org/jboss/ha/framework/server/FarmMemberService.java
===================================================================
--- branches/JBoss_4_0_4_GA_CP/cluster/src/main/org/jboss/ha/framework/server/FarmMemberService.java	2007-05-30 00:46:01 UTC (rev 63246)
+++ branches/JBoss_4_0_4_GA_CP/cluster/src/main/org/jboss/ha/framework/server/FarmMemberService.java	2007-05-30 02:51:39 UTC (rev 63247)
@@ -54,14 +54,14 @@
 {
    private MBeanServer mServer;
    protected ObjectName mClusterPartitionName = null;
-   protected ClusterPartitionMBean mClusterPartition = null; 
+   protected ClusterPartitionMBean mClusterPartition = null;
    protected String mBackgroundPartition = ServerConfigUtil.getDefaultPartitionName();
    private File mTempDirectory;
    private ClusterFileTransfer mFileTransfer;
 
    protected final static String SERVICE_NAME = "FarmMemberService";
    protected HashMap parentDUMap = new HashMap();
-   
+
    protected ArrayList remotelyDeployed = new ArrayList ();
    protected ArrayList remotelyUndeployed = new ArrayList ();
 
@@ -69,7 +69,7 @@
    {
       return mBackgroundPartition;
    }
-   
+
    public void setPartitionName( String pPartitionName )
    {
       if( ( getState () != STARTED ) && ( getState () != STARTING ) )
@@ -85,8 +85,8 @@
 
    public void setClusterPartition(ClusterPartitionMBean clusterPartition)
    {
-      if( ( getState () != STARTED ) && ( getState () != STARTING ) )   
-      {         
+      if( ( getState () != STARTED ) && ( getState () != STARTING ) )
+      {
          this.mClusterPartition = clusterPartition;
       }
    }
@@ -114,7 +114,7 @@
    {
       return "Farm Member Service";
    }
-   
+
    /**
     * Saves the MBeanServer reference, create the Farm Member Name and
     * add its Notification Listener to listen for Deployment / Undeployment
@@ -135,7 +135,7 @@
       super.createService();
       ServerConfig lConfig = ServerConfigLocator.locate();
       mTempDirectory = lConfig.getServerTempDir();
-      
+
       createUnexistingLocalDir ();
    }
    /**
@@ -148,16 +148,16 @@
       try
       {
          log.debug( "registerRPCHandler" );
-         
+
          HAPartition lHAPartition = null;
          if (mClusterPartition != null)
          {
             lHAPartition = mClusterPartition.getHAPartition();
             mBackgroundPartition = lHAPartition.getPartitionName();
          }
-         
+
          mClusterPartitionName = new ObjectName( "jboss:service=" + mBackgroundPartition );
-         
+
          if (lHAPartition == null)
          {
             // Old style config with PartitionName was used -- have to
@@ -167,7 +167,7 @@
                "HAPartition"
             );
          }
-         
+
          lHAPartition.registerRPCHandler( SERVICE_NAME, this );
 
          mFileTransfer = new ClusterFileTransfer(lHAPartition, buildParentFolderMapping());
@@ -202,8 +202,8 @@
          throw e;
       }
    }
-   
 
+
    protected void pullNewDeployments(HAPartition partition, HashMap farmed)
    {
       log.info("**** pullNewDeployments ****");
@@ -290,18 +290,18 @@
       }
       return farmed;
    }
-   
+
    public void farmDeploy( String parentName, File destFile, Date date )
    {
-      try 
+      try
       {
          File parent = findParent(parentName);
-         if (parent == null) 
+         if (parent == null)
          {
             log.info("Could not find parent: " + parentName + " for deployment: " + destFile + ", data: " + date);
             return;
          }
-         
+
          String fullName = parentName + "/" + destFile.getName();
 
          DeployedURL du = null;
@@ -310,7 +310,7 @@
             du = (DeployedURL)parentDUMap.get(fullName);
          }
          boolean deployIt = false;
-         if (du == null) 
+         if (du == null)
          {
             deployIt = true;
          }
@@ -355,21 +355,21 @@
          logException( e );
       }
    }
-   
+
    public void farmUndeploy(String parentName, String fileName)
    {
       try {
          // First check if file is already deployed
          log.info( "doUndeployment(), File: " + parentName + "/" + fileName);
          File parent = findParent(parentName);
-         if (parent == null) 
+         if (parent == null)
          {
             log.info("Could not find parent: " + parentName + " for undeployment: " + fileName);
             return;
          }
          File deployed = new File(parent, fileName);
          if (deployed.exists())
-         {            
+         {
             // we remember this undeployment to avoid recursive farm calls!
             //
             synchronized (remotelyUndeployed)
@@ -388,14 +388,14 @@
          logException( e );
       }
    }
-   
+
    protected void deploy(final DeployedURL du)
    {
       super.deploy(du);
       File file = du.getFile();
       File parent = file.getParentFile();
       if (parent == null) return;
-      
+
       String fullName = parent.getName() + "/" + file.getName();
       synchronized (parentDUMap)
       {
@@ -404,7 +404,7 @@
 
       try
       {
-         // We check if we must do a remote call or not: maybe the deploy 
+         // We check if we must do a remote call or not: maybe the deploy
          // is already the consequence of a farm call! (avoid recusivity!)
          //
          boolean consequenceOfRemoteCall = false;
@@ -412,7 +412,7 @@
          {
             consequenceOfRemoteCall = remotelyDeployed.remove (fullName);
          }
-         
+
          if (getState() == STARTING) return;
 
          if (!consequenceOfRemoteCall)
@@ -446,24 +446,24 @@
 
    protected void undeploy(final DeployedURL du)
    {
-      
+
       File file = du.getFile();
       File parent = file.getParentFile();
       String parentName = parent.getName();
       String fileName = file.getName();
       super.undeploy(du);
-      
+
       String fullName = parent.getName() + "/" + file.getName();
       synchronized (parentDUMap)
       {
          parentDUMap.remove(fullName);
       }
-      
+
       if (getState() == STOPPING) return;
 
       try
       {
-         // We check if we must do a remote call or not: maybe the undeploy 
+         // We check if we must do a remote call or not: maybe the undeploy
          // is already the consequence of a farm call! (avoid recusivity!)
          //
          boolean consequenceOfRemoteCall = false;
@@ -471,7 +471,7 @@
          {
             consequenceOfRemoteCall = remotelyUndeployed.remove (fullName);
          }
-         
+
          if (!consequenceOfRemoteCall)
          {
             HAPartition lHAPartition = (HAPartition) mServer.getAttribute(
@@ -521,10 +521,10 @@
       {
          e = ((javax.management.ReflectionException)e).getTargetException();
       }
-      e.printStackTrace();
+      //e.printStackTrace();
       log.error(e);
    }
-   
+
    protected void createUnexistingLocalDir()
    {
       if (this.urlList != null)




More information about the jboss-cvs-commits mailing list