geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hanhongf...@apache.org
Subject svn commit: r1127422 [3/7] - in /geronimo/devtools/eclipse-plugin/trunk/plugins: org.apache.geronimo.j2ee.v11.jaxbmodel/ org.apache.geronimo.j2ee.v11.jaxbmodel/src/main/java/org/apache/geronimo/j2ee/jaxbmodel/ org.apache.geronimo.j2ee.v11.jaxbmodel/src...
Date Wed, 25 May 2011 08:16:31 GMT
Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.core/src/main/java/org/apache/geronimo/st/v11/core/GeronimoV11Utils.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.core/src/main/java/org/apache/geronimo/st/v11/core/GeronimoV11Utils.java?rev=1127422&r1=1127421&r2=1127422&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.core/src/main/java/org/apache/geronimo/st/v11/core/GeronimoV11Utils.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.core/src/main/java/org/apache/geronimo/st/v11/core/GeronimoV11Utils.java Wed May 25 08:16:27 2011
@@ -30,14 +30,14 @@ import org.apache.geronimo.st.core.inter
 import org.eclipse.core.resources.IFile;
 import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
 import org.eclipse.wst.server.core.IModule;
-
+import org.apache.geronimo.st.core.Activator;
 /**
  * @version $Rev: 471551 $ $Date: 2006-11-05 17:47:11 -0500 (Sun, 05 Nov 2006) $
  */
 public class GeronimoV11Utils extends GeronimoUtils {
 
 	public static JAXBElement getDeploymentPlan(IFile file) throws Exception {
-		Trace.tracePoint("ENTRY", "GeronimoV11Utils.getDeploymentPlan", file);
+		Trace.tracePoint("ENTRY", Activator.traceCore, "GeronimoV11Utils.getDeploymentPlan", file);
 
 		if (!file.exists()) {
 			return null;
@@ -54,7 +54,7 @@ public class GeronimoV11Utils extends Ge
 		else if (file.getName().equals(GeronimoUtils.APP_CLIENT_PLAN_NAME))
 			return getApplicationClientDeploymentPlan(file);
 
-		Trace.tracePoint("EXIT", "GeronimoV11Utils.getDeploymentPlan", null);
+		Trace.tracePoint("EXIT", Activator.traceCore, "GeronimoV11Utils.getDeploymentPlan", null);
 		return null;
 	}
 
@@ -123,7 +123,7 @@ public class GeronimoV11Utils extends Ge
 		}
 		if (environment != null
 	            && environment.getModuleId() != null) {
-	            Trace.tracePoint("EXIT", "GeronimoV11Utils.getConfigId", getQualifiedConfigID(environment.getModuleId()));
+	            Trace.tracePoint("EXIT", Activator.traceCore, "GeronimoV11Utils.getConfigId", getQualifiedConfigID(environment.getModuleId()));
 	            return getQualifiedConfigID(environment.getModuleId());
 	        }
 
@@ -186,14 +186,14 @@ public class GeronimoV11Utils extends Ge
 
 	public static JAXBElement getApplicationClientDeploymentPlan(IFile file)
 			throws Exception {
-		Trace.tracePoint("ENTRY",
+		Trace.tracePoint("ENTRY", Activator.traceCore,
 				"GeronimoV11Utils.getApplicationClientDeploymentPlan", file);
 
 		if (file.getName().equals(APP_CLIENT_PLAN_NAME) && file.exists()) {
 			return JAXBUtils.unmarshalFilterDeploymentPlan(file);
 		}
 
-		Trace.tracePoint("EXIT",
+		Trace.tracePoint("EXIT", Activator.traceCore,
 				"GeronimoV11Utils.getApplicationClientDeploymentPlan", null);
 		return null;
 	}
@@ -214,55 +214,55 @@ public class GeronimoV11Utils extends Ge
 	}
 
 	public static JAXBElement getApplicationDeploymentPlan(IFile file) throws Exception {
-		Trace.tracePoint("ENTRY",
+		Trace.tracePoint("ENTRY", Activator.traceCore,
 				"GeronimoV11Utils.getApplicationClientDeploymentPlan", file);
 
 		if (file.getName().equals(APP_PLAN_NAME) && file.exists()) {
 			return JAXBUtils.unmarshalFilterDeploymentPlan(file);
 		}
 
-		Trace.tracePoint("EXIT",
+		Trace.tracePoint("EXIT", Activator.traceCore,
 				"GeronimoV11Utils.getApplicationClientDeploymentPlan", null);
 		return null;
 	}
 
 	public static JAXBElement getWebDeploymentPlan(IFile file) throws Exception {
 		Trace
-				.tracePoint("ENTRY", "GeronimoV11Utils.getWebDeploymentPlan",
+				.tracePoint("ENTRY", Activator.traceCore, "GeronimoV11Utils.getWebDeploymentPlan",
 						file);
 
 		if (file.getName().equals(WEB_PLAN_NAME) && file.exists()) {
 			return JAXBUtils.unmarshalFilterDeploymentPlan(file);
 		}
 
-		Trace.tracePoint("EXIT", "GeronimoV11Utils.getWebDeploymentPlan", null);
+		Trace.tracePoint("EXIT", Activator.traceCore, "GeronimoV11Utils.getWebDeploymentPlan", null);
 		return null;
 	}
 
 	public static JAXBElement getOpenEjbDeploymentPlan(IFile file)
 			throws Exception {
-		Trace.tracePoint("ENTRY", "GeronimoV11Utils.getOpenEjbDeploymentPlan",
+		Trace.tracePoint("ENTRY", Activator.traceCore, "GeronimoV11Utils.getOpenEjbDeploymentPlan",
 				file);
 
 		if (file.getName().equals(OPENEJB_PLAN_NAME) && file.exists()) {
 			return JAXBUtils.unmarshalFilterDeploymentPlan(file);
 		}
 
-		Trace.tracePoint("EXIT", "GeronimoV11Utils.getOpenEjbDeploymentPlan",
+		Trace.tracePoint("EXIT", Activator.traceCore, "GeronimoV11Utils.getOpenEjbDeploymentPlan",
 				null);
 		return null;
 	}
 
 	public static JAXBElement getConnectorDeploymentPlan(IFile file)
 			throws Exception {
-		Trace.tracePoint("ENTRY",
+		Trace.tracePoint("ENTRY", Activator.traceCore,
 				"GeronimoV11Utils.getConnectorDeploymentPlan", file);
 
 		if (file.getName().equals(CONNECTOR_PLAN_NAME) && file.exists()) {
 			return JAXBUtils.unmarshalFilterDeploymentPlan(file);
 		}
 
-		Trace.tracePoint("EXIT", "GeronimoV11Utils.getConnectorDeploymentPlan",
+		Trace.tracePoint("EXIT", Activator.traceCore, "GeronimoV11Utils.getConnectorDeploymentPlan",
 				null);
 		return null;
 	}

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/.options
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/.options?rev=1127422&r1=1127421&r2=1127422&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/.options (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/.options Wed May 25 08:16:27 2011
@@ -1 +1,12 @@
-org.apache.geronimo.st.v11.ui/debug=true
\ No newline at end of file
+org.apache.geronimo.st.v11.ui/debug=true
+org.apache.geronimo.st.v11.ui/console=true
+
+org.apache.geronimo.st.v11.ui/log/wizards=true
+org.apache.geronimo.st.v11.ui/log/editors=true
+org.apache.geronimo.st.v11.ui/log/pages=true
+org.apache.geronimo.st.v11.ui/log/sections=true
+
+org.apache.geronimo.st.v11.ui/trace/wizards=false
+org.apache.geronimo.st.v11.ui/trace/editors=false
+org.apache.geronimo.st.v11.ui/trace/pages=false
+org.apache.geronimo.st.v11.ui/trace/sections=false
\ No newline at end of file

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/Activator.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/Activator.java?rev=1127422&r1=1127421&r2=1127422&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/Activator.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/Activator.java Wed May 25 08:16:27 2011
@@ -16,6 +16,8 @@
  */
 package org.apache.geronimo.st.v11.ui;
 
+import org.apache.geronimo.st.v11.ui.internal.Trace;
+import org.eclipse.core.runtime.Platform;
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.ui.plugin.AbstractUIPlugin;
 import org.osgi.framework.BundleContext;
@@ -27,10 +29,39 @@ public class Activator extends AbstractU
 
 	// The plug-in ID
 	public static final String PLUGIN_ID = "org.apache.geronimo.st.v11.ui";
-
+	public static boolean console;
+	public static boolean logWizards;
+	public static boolean logEditors;
+	public static boolean logPages;
+	public static boolean logSections;
+	
+	public static boolean traceWizards;
+	public static boolean traceEditors;
+	public static boolean tracePages;
+	public static boolean traceSections;
+	
+	static {
+		try {
+			console = Boolean.parseBoolean(Platform.getDebugOption("org.apache.geronimo.st.v11.ui/console"));
+			
+			logWizards = Boolean.parseBoolean(Platform.getDebugOption("org.apache.geronimo.st.v11.ui/log/wizards"));
+			logEditors = Boolean.parseBoolean(Platform.getDebugOption("org.apache.geronimo.st.v11.ui/log/editors"));
+			logPages = Boolean.parseBoolean(Platform.getDebugOption("org.apache.geronimo.st.v11.ui/log/pages"));
+			logSections = Boolean.parseBoolean(Platform.getDebugOption("org.apache.geronimo.st.v11.ui/log/sections"));
+			
+			traceWizards = Boolean.parseBoolean(Platform.getDebugOption("org.apache.geronimo.st.v11.ui/trace/wizards"));
+			traceEditors = Boolean.parseBoolean(Platform.getDebugOption("org.apache.geronimo.st.v11.ui/trace/editors"));
+			tracePages = Boolean.parseBoolean(Platform.getDebugOption("org.apache.geronimo.st.v11.ui/trace/pages"));
+			traceSections = Boolean.parseBoolean(Platform.getDebugOption("org.apache.geronimo.st.v11.ui/trace/sections"));
+		} catch(NumberFormatException e) {
+    		Trace.trace(Trace.ERROR, e.getMessage(), true);
+    	} catch(NullPointerException e) {
+    		Trace.trace(Trace.ERROR, e.getMessage(), true);
+    	}
+	}
 	// The shared instance
 	private static Activator plugin;
-
+	
 	/**
 	 * The constructor
 	 */

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/internal/Trace.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/internal/Trace.java?rev=1127422&r1=1127421&r2=1127422&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/internal/Trace.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/internal/Trace.java Wed May 25 08:16:27 2011
@@ -16,6 +16,7 @@
  */
 package org.apache.geronimo.st.v11.ui.internal;
 
+import org.apache.geronimo.runtime.common.log.Logger;
 import org.apache.geronimo.st.v11.ui.Activator;
 
 /**
@@ -28,18 +29,26 @@ public class Trace {
     /**
      * Finest trace event.
      */
-    public static byte INFO = 0;
+    public static int INFO = 1;
 
     /**
      * Warning trace event.
      */
-    public static byte WARNING = 1;
+    public static int WARNING = 2;
 
     /**
-     * Severe trace event.
+     * error trace event.
      */
-    public static byte SEVERE = 2;
-
+    public static int ERROR = 4;
+    /**
+     * cancel trace event.
+     */
+    public static int CANCEL = 8;
+    
+    private static Logger log;
+    static {
+    	log = Logger.getInstance();
+    }
     /**
      * Trace constructor comment.
      */
@@ -55,8 +64,8 @@ public class Trace {
      * @param s
      *            a message
      */
-    public static void trace(byte level, String s) {
-        trace(level, s, null);
+    public static void trace(int level, String s, boolean opt) {
+        trace(level, s, null, opt);
     }
 
     /**
@@ -69,13 +78,17 @@ public class Trace {
      * @param t
      *            a throwable
      */
-    public static void trace(byte level, String s, Throwable t) {
+    public static void trace(int level, String s, Throwable t, boolean opt) {
         if (Activator.getDefault() == null || !Activator.getDefault().isDebugging())
             return;
-
-        System.out.println(Activator.PLUGIN_ID + ":  " + s);
-        if (t != null)
-            t.printStackTrace();
+        if(opt) {
+        	log.trace(level, Activator.PLUGIN_ID, s, t);
+        }
+        if(Activator.console) {
+            System.out.println(Activator.PLUGIN_ID + ":  " + s);
+            if (t != null)
+                t.printStackTrace();
+        }
     }
 
     /**
@@ -92,33 +105,33 @@ public class Trace {
      *            or
      *            Return value if the trace point is an "Exit"
      */
-    public static void trace(String tracePoint, String classDotMethod) {
-        trace(Trace.INFO, tracePoint + ": " + classDotMethod + "()" );
+    public static void trace(String tracePoint, String classDotMethod, boolean opt) {
+        trace(Trace.INFO, tracePoint + ": " + classDotMethod + "()", opt);
     }   
-    public static void trace(String tracePoint, String classDotMethod, Object parm1) {
-        trace(Trace.INFO, tracePoint + ": " + classDotMethod + "( parm1=[" + (parm1 == null ? null : parm1.toString()) + "] )" );
+    public static void trace(String tracePoint, boolean opt, String classDotMethod, Object parm1) {
+        trace(Trace.INFO, tracePoint + ": " + classDotMethod + "( parm1=[" + (parm1 == null ? null : parm1.toString()) + "] )" , opt);
     }
 
-    public static void trace(String tracePoint, String classDotMethod, Object parm1, Object parm2) {
+    public static void trace(String tracePoint, boolean opt, String classDotMethod, Object parm1, Object parm2) {
         trace(Trace.INFO, tracePoint + ": " + classDotMethod + "( parm1=[" + (parm1 == null ? null : parm1.toString()) + "], " +
-                                                                 "parm2=[" + (parm2 == null ? null : parm2.toString()) + "] )" );
+                                                                 "parm2=[" + (parm2 == null ? null : parm2.toString()) + "] )" , opt );
     }
-    public static void trace(String tracePoint, String classDotMethod, Object parm1, Object parm2, Object parm3) {
+    public static void trace(String tracePoint, boolean opt, String classDotMethod, Object parm1, Object parm2, Object parm3) {
         trace(Trace.INFO, tracePoint + ": " + classDotMethod + "( parm1=[" + (parm1 == null ? null : parm1.toString()) + "], " +
                                                                  "parm2=[" + (parm2 == null ? null : parm2.toString()) + "], " +
-                                                                 "parm3=[" + (parm3 == null ? null : parm3.toString()) + "] )" );
+                                                                 "parm3=[" + (parm3 == null ? null : parm3.toString()) + "] )" , opt );
     }
-    public static void trace(String tracePoint, String classDotMethod, Object parm1, Object parm2, Object parm3, Object parm4) {
+    public static void trace(String tracePoint, boolean opt, String classDotMethod, Object parm1, Object parm2, Object parm3, Object parm4) {
         trace(Trace.INFO, tracePoint + ": " + classDotMethod + "( parm1=[" + (parm1 == null ? null : parm1.toString()) + "], " +
                                                                  "parm2=[" + (parm2 == null ? null : parm2.toString()) + "], " +
                                                                  "parm3=[" + (parm3 == null ? null : parm3.toString()) + "], " +
-                                                                 "parm4=[" + (parm4 == null ? null : parm4.toString()) + "] )" );
+                                                                 "parm4=[" + (parm4 == null ? null : parm4.toString()) + "] )" , opt );
     }
-    public static void trace(String tracePoint, String classDotMethod, Object parm1, Object parm2, Object parm3, Object parm4, Object parm5) {
+    public static void trace(String tracePoint, boolean opt, String classDotMethod, Object parm1, Object parm2, Object parm3, Object parm4, Object parm5) {
         trace(Trace.INFO, tracePoint + ": " + classDotMethod + "( parm1=[" + (parm1 == null ? null : parm1.toString()) + "], " +
                                                                  "parm2=[" + (parm2 == null ? null : parm2.toString()) + "], " +
                                                                  "parm3=[" + (parm3 == null ? null : parm3.toString()) + "], " +
                                                                  "parm4=[" + (parm4 == null ? null : parm4.toString()) + "], " +
-                                                                 "parm5=[" + (parm5 == null ? null : parm5.toString()) + "] )" );
+                                                                 "parm5=[" + (parm5 == null ? null : parm5.toString()) + "] )" , opt );
     }
 }
\ No newline at end of file

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/wizards/FacetInstallPage.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/wizards/FacetInstallPage.java?rev=1127422&r1=1127421&r2=1127422&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/wizards/FacetInstallPage.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.ui/src/main/java/org/apache/geronimo/st/v11/ui/wizards/FacetInstallPage.java Wed May 25 08:16:27 2011
@@ -19,6 +19,7 @@ package org.apache.geronimo.st.v11.ui.wi
 import org.apache.geronimo.st.ui.CommonMessages;
 import org.apache.geronimo.st.ui.internal.Messages;
 import org.apache.geronimo.st.core.DeploymentPlanInstallConfig;
+import org.apache.geronimo.st.v11.ui.Activator;
 import org.apache.geronimo.st.v11.ui.internal.Trace;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.layout.GridData;
@@ -44,12 +45,12 @@ public class FacetInstallPage extends Ab
 
     public FacetInstallPage() {
         super("geronimo.plan.install");
-        Trace.trace("Constructor Entry", "FacetInstallPage");
+        Trace.trace("Constructor Entry", "FacetInstallPage", Activator.traceWizards);
         
         setTitle(Messages.geronimoDeploymentPlan);
         setDescription(Messages.configGeronimoDeploymentPlan);
         
-        Trace.trace("Constructor Exit", "FacetInstallPage");
+        Trace.trace("Constructor Exit", "FacetInstallPage", Activator.traceWizards);
     }
 
     /*
@@ -58,11 +59,11 @@ public class FacetInstallPage extends Ab
      * @see org.eclipse.wst.common.project.facet.ui.IFacetWizardPage#setConfig(java.lang.Object)
      */
     public void setConfig(Object config) {
-        Trace.trace("Entry", "FacetInstallPage.setConfig", config);
+        Trace.trace("Entry", Activator.traceWizards, "FacetInstallPage.setConfig", config);
 
         this.config = (DeploymentPlanInstallConfig) config;
         
-        Trace.trace("Exit", "FacetInstallPage.setConfig");
+        Trace.trace("Exit", "FacetInstallPage.setConfig", Activator.traceWizards);
     }
 
     /*
@@ -71,7 +72,7 @@ public class FacetInstallPage extends Ab
      * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
      */
     public void createControl(Composite parent) {
-        Trace.trace("Entry", "FacetInstallPage.createControl", parent);
+        Trace.trace("Entry", Activator.traceWizards, "FacetInstallPage.createControl", parent);
         
         Composite composite = new Composite(parent, SWT.NONE);
         composite.setLayout(new GridLayout(2, false));
@@ -112,7 +113,7 @@ public class FacetInstallPage extends Ab
         
         setControl(composite);
         
-        Trace.trace("Exit", "FacetInstallPage.createControl");      
+        Trace.trace("Exit", "FacetInstallPage.createControl", Activator.traceWizards);      
     }
 
     /*
@@ -121,7 +122,7 @@ public class FacetInstallPage extends Ab
      * @see org.eclipse.wst.common.project.facet.ui.AbstractFacetWizardPage#transferStateToConfig()
      */
     public void transferStateToConfig() {
-        Trace.trace("Entry", "FacetInstallPage.transferStateToConfig");     
+        Trace.trace("Entry", "FacetInstallPage.transferStateToConfig", Activator.traceWizards);     
     
         config.setGroupId(groupText.getText());
         config.setArtifactId(artifactText.getText());
@@ -129,7 +130,7 @@ public class FacetInstallPage extends Ab
         config.setType(typeText.getText());
         config.setSharedLib(sharedLib.getSelection());
         
-        Trace.trace("Exit", "FacetInstallPage.transferStateToConfig");      
+        Trace.trace("Exit", "FacetInstallPage.transferStateToConfig", Activator.traceWizards);      
     }
 
     private static GridData createGridData() {

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v20.core/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v20.core/META-INF/MANIFEST.MF?rev=1127422&r1=1127421&r2=1127422&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v20.core/META-INF/MANIFEST.MF (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v20.core/META-INF/MANIFEST.MF Wed May 25 08:16:27 2011
@@ -6,6 +6,7 @@ Bundle-Version: 3.0.0
 Bundle-Activator: org.apache.geronimo.st.v21.core.Activator
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
+Import-Package: org.apache.geronimo.runtime.common.log
 Require-Bundle: org.apache.geronimo.runtime.v20,
  org.apache.geronimo.st.v21.core,
  org.apache.geronimo.st.core,

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v20.core/src/main/java/org/apache/geronimo/st/v20/core/GeronimoV20ServerInfo.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v20.core/src/main/java/org/apache/geronimo/st/v20/core/GeronimoV20ServerInfo.java?rev=1127422&r1=1127421&r2=1127422&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v20.core/src/main/java/org/apache/geronimo/st/v20/core/GeronimoV20ServerInfo.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v20.core/src/main/java/org/apache/geronimo/st/v20/core/GeronimoV20ServerInfo.java Wed May 25 08:16:27 2011
@@ -40,6 +40,7 @@ import org.apache.geronimo.kernel.Kernel
 import org.apache.geronimo.kernel.NoSuchAttributeException;
 import org.apache.geronimo.kernel.NoSuchOperationException;
 import org.apache.geronimo.kernel.repository.Artifact;
+import org.apache.geronimo.st.core.Activator;
 import org.apache.geronimo.st.core.GeronimoServerBehaviourDelegate;
 import org.apache.geronimo.st.v21.core.IGeronimoServerInfo;
 import org.apache.geronimo.st.v21.core.internal.Trace;
@@ -149,7 +150,7 @@ public class GeronimoV20ServerInfo imple
                 } catch (SecurityException e) {
                 } catch (Exception e) {
                     Trace.trace(Trace.WARNING, "Kernel connection failed. "
-                            + e.getMessage());
+                            + e.getMessage(), Activator.logCore);
                 }
             }
         }
@@ -284,15 +285,15 @@ public class GeronimoV20ServerInfo imple
                     }
                 } catch (GBeanNotFoundException e) {
                     Trace.trace(Trace.WARNING, "GBean Not Found. "
-                            + e.getMessage());
+                            + e.getMessage(), Activator.logCore);
                 } catch (NoSuchOperationException e) {
                     Trace.trace(Trace.WARNING, "The operation cant invoked. "
-                            + e.getMessage());
+                            + e.getMessage(), Activator.logCore);
                 } catch (InternalKernelException e) {
                     throw e;
                 } catch (Exception e) {
                     Trace.trace(Trace.WARNING, "Kernel connection failed.  "
-                            + e.getMessage());
+                            + e.getMessage(), Activator.logCore);
                 }
 
             }
@@ -376,7 +377,7 @@ public class GeronimoV20ServerInfo imple
                 } catch (NoSuchAttributeException e) {
                 } catch (Exception e) {
                     Trace.trace(Trace.WARNING, "Kernel connection failed. "
-                            + e.getMessage());
+                            + e.getMessage(), Activator.logCore);
                 }
             }
         }

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/.options
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/.options?rev=1127422&r1=1127421&r2=1127422&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/.options (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/.options Wed May 25 08:16:27 2011
@@ -1 +1,13 @@
-org.apache.geronimo.st.v21.core/debug=true
\ No newline at end of file
+org.apache.geronimo.st.v21.core/debug=true
+
+org.apache.geronimo.st.v21.core/console=true
+
+org.apache.geronimo.st.v21.core/log/core=true
+org.apache.geronimo.st.v21.core/log/internal=true
+org.apache.geronimo.st.v21.core/log/operations=true
+org.apache.geronimo.st.v21.core/log/plugin=true
+
+org.apache.geronimo.st.v21.core/trace/core=false
+org.apache.geronimo.st.v21.core/trace/internal=false
+org.apache.geronimo.st.v21.core/trace/operations=false
+org.apache.geronimo.st.v21.core/trace/plugin=false
\ No newline at end of file

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/META-INF/MANIFEST.MF?rev=1127422&r1=1127421&r2=1127422&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/META-INF/MANIFEST.MF (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/META-INF/MANIFEST.MF Wed May 25 08:16:27 2011
@@ -6,6 +6,7 @@ Bundle-Version: 3.0.0
 Bundle-Activator: org.apache.geronimo.st.v21.core.Activator
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
+Import-Package: org.apache.geronimo.runtime.common.log,junit.framework
 Require-Bundle: org.apache.geronimo.runtime.v21,
  org.apache.geronimo.jaxbmodel.common,
  org.apache.geronimo.st.core,
@@ -22,4 +23,3 @@ Export-Package: 
  org.apache.geronimo.st.v21.core,
  org.apache.geronimo.st.v21.core.internal,
  org.apache.geronimo.st.v21.core.operations
-Import-Package: junit.framework

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/Activator.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/Activator.java?rev=1127422&r1=1127421&r2=1127422&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/Activator.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/Activator.java Wed May 25 08:16:27 2011
@@ -16,6 +16,8 @@
  */
 package org.apache.geronimo.st.v21.core;
 
+import org.apache.geronimo.st.v21.core.internal.Trace;
+import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.runtime.Plugin;
 import org.osgi.framework.BundleContext;
 
@@ -31,7 +33,37 @@ public class Activator extends Plugin {
 
 	// The shared instance
 	private static Activator plugin;
+    /* trace and log switchers */
+    public static boolean console;
+    public static boolean logCore;
+    public static boolean logInternal;
+    public static boolean logOperations;
+    public static boolean logPlugin;
+    
+    public static boolean traceCore;
+    public static boolean traceInternal;
+    public static boolean traceOperations;
+    public static boolean tracePlugin;
+    /* end here */
+    static {
+    	try {
+    		console = Boolean.parseBoolean(Platform.getDebugOption("org.apache.geronimo.st.v21.core/console"));
+    		logCore = Boolean.parseBoolean(Platform.getDebugOption("org.apache.geronimo.st.v21.core/log/core"));
+    		logInternal = Boolean.parseBoolean(Platform.getDebugOption("org.apache.geronimo.st.v21.core/log/internal"));
+    		logOperations = Boolean.parseBoolean(Platform.getDebugOption("org.apache.geronimo.st.v21.core/log/operations"));
+    		logPlugin = Boolean.parseBoolean(Platform.getDebugOption("org.apache.geronimo.st.v21.core/log/plugin"));
+    		
+    		traceCore = Boolean.parseBoolean(Platform.getDebugOption("org.apache.geronimo.st.v21.core/trace/core"));
+    		traceInternal = Boolean.parseBoolean(Platform.getDebugOption("org.apache.geronimo.st.v21.core/trace/internal"));
+    		traceOperations = Boolean.parseBoolean(Platform.getDebugOption("org.apache.geronimo.st.v21.core/trace/operations"));
+    		tracePlugin = Boolean.parseBoolean(Platform.getDebugOption("org.apache.geronimo.st.v21.core/trace/plugin"));
+    	} catch(NumberFormatException e) {
+    		Trace.trace(Trace.ERROR, e.getMessage(), true);
+    	} catch(NullPointerException e) {
+    		Trace.trace(Trace.ERROR, e.getMessage(), true);
+    	}
 
+    }
 	/**
 	 * The constructor
 	 */

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/GeronimoServerBehaviour.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/GeronimoServerBehaviour.java?rev=1127422&r1=1127421&r2=1127422&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/GeronimoServerBehaviour.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/GeronimoServerBehaviour.java Wed May 25 08:16:27 2011
@@ -33,7 +33,6 @@ import org.apache.geronimo.kernel.config
 import org.apache.geronimo.kernel.config.InvalidConfigException;
 import org.apache.geronimo.kernel.config.PersistentConfigurationList;
 import org.apache.geronimo.kernel.repository.Artifact;
-import org.apache.geronimo.st.core.Activator;
 import org.apache.geronimo.st.core.GeronimoServerBehaviourDelegate;
 import org.apache.geronimo.st.v21.core.internal.DependencyHelper;
 import org.apache.geronimo.st.v21.core.internal.Trace;
@@ -84,7 +83,7 @@ public class GeronimoServerBehaviour ext
 				throw e;
 			} catch (Exception e) {
 				Trace.trace(Trace.WARNING, "Kernel connection failed. "
-						+ e.getMessage());
+						+ e.getMessage(), Activator.logCore);
 			}
 		}
 		return kernel;
@@ -99,7 +98,7 @@ public class GeronimoServerBehaviour ext
 		try {
 			return getKernel() != null && kernel.isRunning();
 		} catch (SecurityException e) {
-			Trace.trace(Trace.SEVERE, "Invalid username and/or password.", e);
+			Trace.trace(Trace.ERROR, "Invalid username and/or password.", e, Activator.logCore);
 
 			pingThread.interrupt();
 			if (getServer().getServerState() != IServer.STATE_STOPPED) {
@@ -107,7 +106,7 @@ public class GeronimoServerBehaviour ext
 
 			}
 		} catch (Exception e) {
-			Activator.log(Status.WARNING, "Geronimo Server may have been terminated manually outside of workspace.", e);
+			Trace.trace(Trace.WARNING, "Geronimo Server may have been terminated manually outside of workspace.", e, Activator.logCore);
 			kernel = null;
 		}
 		return false;
@@ -169,7 +168,7 @@ public class GeronimoServerBehaviour ext
 					e.printStackTrace();
 				}
 			} else {
-				Trace.trace(Trace.INFO, "configLists is empty");
+				Trace.trace(Trace.INFO, "configLists is empty", Activator.traceCore);
 			}
 		}
 		return false;

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/GeronimoServerInfoManager.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/GeronimoServerInfoManager.java?rev=1127422&r1=1127421&r2=1127422&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/GeronimoServerInfoManager.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/GeronimoServerInfoManager.java Wed May 25 08:16:27 2011
@@ -37,7 +37,7 @@ public class GeronimoServerInfoManager {
 	}
 
 	private static synchronized void loadExtensionPoints() {
-		Trace.tracePoint("ENTRY", "GeronimoServerInfo.loadExtensionPoints");
+		Trace.tracePoint("ENTRY", Activator.traceCore, "GeronimoServerInfo.loadExtensionPoints");
 
 		IExtensionRegistry registry = Platform.getExtensionRegistry();
 		IConfigurationElement[] cf = registry.getConfigurationElementsFor(
@@ -55,13 +55,13 @@ public class GeronimoServerInfoManager {
 					}
 				} catch (CoreException e) {
 					Trace.tracePoint("CoreException",
-							"GeronimoServerInfo.loadExtensionPoints");
+							"GeronimoServerInfo.loadExtensionPoints", Activator.logCore);
 					e.printStackTrace();
 				}
 			}
 		}
 
-		Trace.tracePoint("EXIT", "GeronimoServerInfo.loadExtensionPoints");
+		Trace.tracePoint("EXIT", Activator.traceCore, "GeronimoServerInfo.loadExtensionPoints");
 	}
 	 
 

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/GeronimoV21ServerInfo.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/GeronimoV21ServerInfo.java?rev=1127422&r1=1127421&r2=1127422&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/GeronimoV21ServerInfo.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/GeronimoV21ServerInfo.java Wed May 25 08:16:27 2011
@@ -150,7 +150,7 @@ public class GeronimoV21ServerInfo imple
                 } catch (SecurityException e) {
                 } catch (Exception e) {
                     Trace.trace(Trace.WARNING, "Kernel connection failed. "
-                            + e.getMessage());
+                            + e.getMessage(), Activator.logCore);
                 }
             }
         }
@@ -285,15 +285,15 @@ public class GeronimoV21ServerInfo imple
                     }
                 } catch (GBeanNotFoundException e) {
                     Trace.trace(Trace.WARNING, "GBean Not Found. "
-                            + e.getMessage());
+                            + e.getMessage(), Activator.logCore);
                 } catch (NoSuchOperationException e) {
                     Trace.trace(Trace.WARNING, "The operation cant invoked. "
-                            + e.getMessage());
+                            + e.getMessage(), Activator.logCore);
                 } catch (InternalKernelException e) {
                     throw e;
                 } catch (Exception e) {
                     Trace.trace(Trace.WARNING, "Kernel connection failed.  "
-                            + e.getMessage());
+                            + e.getMessage(), Activator.logCore);
                 }
 
             }
@@ -377,7 +377,7 @@ public class GeronimoV21ServerInfo imple
                 } catch (NoSuchAttributeException e) {
                 } catch (Exception e) {
                     Trace.trace(Trace.WARNING, "Kernel connection failed. "
-                            + e.getMessage());
+                            + e.getMessage(), Activator.logCore);
                 }
             }
         }

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/GeronimoV21Utils.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/GeronimoV21Utils.java?rev=1127422&r1=1127421&r2=1127422&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/GeronimoV21Utils.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/GeronimoV21Utils.java Wed May 25 08:16:27 2011
@@ -37,7 +37,7 @@ import org.eclipse.wst.server.core.IModu
 public class GeronimoV21Utils extends GeronimoUtils {
 
     public static JAXBElement getDeploymentPlan(IFile file) throws Exception {
-        Trace.tracePoint("ENTRY", "GeronimoV21Utils.getDeploymentPlan", file);
+        Trace.tracePoint("ENTRY", Activator.traceCore, "GeronimoV21Utils.getDeploymentPlan", file);
 
         if (!file.exists()) {
             return null;
@@ -54,7 +54,7 @@ public class GeronimoV21Utils extends Ge
         else if (file.getName().equals(GeronimoUtils.APP_CLIENT_PLAN_NAME))
             return getApplicationClientDeploymentPlan(file);
 
-        Trace.tracePoint("EXIT", "GeronimoV21Utils.getDeploymentPlan", null);
+        Trace.tracePoint("EXIT", Activator.traceCore, "GeronimoV21Utils.getDeploymentPlan", null);
         return null;
     }
 
@@ -111,7 +111,7 @@ public class GeronimoV21Utils extends Ge
     //}
 
     public static String getConfigId(IModule module) throws Exception {
-        Trace.tracePoint("ENTRY", "GeronimoV21Utils.getConfigId", module);
+        Trace.tracePoint("ENTRY", Activator.traceCore, "GeronimoV21Utils.getConfigId", module);
 
         Environment environment = null;
         if (isWebModule(module)) {
@@ -145,11 +145,11 @@ public class GeronimoV21Utils extends Ge
 
         if (environment != null
             && environment.getModuleId() != null) {
-            Trace.tracePoint("EXIT", "GeronimoV21Utils.getConfigId", getQualifiedConfigID(environment.getModuleId()));
+            Trace.tracePoint("EXIT", Activator.traceCore, "GeronimoV21Utils.getConfigId", getQualifiedConfigID(environment.getModuleId()));
             return getQualifiedConfigID(environment.getModuleId());
         }
 
-        Trace.tracePoint("EXIT", "GeronimoV21Utils.getConfigId", getId(module));
+        Trace.tracePoint("EXIT", Activator.traceCore, "GeronimoV21Utils.getConfigId", getId(module));
         return getId(module);
     }
 
@@ -207,57 +207,57 @@ public class GeronimoV21Utils extends Ge
     }
 
     public static JAXBElement getApplicationDeploymentPlan(IFile file) throws Exception {
-        Trace.tracePoint("ENTRY", "GeronimoV21Utils.getApplicationDeploymentPlan", file);
+        Trace.tracePoint("ENTRY", Activator.traceCore, "GeronimoV21Utils.getApplicationDeploymentPlan", file);
 
         if (file.getName().equals(APP_PLAN_NAME) && file.exists()) {
         	return JAXBUtils.unmarshalFilterDeploymentPlan(file);
         }
 
-        Trace.tracePoint("EXIT", "GeronimoV21Utils.getApplicationDeploymentPlan", null);
+        Trace.tracePoint("EXIT", Activator.traceCore, "GeronimoV21Utils.getApplicationDeploymentPlan", null);
         return null;
     }
 
     public static JAXBElement getApplicationClientDeploymentPlan(IFile file) throws Exception {
-        Trace.tracePoint("ENTRY", "GeronimoV21Utils.getApplicationClientDeploymentPlan", file);
+        Trace.tracePoint("ENTRY", Activator.traceCore, "GeronimoV21Utils.getApplicationClientDeploymentPlan", file);
 
         if (file.getName().equals(APP_CLIENT_PLAN_NAME) && file.exists()) {
         	return JAXBUtils.unmarshalFilterDeploymentPlan(file);
         }
 
-        Trace.tracePoint("EXIT", "GeronimoV21Utils.getApplicationClientDeploymentPlan", null);
+        Trace.tracePoint("EXIT", Activator.traceCore, "GeronimoV21Utils.getApplicationClientDeploymentPlan", null);
         return null;
     }
 
     public static JAXBElement getWebDeploymentPlan(IFile file) throws Exception {
-        Trace.tracePoint("ENTRY", "GeronimoV21Utils.getWebDeploymentPlan", file);
+        Trace.tracePoint("ENTRY", Activator.traceCore, "GeronimoV21Utils.getWebDeploymentPlan", file);
 
         if (file.getName().equals(WEB_PLAN_NAME) && file.exists()) {
         	return JAXBUtils.unmarshalFilterDeploymentPlan(file);
         }
 
-        Trace.tracePoint("EXIT", "GeronimoV21Utils.getWebDeploymentPlan", null);
+        Trace.tracePoint("EXIT", Activator.traceCore, "GeronimoV21Utils.getWebDeploymentPlan", null);
         return null;
     }
 
     public static JAXBElement getOpenEjbDeploymentPlan(IFile file) throws Exception {
-        Trace.tracePoint("ENTRY", "GeronimoV21Utils.getOpenEjbDeploymentPlan", file);
+        Trace.tracePoint("ENTRY", Activator.traceCore, "GeronimoV21Utils.getOpenEjbDeploymentPlan", file);
 
         if (file.getName().equals(OPENEJB_PLAN_NAME) && file.exists()) {
         	return JAXBUtils.unmarshalFilterDeploymentPlan(file);
         }
 
-        Trace.tracePoint("EXIT", "GeronimoV21Utils.getOpenEjbDeploymentPlan", null);
+        Trace.tracePoint("EXIT", Activator.traceCore, "GeronimoV21Utils.getOpenEjbDeploymentPlan", null);
         return null;
     }
 
     public static JAXBElement getConnectorDeploymentPlan(IFile file) throws Exception {
-        Trace.tracePoint("ENTRY", "GeronimoV21Utils.getConnectorDeploymentPlan", file);
+        Trace.tracePoint("ENTRY", Activator.traceCore, "GeronimoV21Utils.getConnectorDeploymentPlan", file);
 
         if (file.getName().equals(CONNECTOR_PLAN_NAME) && file.exists()) {
         	return JAXBUtils.unmarshalFilterDeploymentPlan(file);
         }
 
-        Trace.tracePoint("EXIT", "GeronimoV21Utils.getConnectorDeploymentPlan", null);
+        Trace.tracePoint("EXIT", Activator.traceCore, "GeronimoV21Utils.getConnectorDeploymentPlan", null);
         return null;
     }
     

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/internal/DependencyHelper.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/internal/DependencyHelper.java?rev=1127422&r1=1127421&r2=1127422&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/internal/DependencyHelper.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/internal/DependencyHelper.java Wed May 25 08:16:27 2011
@@ -36,6 +36,7 @@ import org.apache.geronimo.jee.deploymen
 import org.apache.geronimo.jee.deployment.ObjectFactory;
 import org.apache.geronimo.jee.openejb.OpenejbJar;
 import org.apache.geronimo.jee.web.WebApp;
+import org.apache.geronimo.st.v21.core.Activator;
 import org.apache.geronimo.st.core.DeploymentUtils;
 import org.apache.geronimo.st.core.GeronimoUtils;
 import org.eclipse.core.resources.IFile;
@@ -81,7 +82,7 @@ public class DependencyHelper {
      * @return List of reordered modules and deltaKind (or input if no change)
      */
     public List reorderModules(IServer server, List modules, List deltaKind ) {
-        Trace.tracePoint("Entry", "DependencyHelper.reorderModules", modules, deltaKind);
+        Trace.tracePoint("Entry", Activator.traceInternal, "DependencyHelper.reorderModules", modules, deltaKind);
         
         //provide a cache
         ConcurrentHashMap<String,Boolean> verifiedModules = new ConcurrentHashMap<String,Boolean>();
@@ -91,7 +92,7 @@ public class DependencyHelper {
             List reorderedLists = new ArrayList(2);
             reorderedLists.add(modules);
             reorderedLists.add(deltaKind);
-            Trace.tracePoint("Exit ", "DependencyHelper.reorderModules", reorderedLists);
+            Trace.tracePoint("Exit ", Activator.traceInternal, "DependencyHelper.reorderModules", reorderedLists);
             return reorderedLists;
         }
 
@@ -229,7 +230,7 @@ public class DependencyHelper {
         reorderedLists.add(reorderedModules);
         reorderedLists.add(reorderedKinds);
 
-        Trace.tracePoint("Exit ", "DependencyHelper.reorderModules", reorderedLists);
+        Trace.tracePoint("Exit ", Activator.traceInternal, "DependencyHelper.reorderModules", reorderedLists);
         return reorderedLists;
     }
 
@@ -242,10 +243,10 @@ public class DependencyHelper {
      * @return List of JAXBElements (or input if no change)
      */
     public List<JAXBElement> reorderJAXBElements( List<JAXBElement> jaxbElements ) {
-        Trace.tracePoint("Entry", "DependencyHelper.reorderModules", jaxbElements);
+        Trace.tracePoint("Entry", Activator.traceInternal, "DependencyHelper.reorderModules", jaxbElements);
 
         if (jaxbElements.size() == 0) {
-            Trace.tracePoint("Exit ", "DependencyHelper.reorderModules", jaxbElements);
+            Trace.tracePoint("Exit ", Activator.traceInternal, "DependencyHelper.reorderModules", jaxbElements);
             return jaxbElements;
         }
 
@@ -325,7 +326,7 @@ public class DependencyHelper {
         // 
         // Return List of JAXBElements
         // 
-        Trace.tracePoint("Exit ", "DependencyHelper.reorderModules", reorderedJAXBElements);
+        Trace.tracePoint("Exit ", Activator.traceInternal, "DependencyHelper.reorderModules", reorderedJAXBElements);
         return reorderedJAXBElements;
     }
 
@@ -353,10 +354,10 @@ public class DependencyHelper {
      * @param terminatingArtifact
      */
     private void processParents(Set parents, Artifact terminatingArtifact) {
-        Trace.tracePoint("Enter", "DependencyHelper.processParents", parents, terminatingArtifact );
+        Trace.tracePoint("Enter", Activator.traceInternal, "DependencyHelper.processParents", parents, terminatingArtifact );
 
         if (parents == null) {
-            Trace.tracePoint("Exit ", "DependencyHelper.processParents", null);
+            Trace.tracePoint("Exit ", Activator.traceInternal, "DependencyHelper.processParents", null);
             return;
         }
         for (Iterator ii = parents.iterator(); ii.hasNext();) {
@@ -384,7 +385,7 @@ public class DependencyHelper {
             }
         }
 
-        Trace.tracePoint("Exit ", "DependencyHelper.processParents");
+        Trace.tracePoint("Exit ", Activator.traceInternal, "DependencyHelper.processParents");
     }
 
 
@@ -396,7 +397,7 @@ public class DependencyHelper {
      * @return Environment
      */
     private Environment getEnvironment(IModule module) {
-        Trace.tracePoint("Enter", "DependencyHelper.getEnvironment", module);
+        Trace.tracePoint("Enter", Activator.traceInternal, "DependencyHelper.getEnvironment", module);
         
         // if module's environment is in the cache, get it from the cache
         if(environmentCache.containsKey(module)) {
@@ -444,7 +445,7 @@ public class DependencyHelper {
             environmentCache.put(module, environment);
         } 
 
-        Trace.tracePoint("Exit ", "DependencyHelper.getEnvironment", environment);
+        Trace.tracePoint("Exit ", Activator.traceInternal, "DependencyHelper.getEnvironment", environment);
         return environment;
     }
 
@@ -457,7 +458,7 @@ public class DependencyHelper {
      * @return IModule[]
      */
     private IModule[] getModule(Artifact artifact) {
-        Trace.tracePoint("Enter", "DependencyHelper.getModule", artifact);
+        Trace.tracePoint("Enter", Activator.traceInternal, "DependencyHelper.getModule", artifact);
 
         for (int ii=0; ii<inputModules.size(); ii++) {
             IModule[] module = (IModule[]) inputModules.get(ii);
@@ -466,13 +467,13 @@ public class DependencyHelper {
             if (environment != null) {
                 Artifact moduleArtifact = environment.getModuleId();
                 if (artifact.equals(moduleArtifact)) {
-                    Trace.tracePoint("Exit ", "DependencyHelper.getModule", module);
+                    Trace.tracePoint("Exit ", Activator.traceInternal, "DependencyHelper.getModule", module);
                     return module;
                 }
             }
         }
 
-        Trace.tracePoint("Exit ", "DependencyHelper.getModule", null);
+        Trace.tracePoint("Exit ", Activator.traceInternal, "DependencyHelper.getModule", null);
         return null;
     }
 
@@ -485,7 +486,7 @@ public class DependencyHelper {
      * @return int
      */
     private int getDeltaKind(Artifact artifact) {
-        Trace.tracePoint("Enter", "DependencyHelper.getDeltaKind", artifact);
+        Trace.tracePoint("Enter", Activator.traceInternal, "DependencyHelper.getDeltaKind", artifact);
 
         for (int ii=0; ii<inputModules.size(); ii++) {
             IModule[] module = (IModule[]) inputModules.get(ii);
@@ -494,12 +495,12 @@ public class DependencyHelper {
             if (environment != null) {
                 Artifact moduleArtifact = environment.getModuleId();
                 if (artifact.equals(moduleArtifact)) {
-                    Trace.tracePoint("Exit ", "DependencyHelper.getDeltaKind", moduleDeltaKind);
+                    Trace.tracePoint("Exit ", Activator.traceInternal, "DependencyHelper.getDeltaKind", moduleDeltaKind);
                     return moduleDeltaKind;
                 }
             }
         }
-        Trace.tracePoint("Exit ", "DependencyHelper.getDeltaKind", 0);
+        Trace.tracePoint("Exit ", Activator.traceInternal, "DependencyHelper.getDeltaKind", 0);
         return 0;
     }
 
@@ -512,13 +513,13 @@ public class DependencyHelper {
      * @return WebApp
      */
     private JAXBElement<WebApp> getWebDeploymentPlan(IModule module) {
-        Trace.tracePoint("Enter", "DependencyHelper.getWebDeploymentPlan", module);
+        Trace.tracePoint("Enter", Activator.traceInternal, "DependencyHelper.getWebDeploymentPlan", module);
 
         IVirtualComponent comp = GeronimoUtils.getVirtualComponent(module);
         IFile file = GeronimoUtils.getWebDeploymentPlanFile(comp);
         if (file.getName().equals(GeronimoUtils.WEB_PLAN_NAME) && file.exists()) {
             try {
-				Trace.tracePoint("Exit ", "DependencyHelper.getWebDeploymentPlan", JAXBUtils.unmarshalFilterDeploymentPlan(file));
+				Trace.tracePoint("Exit ", Activator.traceInternal, "DependencyHelper.getWebDeploymentPlan", JAXBUtils.unmarshalFilterDeploymentPlan(file));
 				 return JAXBUtils.unmarshalFilterDeploymentPlan(file);
 			} catch (Exception e) {
 				//ignore it, just indicate error by returning null
@@ -526,7 +527,7 @@ public class DependencyHelper {
            
         }
 
-        Trace.tracePoint("Exit ", "DependencyHelper.getWebDeploymentPlan", null);
+        Trace.tracePoint("Exit ", Activator.traceInternal, "DependencyHelper.getWebDeploymentPlan", null);
         return null;
     }
 
@@ -539,13 +540,13 @@ public class DependencyHelper {
      * @return OpenEjbJar
      */
     private JAXBElement<OpenejbJar> getOpenEjbDeploymentPlan(IModule module) {
-        Trace.tracePoint("Enter", "DependencyHelper.getOpenEjbDeploymentPlan", module);
+        Trace.tracePoint("Enter", Activator.traceInternal, "DependencyHelper.getOpenEjbDeploymentPlan", module);
 
         IVirtualComponent comp = GeronimoUtils.getVirtualComponent(module);
         IFile file = GeronimoUtils.getOpenEjbDeploymentPlanFile(comp);
         if (file.getName().equals(GeronimoUtils.OPENEJB_PLAN_NAME) && file.exists()) {
             try {
-				Trace.tracePoint("Exit ", "DependencyHelper.getOpenEjbDeploymentPlan", JAXBUtils.unmarshalFilterDeploymentPlan(file));
+				Trace.tracePoint("Exit ", Activator.traceInternal, "DependencyHelper.getOpenEjbDeploymentPlan", JAXBUtils.unmarshalFilterDeploymentPlan(file));
 			} catch (Exception e) {
 				//ignore it, just indicate error by returning null
 			}
@@ -556,7 +557,7 @@ public class DependencyHelper {
 			}
         }
 
-        Trace.tracePoint("Exit ", "DependencyHelper.getOpenEjbDeploymentPlan", null);
+        Trace.tracePoint("Exit ", Activator.traceInternal, "DependencyHelper.getOpenEjbDeploymentPlan", null);
         return null;
     }
 
@@ -568,13 +569,13 @@ public class DependencyHelper {
      * @return ApplicationClient
      */
     private JAXBElement<ApplicationClient> getAppClientDeploymentPlan(IModule module) {
-        Trace.tracePoint("Enter", "DependencyHelper.getWebDeploymentPlan", module);
+        Trace.tracePoint("Enter", Activator.traceInternal, "DependencyHelper.getWebDeploymentPlan", module);
 
         IVirtualComponent comp = GeronimoUtils.getVirtualComponent(module);
         IFile file = GeronimoUtils.getApplicationClientDeploymentPlanFile(comp);
         if (file.getName().equals(GeronimoUtils.APP_CLIENT_PLAN_NAME) && file.exists()) {
             try {
-				Trace.tracePoint("Exit ", "DependencyHelper.getWebDeploymentPlan", JAXBUtils.unmarshalFilterDeploymentPlan(file));
+				Trace.tracePoint("Exit ", Activator.traceInternal, "DependencyHelper.getWebDeploymentPlan", JAXBUtils.unmarshalFilterDeploymentPlan(file));
 				 return JAXBUtils.unmarshalFilterDeploymentPlan(file);
 			} catch (Exception e) {
 				//ignore it, just indicate error by returning null
@@ -582,7 +583,7 @@ public class DependencyHelper {
            
         }
 
-        Trace.tracePoint("Exit ", "DependencyHelper.getWebDeploymentPlan", null);
+        Trace.tracePoint("Exit ", Activator.traceInternal, "DependencyHelper.getWebDeploymentPlan", null);
         return null;
     }
     
@@ -594,13 +595,13 @@ public class DependencyHelper {
      * @return Application
      */
     private JAXBElement<Application> getApplicationDeploymentPlan(IModule module) {
-        Trace.tracePoint("Enter", "DependencyHelper.getApplicationDeploymentPlan", module);
+        Trace.tracePoint("Enter", Activator.traceInternal, "DependencyHelper.getApplicationDeploymentPlan", module);
 
         IVirtualComponent comp = GeronimoUtils.getVirtualComponent(module);
         IFile file = GeronimoUtils.getApplicationDeploymentPlanFile(comp);
         if (file.getName().equals(GeronimoUtils.APP_PLAN_NAME) && file.exists()) {
             try {
-				Trace.tracePoint("Exit ", "DependencyHelper.getApplicationDeploymentPlan", JAXBUtils.unmarshalFilterDeploymentPlan(file));
+				Trace.tracePoint("Exit ", Activator.traceInternal, "DependencyHelper.getApplicationDeploymentPlan", JAXBUtils.unmarshalFilterDeploymentPlan(file));
 				  return JAXBUtils.unmarshalFilterDeploymentPlan(file);
 			} catch (Exception e) {
 				//ignore it, just indicate error by returning null
@@ -608,7 +609,7 @@ public class DependencyHelper {
           
         }
 
-        Trace.tracePoint("Exit ", "DependencyHelper.getApplicationDeploymentPlan", null);
+        Trace.tracePoint("Exit ", Activator.traceInternal, "DependencyHelper.getApplicationDeploymentPlan", null);
         return null;
     }
 
@@ -621,13 +622,13 @@ public class DependencyHelper {
      * @return Application
      */
     private JAXBElement<Connector> getConnectorDeploymentPlan(IModule module) {
-        Trace.tracePoint("Enter", "DependencyHelper.getConnectorDeploymentPlan", module);
+        Trace.tracePoint("Enter", Activator.traceInternal, "DependencyHelper.getConnectorDeploymentPlan", module);
 
         IVirtualComponent comp = GeronimoUtils.getVirtualComponent(module);
         IFile file = GeronimoUtils.getConnectorDeploymentPlanFile(comp);
         if (file.getName().equals(GeronimoUtils.CONNECTOR_PLAN_NAME) && file.exists()) {
             try {
-				Trace.tracePoint("Exit ", "DependencyHelper.getConnectorDeploymentPlan", JAXBUtils.unmarshalFilterDeploymentPlan(file));
+				Trace.tracePoint("Exit ", Activator.traceInternal, "DependencyHelper.getConnectorDeploymentPlan", JAXBUtils.unmarshalFilterDeploymentPlan(file));
 				 return JAXBUtils.unmarshalFilterDeploymentPlan(file);
 			} catch (Exception e) {
 				//ignore it, just indicate error by returning null
@@ -635,7 +636,7 @@ public class DependencyHelper {
            
         }
 
-        Trace.tracePoint("Exit ", "DependencyHelper.getConnectorDeploymentPlan", null);
+        Trace.tracePoint("Exit ", Activator.traceInternal, "DependencyHelper.getConnectorDeploymentPlan", null);
         return null;
     }
 
@@ -649,10 +650,10 @@ public class DependencyHelper {
      * @param terminatingArtifact
      */
     private void processJaxbParents(Set parents, Artifact terminatingArtifact) {
-        Trace.tracePoint("Enter", "DependencyHelper.processJaxbParents", parents, terminatingArtifact );
+        Trace.tracePoint("Enter", Activator.traceInternal, "DependencyHelper.processJaxbParents", parents, terminatingArtifact );
 
         if (parents == null) {
-            Trace.tracePoint("Exit ", "DependencyHelper.processJaxbParents", null);
+            Trace.tracePoint("Exit ", Activator.traceInternal, "DependencyHelper.processJaxbParents", null);
             return;
         }
         for (Iterator ii = parents.iterator(); ii.hasNext();) {
@@ -680,7 +681,7 @@ public class DependencyHelper {
             }
         }
 
-        Trace.tracePoint("Exit ", "DependencyHelper.processJaxbParents");
+        Trace.tracePoint("Exit ", Activator.traceInternal, "DependencyHelper.processJaxbParents");
     }
 
 
@@ -692,7 +693,7 @@ public class DependencyHelper {
      * @return Environment
      */
     private Environment getEnvironment(JAXBElement jaxbElement) {
-        Trace.tracePoint("Enter", "DependencyHelper.getEnvironment", jaxbElement);
+        Trace.tracePoint("Enter", Activator.traceInternal, "DependencyHelper.getEnvironment", jaxbElement);
 
         Environment environment = null;
         Object plan = jaxbElement.getValue();
@@ -711,7 +712,7 @@ public class DependencyHelper {
             }
         }
 
-        Trace.tracePoint("Exit ", "DependencyHelper.getEnvironment", environment);
+        Trace.tracePoint("Exit ", Activator.traceInternal, "DependencyHelper.getEnvironment", environment);
         return environment;
     }
 
@@ -724,21 +725,21 @@ public class DependencyHelper {
      * @return JAXBElement
      */
     private JAXBElement getJaxbElement(Artifact artifact) {
-        Trace.tracePoint("Enter", "DependencyHelper.getJaxbElement", artifact);
+        Trace.tracePoint("Enter", Activator.traceInternal, "DependencyHelper.getJaxbElement", artifact);
 
         for (JAXBElement jaxbElement : inputJAXBElements) {
             Environment environment = getEnvironment(jaxbElement);
             if (environment != null) {
                 Artifact jaxbArtifact = environment.getModuleId();
                 if (artifact.equals(jaxbArtifact)) {
-                    Trace.tracePoint("Exit ", "DependencyHelper.getJaxbElement", jaxbElement);
+                    Trace.tracePoint("Exit ", Activator.traceInternal, "DependencyHelper.getJaxbElement", jaxbElement);
                     return jaxbElement;
                 }
             }
         }
 
         // TODO: Query the server searching for missing dependencies
-        Trace.tracePoint("Exit ", "DependencyHelper.getJaxbElement", null);
+        Trace.tracePoint("Exit ", Activator.traceInternal, "DependencyHelper.getJaxbElement", null);
         return null;
     }
 }

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/internal/DependencyManager.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/internal/DependencyManager.java?rev=1127422&r1=1127421&r2=1127422&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/internal/DependencyManager.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/internal/DependencyManager.java Wed May 25 08:16:27 2011
@@ -25,6 +25,7 @@ import java.util.Map;
 import java.util.Set;
 
 import org.apache.geronimo.jee.deployment.Artifact;
+import org.apache.geronimo.st.v21.core.Activator;
 
 /**
  * <b>DependencyManager</b> is very closely-based on the similar class in the Geronimo server.
@@ -71,7 +72,7 @@ public class DependencyManager {
      * @param parent the component the child is depending on
      */
     public void addDependency(Artifact child, Artifact parent) {
-        Trace.tracePoint("Entry", "DependencyManager.addDependency", child, parent);
+        Trace.tracePoint("Entry", Activator.traceInternal, "DependencyManager.addDependency", child, parent);
 
         Set parents = (Set) childToParentMap.get(child);
         if (parents == null) {
@@ -87,8 +88,8 @@ public class DependencyManager {
         }
         children.add(child);
 
-        Trace.tracePoint("Exit ", "DependencyManager.addDependency", childToParentMap.size() );
-        Trace.tracePoint("Exit ", "DependencyManager.addDependency", parentToChildMap.size() );
+        Trace.tracePoint("Exit ", Activator.traceInternal, "DependencyManager.addDependency", childToParentMap.size() );
+        Trace.tracePoint("Exit ", Activator.traceInternal, "DependencyManager.addDependency", parentToChildMap.size() );
     }
 
 
@@ -99,7 +100,7 @@ public class DependencyManager {
      * @param parent the component that the child wil no longer depend on
      */
     public void removeDependency(Artifact child, Artifact parent) {
-        Trace.tracePoint("Entry", "DependencyManager.removeDependency", child, parent);
+        Trace.tracePoint("Entry", Activator.traceInternal, "DependencyManager.removeDependency", child, parent);
 
         Set parents = (Set) childToParentMap.get(child);
         if (parents != null) {
@@ -111,7 +112,7 @@ public class DependencyManager {
             children.remove(child);
         }
 
-        Trace.tracePoint("Exit ", "DependencyManager.addDependency");
+        Trace.tracePoint("Exit ", Activator.traceInternal, "DependencyManager.addDependency");
     }
 
 
@@ -121,7 +122,7 @@ public class DependencyManager {
      * @param child the component that will no longer depend on anything
      */
     public void removeAllDependencies(Artifact child) {
-        Trace.tracePoint("Entry", "DependencyManager.removeAllDependencies", child);
+        Trace.tracePoint("Entry", Activator.traceInternal, "DependencyManager.removeAllDependencies", child);
 
         Set parents = (Set) childToParentMap.remove(child);
         if (parents == null) {
@@ -136,7 +137,7 @@ public class DependencyManager {
             }
         }
 
-        Trace.tracePoint("Exit ", "DependencyManager.removeAllDependencies");
+        Trace.tracePoint("Exit ", Activator.traceInternal, "DependencyManager.removeAllDependencies");
     }
 
 
@@ -147,7 +148,7 @@ public class DependencyManager {
      * @param parents the set of components the child is depending on
      */
     public void addDependencies(Artifact child, Set parents) {
-        Trace.tracePoint("Entry", "DependencyManager.addDependencies", child, parents);
+        Trace.tracePoint("Entry", Activator.traceInternal, "DependencyManager.addDependencies", child, parents);
 
         Set existingParents = (Set) childToParentMap.get(child);
         if (existingParents == null) {
@@ -168,7 +169,7 @@ public class DependencyManager {
             children.add(child);
         }
 
-        Trace.tracePoint("Exit ", "DependencyManager.addDependencies");
+        Trace.tracePoint("Exit ", Activator.traceInternal, "DependencyManager.addDependencies");
     }
 
 
@@ -179,15 +180,15 @@ public class DependencyManager {
      * @return a collection containing all of the components the child depends on; will never be null
      */
     public Set getParents(Artifact child) {
-        Trace.tracePoint("Entry", "DependencyManager.getParents", child);
+        Trace.tracePoint("Entry", Activator.traceInternal, "DependencyManager.getParents", child);
 
         Set parents = (Set) childToParentMap.get(child);
         if (parents == null) {
-            Trace.tracePoint("Exit", "DependencyManager.getParents", 0);
+            Trace.tracePoint("Exit", Activator.traceInternal, "DependencyManager.getParents", 0);
             return Collections.EMPTY_SET;
         }
 
-        Trace.tracePoint("Exit", "DependencyManager.getParents", parents.size() );
+        Trace.tracePoint("Exit", Activator.traceInternal, "DependencyManager.getParents", parents.size() );
         return new LinkedHashSet(parents);
     }
 
@@ -199,15 +200,15 @@ public class DependencyManager {
      * @return a collection containing all of the components that depend on the parent; will never be null
      */
     public Set getChildren(Artifact parent) {
-        Trace.tracePoint("Entry", "DependencyManager.getChildren", parent);
+        Trace.tracePoint("Entry", Activator.traceInternal, "DependencyManager.getChildren", parent);
 
         Set children = (Set) parentToChildMap.get(parent);
         if (children == null) {
-            Trace.tracePoint("Exit ", "DependencyManager.getChildren", 0);
+            Trace.tracePoint("Exit ", Activator.traceInternal, "DependencyManager.getChildren", 0);
             return Collections.EMPTY_SET;
         }
 
-        Trace.tracePoint("Exit ", "DependencyManager.getChildren", children.size() );
+        Trace.tracePoint("Exit ", Activator.traceInternal, "DependencyManager.getChildren", children.size() );
         return new LinkedHashSet(children);
     }
 }

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/internal/Trace.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/internal/Trace.java?rev=1127422&r1=1127421&r2=1127422&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/internal/Trace.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/internal/Trace.java Wed May 25 08:16:27 2011
@@ -16,6 +16,7 @@
  */
 package org.apache.geronimo.st.v21.core.internal;
 
+import org.apache.geronimo.runtime.common.log.Logger;
 import org.apache.geronimo.st.v21.core.Activator;
 
 /**
@@ -28,21 +29,29 @@ public class Trace {
     /**
      * Finest trace event.
      */
-    public static byte INFO = 0;
+    public static int INFO = 1;
 
     /**
      * Warning trace event.
      */
-    public static byte WARNING = 1;
+    public static int WARNING = 2;
 
     /**
-     * Severe trace event.
+     * error trace event.
      */
-    public static byte SEVERE = 2;
+    public static int ERROR = 4;
+    /**
+     * cancel trace event.
+     */
+    public static int CANCEL = 8;
 
     /**
      * Trace constructor comment.
      */
+    private static Logger log;
+    static {
+    	log = Logger.getInstance();
+    }
     private Trace() {
         super();
     }
@@ -55,8 +64,8 @@ public class Trace {
      * @param s
      *            a message
      */
-    public static void trace(byte level, String s) {
-        trace(level, s, null);
+    public static void trace(int level, String s, boolean opt) {
+        trace(level, s, null, opt);
     }
 
     /**
@@ -69,15 +78,17 @@ public class Trace {
      * @param t
      *            a throwable
      */
-    public static void trace(byte level, String s, Throwable t) {
-    	if (Activator.getDefault() == null
-				|| !Activator.getDefault().isDebugging())
-			return;
-
-        System.out.println(Activator.PLUGIN_ID + ":  " + s);
-        if (t != null)
-            t.printStackTrace();
-        
+    public static void trace(int level, String s, Throwable t, boolean opt) {
+        if (Activator.getDefault() == null || !Activator.getDefault().isDebugging())
+            return;
+        if(opt) {
+        	log.trace(level, Activator.PLUGIN_ID, s, t);
+        }
+        if(Activator.console) {
+            System.out.println(Activator.PLUGIN_ID + ":  " + s);
+            if (t != null)
+                t.printStackTrace();
+        }
     }
 
     /**
@@ -94,20 +105,20 @@ public class Trace {
      *            or
      *            Return value if the trace point is an "Exit"
      */
-    public static void tracePoint(String tracePoint, String classDotMethod) {
-        trace(Trace.INFO, tracePoint + ": " + classDotMethod + "()" );
+    public static void tracePoint(String tracePoint, String classDotMethod, boolean opt) {
+        trace(Trace.INFO, tracePoint + ": " + classDotMethod + "()", opt);
     }   
-    public static void tracePoint(String tracePoint, String classDotMethod, Object... parms) {
+    public static void tracePoint(String tracePoint, boolean opt, String classDotMethod, Object... parms) {
         if ( parms == null ) {
-            trace(Trace.INFO, tracePoint + ": " + classDotMethod + "( null )" );
+            trace(Trace.INFO, tracePoint + ": " + classDotMethod + "( null )" , opt);
         }
         else {
-            trace(Trace.INFO, tracePoint + ": " + classDotMethod + "(" );
+            trace(Trace.INFO, tracePoint + ": " + classDotMethod + "(" , opt);
             for ( int ii=0; ii<parms.length; ii++) {
                 Object parm = parms[ii];
-                trace(Trace.INFO, "    parm" + (ii+1) + "=[" + (parm == null ? null : parm.toString()) + "]" );
+                trace(Trace.INFO, "    parm" + (ii+1) + "=[" + (parm == null ? null : parm.toString()) + "]" , opt);
             }
-            trace(Trace.INFO, ")" );
+            trace(Trace.INFO, ")" ,opt);
         }
-    }   
+    } 
 }

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/operations/GeronimoServerV21PluginManager.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/operations/GeronimoServerV21PluginManager.java?rev=1127422&r1=1127421&r2=1127422&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/operations/GeronimoServerV21PluginManager.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v21.core/src/main/java/org/apache/geronimo/st/v21/core/operations/GeronimoServerV21PluginManager.java Wed May 25 08:16:27 2011
@@ -56,6 +56,7 @@ import org.apache.geronimo.st.core.Commo
 import org.apache.geronimo.st.core.GeronimoConnectionFactory;
 import org.apache.geronimo.st.core.GeronimoServerBehaviourDelegate;
 import org.apache.geronimo.st.core.operations.IGeronimoServerPluginManager;
+import org.apache.geronimo.st.v21.core.Activator;
 import org.apache.geronimo.st.v21.core.internal.Trace;
 import org.apache.geronimo.st.v21.core.plugin.JAXB21PluginUtils;
 import org.apache.geronimo.system.jmx.KernelDelegate;
@@ -100,9 +101,9 @@ public class GeronimoServerV21PluginMana
         } catch (Exception e) {
             e.printStackTrace();
             Trace.trace(Trace.WARNING, "Kernel connection failed. "
-                + e.getMessage());
+                + e.getMessage(), Activator.logOperations);
         }
-        Trace.tracePoint("Constructor", "GeronimoServerPluginManager");
+        Trace.tracePoint("Constructor", Activator.traceOperations, "GeronimoServerPluginManager");
     }
     
     private PluginInstaller getPluginInstaller() {
@@ -114,7 +115,7 @@ public class GeronimoServerV21PluginMana
     }
     
     public List<String> getPluginList () {
-        Trace.tracePoint("Entry", "GeronimoServerPluginManager.getPluginList");
+        Trace.tracePoint("Entry", Activator.traceOperations, "GeronimoServerPluginManager.getPluginList");
 
         String name;
         boolean added;
@@ -142,14 +143,14 @@ public class GeronimoServerV21PluginMana
             }
         }
 
-        Trace.tracePoint("Exit", "GeronimoServerPluginManager.getPluginList", pluginList);
+        Trace.tracePoint("Exit", Activator.traceOperations, "GeronimoServerPluginManager.getPluginList", pluginList);
         return pluginList;
     }
 
     // mimics org.apache.geronimo.console.car.AssemblyViewHandler.actionAfterView
     public void assembleServer (String group, String artifact, String version,
                         String format, String relativeServerPath, int[] selected) {
-        Trace.tracePoint("Entry", "GeronimoServerPluginManager.assembleServer",
+        Trace.tracePoint("Entry", Activator.traceOperations, "GeronimoServerPluginManager.assembleServer",
                 group, artifact, version, format);
 
         PluginListType selectedPlugins = new PluginListType();
@@ -176,12 +177,12 @@ public class GeronimoServerV21PluginMana
         catch (Exception e) {
             e.printStackTrace();
         }
-        Trace.tracePoint("Exit", "GeronimoServerPluginManager.assembleServer");
+        Trace.tracePoint("Exit", Activator.traceOperations, "GeronimoServerPluginManager.assembleServer");
     }
 
     // mimics org.apache.geronimo.console.util.KernelManagementHelper.getConfigurations()
     public List<String> getConfigurationList () {
-        Trace.tracePoint("Entry", "GeronimoServerPluginManager.getConfigurationList");
+        Trace.tracePoint("Entry", Activator.traceOperations, "GeronimoServerPluginManager.getConfigurationList");
 
         ConfigurationManager mgr = getConfigurationManager();
         List<AbstractName> stores = mgr.listStores();
@@ -201,7 +202,7 @@ public class GeronimoServerV21PluginMana
         }
         Collections.sort(results);
 
-        Trace.tracePoint("Entry", "GeronimoServerPluginManager.getConfigurationList", results);
+        Trace.tracePoint("Entry", Activator.traceOperations, "GeronimoServerPluginManager.getConfigurationList", results);
         return results;
     }
 
@@ -216,7 +217,7 @@ public class GeronimoServerV21PluginMana
     // mimics org.apache.geronimo.system.plugin.PluginInstallerGBean.updatePluginMetadata
     // but puts the metadata in our local directory
     public void savePluginXML (String configId, Object pluginMetaData) {
-        Trace.tracePoint("Entry", "GeronimoServerPluginManager.savePluginXML", configId, pluginMetaData);
+        Trace.tracePoint("Entry", Activator.traceOperations, "GeronimoServerPluginManager.savePluginXML", configId, pluginMetaData);
 
         PluginType metadata = (PluginType) pluginMetaData;
         
@@ -257,12 +258,12 @@ public class GeronimoServerV21PluginMana
                 input.close();
                 if (!dir.delete()) {
                     String message = CommonMessages.bind(CommonMessages.errorDeletePlugin, dir.getAbsolutePath());
-                    Trace.tracePoint("Throw", "GeronimoServerPluginManager.savePluginXML", message);
+                    Trace.tracePoint("Throw", Activator.traceOperations, "GeronimoServerPluginManager.savePluginXML", message);
                     throw new Exception(message);
                 }
                 if (!temp.renameTo(dir)) {
                     String message = CommonMessages.bind(CommonMessages.errorMovePlugin, temp.getAbsolutePath(), dir.getAbsolutePath());
-                    Trace.tracePoint("Throw", "GeronimoServerPluginManager.savePluginXML", message);
+                    Trace.tracePoint("Throw", Activator.traceOperations, "GeronimoServerPluginManager.savePluginXML", message);
                     throw new Exception(message);
                 }
             } catch (Exception e) {
@@ -272,7 +273,7 @@ public class GeronimoServerV21PluginMana
             File meta = new File(addFilename(dir.getAbsolutePath(), artifact), "META-INF");
             if (!meta.isDirectory() || !meta.canRead()) {
                 String message = CommonMessages.bind(CommonMessages.badPlugin, artifact);
-                Trace.tracePoint("Throw", "GeronimoServerPluginManager.savePluginXML", message);
+                Trace.tracePoint("Throw", Activator.traceOperations, "GeronimoServerPluginManager.savePluginXML", message);
                 throw new IllegalArgumentException(message);
             }
             File xml = new File(meta, "geronimo-plugin.xml");
@@ -281,7 +282,7 @@ public class GeronimoServerV21PluginMana
                 if (!xml.isFile()) {
                     if (!xml.createNewFile()) {
                         String message = CommonMessages.bind(CommonMessages.errorCreateMetadata, artifact);
-                        Trace.tracePoint("Throw", "GeronimoServerPluginManager.savePluginXML", message);
+                        Trace.tracePoint("Throw", Activator.traceOperations, "GeronimoServerPluginManager.savePluginXML", message);
                         throw new RuntimeException(message);
                     }
                 }
@@ -300,12 +301,12 @@ public class GeronimoServerV21PluginMana
             }
         }
 
-        Trace.tracePoint("Exit", "GeronimoServerPluginManager.savePluginXML");
+        Trace.tracePoint("Exit", Activator.traceOperations, "GeronimoServerPluginManager.savePluginXML");
     }
 
     // mimics org.apache.geronimo.system.configuration.RepositoryConfigurationStore.exportConfiguration
     public void exportCAR (String localRepoDir, String configId) throws Exception {
-        Trace.tracePoint("Entry", "GeronimoServerPluginManager.exportCAR", localRepoDir, configId);
+        Trace.tracePoint("Entry", Activator.traceOperations, "GeronimoServerPluginManager.exportCAR", localRepoDir, configId);
 
         Artifact artifact = Artifact.create(configId);
         String filename = createDirectoryStructure (localRepoDir, artifact);
@@ -314,11 +315,11 @@ public class GeronimoServerV21PluginMana
         File serverArtifact = new File(getArtifactLocation (artifact));
         writeToDirectory(serverArtifact, outputDir);
 
-        Trace.tracePoint("Exit", "GeronimoServerPluginManager.exportCAR");
+        Trace.tracePoint("Exit", Activator.traceOperations, "GeronimoServerPluginManager.exportCAR");
     }
 
     private void writeToDirectory(File inputDir, File outputDir) throws Exception {
-        Trace.tracePoint("Entry", "GeronimoServerPluginManager.writeToZip", inputDir);
+        Trace.tracePoint("Entry", Activator.traceOperations, "GeronimoServerPluginManager.writeToZip", inputDir);
 
         outputDir.mkdirs();
         File[] all = inputDir.listFiles();
@@ -344,11 +345,11 @@ public class GeronimoServerV21PluginMana
                 }
             }
         }
-        Trace.tracePoint("Exit", "GeronimoServerPluginManager.writeToZip");
+        Trace.tracePoint("Exit", Activator.traceOperations, "GeronimoServerPluginManager.writeToZip");
     }
 
     public void updatePluginList (String localRepoDir, Object data) throws Exception {
-        Trace.tracePoint("Entry", "GeronimoServerPluginManager.updatePluginList", localRepoDir, data);
+        Trace.tracePoint("Entry", Activator.traceOperations, "GeronimoServerPluginManager.updatePluginList", localRepoDir, data);
 
         PluginType metadata = (PluginType) data;
         
@@ -385,11 +386,11 @@ public class GeronimoServerV21PluginMana
                 }
             }
         }
-        Trace.tracePoint("Exit", "GeronimoServerPluginManager.updatePluginList");
+        Trace.tracePoint("Exit", Activator.traceOperations, "GeronimoServerPluginManager.updatePluginList");
     }
 
     public PluginListType readPluginList (String localRepoDir) {
-        Trace.tracePoint("Entry", "GeronimoServerPluginManager.readPluginList", localRepoDir);
+        Trace.tracePoint("Entry", Activator.traceOperations, "GeronimoServerPluginManager.readPluginList", localRepoDir);
 
         PluginListType pluginList = null;
         File listFile = new File (localRepoDir, "geronimo-plugins.xml");
@@ -413,7 +414,7 @@ public class GeronimoServerV21PluginMana
             pluginList = factory.createPluginListType();
         }
 
-        Trace.tracePoint("Exit", "GeronimoServerPluginManager.readPluginList", pluginList);
+        Trace.tracePoint("Exit", Activator.traceOperations, "GeronimoServerPluginManager.readPluginList", pluginList);
         return pluginList;
     }
 
@@ -492,14 +493,14 @@ public class GeronimoServerV21PluginMana
     }
 
     private ConfigurationManager getConfigurationManager () {
-        Trace.tracePoint("Entry", "GeronimoServerPluginManager.getConfigurationManager");
+        Trace.tracePoint("Entry", Activator.traceOperations, "GeronimoServerPluginManager.getConfigurationManager");
 
         if (kernel != null) {
-            Trace.tracePoint("Exit", "GeronimoServerPluginManager.getConfigurationManager");
+            Trace.tracePoint("Exit", Activator.traceOperations, "GeronimoServerPluginManager.getConfigurationManager");
             return ConfigurationUtil.getEditableConfigurationManager(kernel);
         }
 
-        Trace.tracePoint("Exit", "GeronimoServerPluginManager.getConfigurationManager returns null");
+        Trace.tracePoint("Exit", Activator.traceOperations, "GeronimoServerPluginManager.getConfigurationManager returns null");
         return null;
     }
 
@@ -559,7 +560,7 @@ public class GeronimoServerV21PluginMana
     }
 
     public boolean validatePlugin (Object pluginObject) {
-        Trace.tracePoint("Entry", "GeronimoServerPluginManager.validatePlugin", pluginObject);
+        Trace.tracePoint("Entry", Activator.traceOperations, "GeronimoServerPluginManager.validatePlugin", pluginObject);
         
         PluginType plugin = (PluginType) pluginObject;
         
@@ -577,7 +578,7 @@ public class GeronimoServerV21PluginMana
     // mimics org.apache.geronimo.system.plugin.PluginInstallerGbean.install
     // but uses our local directory to get the plugins
     public ArrayList<String> installPlugins (String localRepoDir, List plugins) {
-        Trace.tracePoint("Entry", "GeronimoServerPluginManager.installPlugins", localRepoDir, pluginList);
+        Trace.tracePoint("Entry", Activator.traceOperations, "GeronimoServerPluginManager.installPlugins", localRepoDir, pluginList);
         ArrayList<String> eventLog = new ArrayList<String>();
         List<PluginType> pluginList = (List<PluginType>)plugins;
 
@@ -650,13 +651,13 @@ public class GeronimoServerV21PluginMana
             e.printStackTrace();
         }
 
-        Trace.tracePoint("Exit", "GeronimoServerPluginManager.installPlugins", eventLog.toString());
+        Trace.tracePoint("Exit", Activator.traceOperations, "GeronimoServerPluginManager.installPlugins", eventLog.toString());
         return eventLog;
     }
 
     // mimics org.apache.geronimo.system.plugin.PluginInstallerGbean.verifyPrerequisistes
     private void verifyPrerequisites(PluginType plugin) throws Exception {
-        Trace.tracePoint("Exit", "GeronimoServerPluginManager.verifyPrerequisites", plugin);
+        Trace.tracePoint("Exit", Activator.traceOperations, "GeronimoServerPluginManager.verifyPrerequisites", plugin);
         List<Dependency> missingPrereqs = getMissingPrerequisites(plugin);
         if (!missingPrereqs.isEmpty()) {
             PluginArtifactType metadata = plugin.getPluginArtifact().get(0);
@@ -671,20 +672,20 @@ public class GeronimoServerV21PluginMana
                 }
             }
             buf.append(CommonMessages.installed);
-            Trace.tracePoint("Throw", "GeronimoServerPluginManager.verifyPrerequisites", buf.toString());
+            Trace.tracePoint("Throw", Activator.traceOperations, "GeronimoServerPluginManager.verifyPrerequisites", buf.toString());
             throw new Exception(buf.toString());
         }
 
-        Trace.tracePoint("Exit", "GeronimoServerPluginManager.verifyPrerequisites");
+        Trace.tracePoint("Exit", Activator.traceOperations, "GeronimoServerPluginManager.verifyPrerequisites");
     }
 
     // mimics org.apache.geronimo.system.plugin.PluginInstallerGbean.getMissingPrerequisistes
     private List<Dependency> getMissingPrerequisites(PluginType plugin) {
-        Trace.tracePoint("Entry", "GeronimoServerPluginManager.getMissingPrerequisites", plugin);
+        Trace.tracePoint("Entry", Activator.traceOperations, "GeronimoServerPluginManager.getMissingPrerequisites", plugin);
 
         if (plugin.getPluginArtifact().size() != 1) {
             String message = CommonMessages.bind(CommonMessages.configSizeMismatch, plugin.getPluginArtifact().size());
-            Trace.tracePoint("Throw", "GeronimoServerPluginManager.getMissingPrerequisites", message);
+            Trace.tracePoint("Throw", Activator.traceOperations, "GeronimoServerPluginManager.getMissingPrerequisites", message);
             throw new IllegalArgumentException(message);
         }
 
@@ -699,18 +700,18 @@ public class GeronimoServerV21PluginMana
                     missingPrereqs.add(new Dependency(artifact, ImportType.ALL));
                 }
             } catch (Exception e) {
-                Trace.tracePoint("Throw", "GeronimoServerPluginManager.getMissingPrerequisites", CommonMessages.noDefaultServer);
+                Trace.tracePoint("Throw", Activator.traceOperations, "GeronimoServerPluginManager.getMissingPrerequisites", CommonMessages.noDefaultServer);
                 throw new RuntimeException(CommonMessages.noDefaultServer);
             }
         }
 
-        Trace.tracePoint("Exit", "GeronimoServerPluginManager.getMissingPrerequisites", missingPrereqs);
+        Trace.tracePoint("Exit", Activator.traceOperations, "GeronimoServerPluginManager.getMissingPrerequisites", missingPrereqs);
         return missingPrereqs;
     }
     
     //Extract the car file
     private void writeToRepository(File inputDir, File outputDir) throws Exception {
-        Trace.tracePoint("Entry", "GeronimoServerPluginManager.writeToRepository", inputDir,outputDir);
+        Trace.tracePoint("Entry", Activator.traceOperations, "GeronimoServerPluginManager.writeToRepository", inputDir,outputDir);
 
         outputDir.mkdirs();
         File[] all = inputDir.listFiles();
@@ -770,7 +771,7 @@ public class GeronimoServerV21PluginMana
                 }
             }
         }
-        Trace.tracePoint("Exit", "GeronimoServerPluginManager.writeToRepository");
+        Trace.tracePoint("Exit", Activator.traceOperations, "GeronimoServerPluginManager.writeToRepository");
     }
 
 }



Mime
View raw message