[jbossws-commits] JBossWS SVN: r10069 - common/branches/jbossws-common-1.1.0/src/main/java/org/jboss/wsf/common/management.

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Fri May 22 06:22:14 EDT 2009


Author: alessio.soldano at jboss.com
Date: 2009-05-22 06:22:14 -0400 (Fri, 22 May 2009)
New Revision: 10069

Modified:
   common/branches/jbossws-common-1.1.0/src/main/java/org/jboss/wsf/common/management/AbstractServerConfig.java
Log:
[JBWS-2652] Removing ALR fix from 1.1.0 branch: svn merge -r 10067:10066 .


Modified: common/branches/jbossws-common-1.1.0/src/main/java/org/jboss/wsf/common/management/AbstractServerConfig.java
===================================================================
--- common/branches/jbossws-common-1.1.0/src/main/java/org/jboss/wsf/common/management/AbstractServerConfig.java	2009-05-22 10:08:09 UTC (rev 10068)
+++ common/branches/jbossws-common-1.1.0/src/main/java/org/jboss/wsf/common/management/AbstractServerConfig.java	2009-05-22 10:22:14 UTC (rev 10069)
@@ -23,8 +23,6 @@
 
 import java.io.File;
 import java.net.InetAddress;
-import java.net.URISyntaxException;
-import java.net.URL;
 import java.net.UnknownHostException;
 import java.util.Set;
 
@@ -47,12 +45,6 @@
 public abstract class AbstractServerConfig implements AbstractServerConfigMBean, ServerConfig
 {
    private static final Logger log = Logger.getLogger(AbstractServerConfig.class);
-   
-   protected static final ObjectName OBJECT_NAME_SERVER_CONFIG;
-   static
-   {
-      OBJECT_NAME_SERVER_CONFIG = ObjectNameFactory.create("jboss.system:type=ServerConfig");
-   }
 
    // The MBeanServer
    private MBeanServer mbeanServer;
@@ -118,56 +110,44 @@
 
    public File getServerTempDir()
    {
-      return this.getDirFromServerConfig("ServerTempLocation");
+      try
+      {
+         ObjectName oname = ObjectNameFactory.create("jboss.system:type=ServerConfig");
+         File dir = (File)getMbeanServer().getAttribute(oname, "ServerTempDir");
+         return dir;
+      }
+      catch (JMException e)
+      {
+         return null;
+      }
    }
    
    public File getHomeDir()
    {
-      return this.getDirFromServerConfig("JBossHome");
-   }
-
-   public File getServerDataDir()
-   {
-      return this.getDirFromServerConfig("ServerDataLocation");
-   }
-   
-   /**
-    * Obtains the specified attribute from the server configuration,
-    * represented as a {@link File}.
-    *  
-    * @param attributeName
-    * @return
-    * @author ALR
-    */
-   protected File getDirFromServerConfig(final String attributeName)
-   {
-      // Define the ON to invoke upon
-      final ObjectName on = OBJECT_NAME_SERVER_CONFIG;
-
-      // Get the URL location
-      URL location = null;
       try
       {
-         location = (URL) getMbeanServer().getAttribute(on, attributeName);
+         ObjectName oname = ObjectNameFactory.create("jboss.system:type=ServerConfig");
+         File dir = (File)getMbeanServer().getAttribute(oname, "HomeDir");
+         return dir;
       }
-      catch (final JMException e)
+      catch (JMException e)
       {
-         throw new RuntimeException("Could not obtain attribute " + attributeName + " from " + on, e);
+         return null;
       }
+   }
 
-      // Represent as a File
-      File dir = null;
+   public File getServerDataDir()
+   {
       try
       {
-         dir = new File(location.toURI());
+         ObjectName oname = ObjectNameFactory.create("jboss.system:type=ServerConfig");
+         File dir = (File)getMbeanServer().getAttribute(oname, "ServerDataDir");
+         return dir;
       }
-      catch (final URISyntaxException urise)
+      catch (JMException e)
       {
-         throw new RuntimeException("Could not desired directory from URL: " + location, urise);
+         return null;
       }
-
-      // Return
-      return dir;
    }
 
    public int getWebServicePort()




More information about the jbossws-commits mailing list