geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r1135627 - in /geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core: DeploymentUtils.java GeronimoServerDelegate.java GeronimoUtils.java GeronimoVersionHandler.java
Date Tue, 14 Jun 2011 14:59:07 GMT
Author: gawor
Date: Tue Jun 14 14:59:07 2011
New Revision: 1135627

URL: http://svn.apache.org/viewvc?rev=1135627&view=rev
Log:
cleanup logging a bit so that things are not needlessly computed or allocated again

Modified:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/DeploymentUtils.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerDelegate.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoUtils.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoVersionHandler.java

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/DeploymentUtils.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/DeploymentUtils.java?rev=1135627&r1=1135626&r2=1135627&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/DeploymentUtils.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/DeploymentUtils.java
Tue Jun 14 14:59:07 2011
@@ -251,9 +251,9 @@ public class DeploymentUtils {
         }
         
         IGeronimoServer gs = (IGeronimoServer) server.getAdapter(IGeronimoServer.class);
-    
-        Trace.tracePoint("Exit ", Activator.traceCore, "DeploymentUtils.generateExplodedConfiguration",gs.getVersionHandler().createTargetModuleId(configId));
-        return gs.getVersionHandler().createTargetModuleId(configId);
+        TargetModuleID moduleId = gs.getVersionHandler().createTargetModuleId(configId);
+        Trace.tracePoint("Exit ", Activator.traceCore, "DeploymentUtils.generateExplodedConfiguration",
moduleId);
+        return moduleId;
     }
 
 
@@ -383,15 +383,10 @@ public class DeploymentUtils {
         DeploymentManager dm;
         try {
             dm = DeploymentCommandFactory.getDeploymentManager(server);
-            TargetModuleID id=isInstalledModule(dm,configId);
-            if (id==null) {
-                Trace.tracePoint("Exit ", Activator.traceCore, "DeploymentUtils.isInstalledModule",
false);
-                return false;
-            } 
-            else {
-                Trace.tracePoint("Exit ", Activator.traceCore, "DeploymentUtils.isInstalledModule",
true);
-                return true;
-            }
+            TargetModuleID id = isInstalledModule(dm, configId);
+            boolean isInstalled = (id != null);
+            Trace.tracePoint("Exit ", Activator.traceCore, "DeploymentUtils.isInstalledModule",
isInstalled);
+            return isInstalled;
         } catch (CoreException e) {
             e.printStackTrace();
             return false;

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerDelegate.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerDelegate.java?rev=1135627&r1=1135626&r2=1135627&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerDelegate.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoServerDelegate.java
Tue Jun 14 14:59:07 2011
@@ -182,17 +182,18 @@ abstract public class GeronimoServerDele
     public IModule[] getRootModules(IModule module) throws CoreException {
         Trace.tracePoint("Entry", Activator.traceCore, "GeronimoServerDelegate.getRootModules",
module);
 
-        IStatus status = canModifyModules(new IModule[] { module }, null);
-        if (status != null && !status.isOK())
+        IModule[] rootModule = new IModule[] { module };
+        IStatus status = canModifyModules(rootModule, null);
+        if (status != null && !status.isOK()) {
             throw new CoreException(status);
+        }
         IModule[] modules = doGetParentModules(module);
-        if (modules.length > 0) {
-            Trace.tracePoint("Exit ", Activator.traceCore, "GeronimoServerDelegate.getRootModules",
modules);
-            return modules;
+        if (modules.length == 0) {
+            modules = rootModule;
         }
-
-        Trace.tracePoint("Exit ", Activator.traceCore, "GeronimoServerDelegate.getRootModules",
new IModule[] { module });
-        return new IModule[] { module };
+            
+        Trace.tracePoint("Exit ", Activator.traceCore, "GeronimoServerDelegate.getRootModules",
modules);
+        return modules;
     }
 
 
@@ -257,7 +258,7 @@ abstract public class GeronimoServerDele
                 }
             }
         }
-
+       
         Trace.tracePoint("Exit ", Activator.traceCore, "GeronimoServerDelegate.getChildModules",
new IModule[] {});
         return new IModule[] {};
     }
@@ -275,8 +276,9 @@ abstract public class GeronimoServerDele
         ports.add(new ServerPort(PROPERTY_HTTP_PORT, "Web Connector", Integer.parseInt(getHTTPPort()),
"http"));
         ports.add(new ServerPort(PROPERTY_RMI_PORT, "RMI Naming", Integer.parseInt(getRMINamingPort()),
"rmi"));
 
-        Trace.tracePoint("Entry", Activator.traceCore, "GeronimoServerDelegate.getServerPorts;",
(ServerPort[]) ports.toArray(new ServerPort[ports.size()]));
-        return (ServerPort[]) ports.toArray(new ServerPort[ports.size()]);
+        ServerPort[] serverPorts = ports.toArray(new ServerPort[ports.size()]);
+        Trace.tracePoint("Entry", Activator.traceCore, "GeronimoServerDelegate.getServerPorts;",
serverPorts);
+        return serverPorts;
     }
 
     public String getContextPath(IModule module) {
@@ -306,8 +308,7 @@ abstract public class GeronimoServerDele
             }
         }
         
-        Trace.tracePoint("Exit", Activator.traceCore, "GeronimoServerDelegate.getContextPath",
contextRoot);
-        
+        Trace.tracePoint("Exit", Activator.traceCore, "GeronimoServerDelegate.getContextPath",
contextRoot);        
         return contextRoot;
     }
     
@@ -346,8 +347,9 @@ abstract public class GeronimoServerDele
                     urlSB.append("/");
                 }
                 String url = urlSB.toString();
-                Trace.tracePoint("Exit ", Activator.traceCore, "GeronimoServerDelegate.getModuleRootURL",
new URL(url));
-                return new URL(url);
+                URL moduleURL = new URL(url);
+                Trace.tracePoint("Exit ", Activator.traceCore, "GeronimoServerDelegate.getModuleRootURL",
moduleURL);
+                return moduleURL;
             } catch (Exception e) {
                 Trace.trace(Trace.ERROR, "Could not get root URL", e, Activator.logCore);
                 return null;
@@ -915,10 +917,7 @@ abstract public class GeronimoServerDele
             setServerInstanceProperties(map);
         } catch (Exception e) {
             // TODO WTF? Need to figure out why this fails...  seems to fail before setDefaults
is called.
-            Trace.trace(Trace.INFO, "GeronimoServerDelegate.setInstanceProperty(name = "
+ name + ", value = " + value
-                    + " )", e, Activator.traceCore);
-            int a = 1;
-            a++;
+            Trace.trace(Trace.INFO, "GeronimoServerDelegate.setInstanceProperty(name = "
+ name + ", value = " + value + " )", e, Activator.traceCore);
         }
     }
 

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoUtils.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoUtils.java?rev=1135627&r1=1135626&r2=1135627&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoUtils.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoUtils.java
Tue Jun 14 14:59:07 2011
@@ -192,10 +192,10 @@ public class GeronimoUtils {
             }
         }
 
-        if (environment != null
-            && environment.getModuleId() != null) {
-            Trace.tracePoint("EXIT", Activator.traceCore, "GeronimoUtils.getConfigId", getQualifiedConfigID(environment.getModuleId()));
-            return getQualifiedConfigID(environment.getModuleId());
+        if (environment != null && environment.getModuleId() != null) {
+            String id = getQualifiedConfigID(environment.getModuleId());
+            Trace.tracePoint("EXIT", Activator.traceCore, "GeronimoUtils.getConfigId", id);
+            return id;
         }
         
         if (AriesHelper.isAriesInstalled()) {
@@ -215,15 +215,18 @@ public class GeronimoUtils {
                     String newVersionStr = getVersion(version);                    
                     
                     if (artifactID != null && version != null) {
-                        return getQualifiedConfigID(OsgiConstants.ARTIFACT_GROUP, artifactID,
newVersionStr, OsgiConstants.ARTIFACT_TYPE);
+                        String id = getQualifiedConfigID(OsgiConstants.ARTIFACT_GROUP, artifactID,
newVersionStr, OsgiConstants.ARTIFACT_TYPE);
+                        Trace.tracePoint("EXIT", Activator.traceCore, "GeronimoUtils.getConfigId",
id);
+                        return id;
                     }                 
                 }
             } catch (Exception e) {
             } 
         }
 
-        Trace.tracePoint("EXIT", Activator.traceCore, "GeronimoUtils.getConfigId", getId(module));
-        return getId(module);
+        String id = getId(module);
+        Trace.tracePoint("EXIT", Activator.traceCore, "GeronimoUtils.getConfigId", id);
+        return id;
     }
     
     // copied from org.apache.geronimo.aries.builder.ApplicationInstaller.getVersion(Version)

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoVersionHandler.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoVersionHandler.java?rev=1135627&r1=1135626&r2=1135627&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoVersionHandler.java
(original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoVersionHandler.java
Tue Jun 14 14:59:07 2011
@@ -35,9 +35,9 @@ public class GeronimoVersionHandler impl
      */
     public String getConfigID(IModule module) throws Exception {
         Trace.tracePoint("Entry", Activator.traceCore, "GeronimoVersionHandler.getConfigID",
module);
-
-        Trace.tracePoint("Exit ", Activator.traceCore, "GeronimoVersionHandler.getConfigID",
GeronimoUtils.getConfigId(module));
-        return GeronimoUtils.getConfigId(module);
+        String configId = GeronimoUtils.getConfigId(module);
+        Trace.tracePoint("Exit ", Activator.traceCore, "GeronimoVersionHandler.getConfigID",
configId);
+        return configId;
     }
     
     /* (non-Javadoc)
@@ -45,8 +45,8 @@ public class GeronimoVersionHandler impl
      */
     public TargetModuleID createTargetModuleId(String configId) {
         Trace.tracePoint("Entry", Activator.traceCore, "GeronimoVersionHandler.createTargetModuleId",
configId);
-    
-        Trace.tracePoint("Exit ", Activator.traceCore, "GeronimoVersionHandler.createTargetModuleId",
new TargetModuleIDImpl(null, configId));
-        return new TargetModuleIDImpl(null, configId);
+        TargetModuleID moduleId = new TargetModuleIDImpl(null, configId);
+        Trace.tracePoint("Exit ", Activator.traceCore, "GeronimoVersionHandler.createTargetModuleId",
moduleId);
+        return moduleId;
     }
 }



Mime
View raw message