You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by ha...@apache.org on 2011/05/25 10:16:31 UTC
svn commit: r1127422 [2/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...
Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/GeronimoServerBehaviourDelegate.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/GeronimoServerBehaviourDelegate.java?rev=1127422&r1=1127421&r2=1127422&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/GeronimoServerBehaviourDelegate.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/GeronimoServerBehaviourDelegate.java Wed May 25 08:16:27 2011
@@ -156,7 +156,7 @@ abstract public class GeronimoServerBeha
* @throws CoreException
*/
synchronized protected void setupLaunch(ILaunch launch, String launchMode, IProgressMonitor monitor) throws CoreException {
- Trace.tracePoint("Entry", "GeronimoServerBehaviourDelegate.setupLaunch", launch, launchMode, monitor);
+ Trace.tracePoint("Entry", Activator.traceCore, "GeronimoServerBehaviourDelegate.setupLaunch", launch, launchMode, monitor);
if (!SocketUtil.isLocalhost(getServer().getHost()))
return;
@@ -188,7 +188,7 @@ abstract public class GeronimoServerBeha
getServer().addServerListener(listener);
- Trace.tracePoint("Exit ", "GeronimoServerBehaviourDelegate.setupLaunch");
+ Trace.tracePoint("Exit ", Activator.traceCore, "GeronimoServerBehaviourDelegate.setupLaunch");
}
/*
@@ -215,7 +215,7 @@ abstract public class GeronimoServerBeha
if (state == IServer.STATE_STARTING || state == IServer.STATE_STOPPING)
terminate();
- Trace.tracePoint("Exit ", "GeronimoServerBehaviourDelegate.stop");
+ Trace.tracePoint("Exit ", Activator.traceCore, "GeronimoServerBehaviourDelegate.stop");
}
/*
@@ -228,7 +228,7 @@ abstract public class GeronimoServerBeha
* @see org.eclipse.wst.server.core.model.ServerBehaviourDelegate#publishModules(int, java.util.List, java.util.List, org.eclipse.core.runtime.MultiStatus, org.eclipse.core.runtime.IProgressMonitor)
*/
protected void publishModules(int kind, List modules, List deltaKind, MultiStatus multi, IProgressMonitor monitor) {
- Trace.tracePoint("Entry", "GeronimoServerBehaviourDelegate.publishModules", deltaKindToString(kind), Arrays.asList(modules).toString(), Arrays.asList(deltaKind).toString(), multi, monitor);
+ Trace.tracePoint("Entry", Activator.traceCore, "GeronimoServerBehaviourDelegate.publishModules", deltaKindToString(kind), Arrays.asList(modules).toString(), Arrays.asList(deltaKind).toString(), multi, monitor);
//
// WTP publishes modules in reverse alphabetical order which does not account for possible
@@ -279,14 +279,14 @@ abstract public class GeronimoServerBeha
}
} else {
setModulePublishState(module, IServer.PUBLISH_STATE_NONE);
- Trace.trace(Trace.INFO, "root module for " + Arrays.asList(module).toString() + " already published. Skipping.");
+ Trace.trace(Trace.INFO, "root module for " + Arrays.asList(module).toString() + " already published. Skipping.", Activator.traceCore);
}
}
} else {
multi.add(status);
}
- Trace.tracePoint("Exit ", "GeronimoServerBehaviourDelegate.publishModules");
+ Trace.tracePoint("Exit ", Activator.traceCore, "GeronimoServerBehaviourDelegate.publishModules");
}
/*
@@ -303,7 +303,7 @@ abstract public class GeronimoServerBeha
* org.eclipse.core.runtime.IProgressMonitor)
*/
public void publishModule(int kind, int deltaKind, IModule[] module, IProgressMonitor monitor) throws CoreException {
- Trace.tracePoint("Entry", "GeronimoServerBehaviourDelegate.publishModule", deltaKindToString(kind), deltaKindToString(deltaKind), Arrays.asList(module).toString(), monitor);
+ Trace.tracePoint("Entry", Activator.traceCore, "GeronimoServerBehaviourDelegate.publishModule", deltaKindToString(kind), deltaKindToString(deltaKind), Arrays.asList(module).toString(), monitor);
_monitor = monitor;
@@ -338,7 +338,7 @@ abstract public class GeronimoServerBeha
* @see org.eclipse.wst.server.core.model.ServerBehaviourDelegate#publishFinish(org.eclipse.core.runtime.IProgressMonitor)
*/
public void publishFinish(IProgressMonitor monitor) throws CoreException {
- Trace.tracePoint("Entry", "GeronimoServerBehaviourDelegate.publishFinish", monitor);
+ Trace.tracePoint("Entry", Activator.traceCore, "GeronimoServerBehaviourDelegate.publishFinish", monitor);
IModule[] modules = this.getServer().getModules();
boolean allpublished = true;
@@ -351,7 +351,7 @@ abstract public class GeronimoServerBeha
GeronimoConnectionFactory.getInstance().destroy(getServer());
- Trace.tracePoint("Exit ", "GeronimoServerBehaviourDelegate.publishFinish");
+ Trace.tracePoint("Exit ", Activator.traceCore, "GeronimoServerBehaviourDelegate.publishFinish");
}
@@ -364,8 +364,8 @@ abstract public class GeronimoServerBeha
* are not desired
*/
protected void initialize(IProgressMonitor monitor) {
- Trace.tracePoint("Entry", "GeronimoServerBehaviourDelegate.initialize", monitor);
- Trace.tracePoint("Exit ", "GeronimoServerBehaviourDelegate.initialize");
+ Trace.tracePoint("Entry", Activator.traceCore, "GeronimoServerBehaviourDelegate.initialize", monitor);
+ Trace.tracePoint("Exit ", Activator.traceCore, "GeronimoServerBehaviourDelegate.initialize");
}
@@ -394,28 +394,28 @@ abstract public class GeronimoServerBeha
protected void terminate() {
- Trace.tracePoint("Entry", "GeronimoServerBehaviourDelegate.terminate");
+ Trace.tracePoint("Entry", Activator.traceCore, "GeronimoServerBehaviourDelegate.terminate");
if (getServer().getServerState() == IServer.STATE_STOPPED)
return;
try {
setServerState(IServer.STATE_STOPPING);
- Trace.trace(Trace.INFO, "Killing the geronimo server process"); //$NON-NLS-1$
+ Trace.trace(Trace.INFO, "Killing the geronimo server process", Activator.traceCore); //$NON-NLS-1$
if (process != null && !process.isTerminated()) {
process.terminate();
}
stopImpl();
} catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error killing the geronimo server process", e); //$NON-NLS-1$
+ Trace.trace(Trace.ERROR, "Error killing the geronimo server process", e, Activator.logCore); //$NON-NLS-1$
//
// WTP does not allow a CoreException to be thrown in this case
//
throw new RuntimeException(Messages.STOP_FAIL);
}
- Trace.tracePoint("Exit ", "GeronimoServerBehaviourDelegate.terminate");
+ Trace.tracePoint("Exit ", Activator.traceCore, "GeronimoServerBehaviourDelegate.terminate");
}
@@ -429,7 +429,7 @@ abstract public class GeronimoServerBeha
}
protected void invokeCommand(int deltaKind, IModule module) throws CoreException {
- Trace.tracePoint("Entry", "GeronimoServerBehaviourDelegate.invokeCommand", deltaKindToString(deltaKind), module.getName());
+ Trace.tracePoint("Entry", Activator.traceCore, "GeronimoServerBehaviourDelegate.invokeCommand", deltaKindToString(deltaKind), module.getName());
ClassLoader old = Thread.currentThread().getContextClassLoader();
try {
@@ -464,7 +464,7 @@ abstract public class GeronimoServerBeha
Thread.currentThread().setContextClassLoader(old);
}
- Trace.tracePoint("Exit ", "GeronimoServerBehaviourDelegate.invokeCommand");
+ Trace.tracePoint("Exit ", Activator.traceCore, "GeronimoServerBehaviourDelegate.invokeCommand");
}
/**
@@ -473,7 +473,7 @@ abstract public class GeronimoServerBeha
* @throws Exception
*/
protected void doAdded(IModule module, String configId) throws Exception {
- Trace.tracePoint("Entry", "GeronimoServerBehaviourDelegate.doAdded", module.getName(), configId);
+ Trace.tracePoint("Entry", Activator.traceCore, "GeronimoServerBehaviourDelegate.doAdded", module.getName(), configId);
configId = getLastKnowConfigurationId(module, configId);
if (configId == null) {
@@ -495,7 +495,7 @@ abstract public class GeronimoServerBeha
doChanged(module, configId);
}
- Trace.tracePoint("Exit ", "GeronimoServerBehaviourDelegate.doAdded");
+ Trace.tracePoint("Exit ", Activator.traceCore, "GeronimoServerBehaviourDelegate.doAdded");
}
/**
@@ -504,7 +504,7 @@ abstract public class GeronimoServerBeha
* @throws Exception
*/
protected void doChanged(IModule module, String configId) throws Exception {
- Trace.tracePoint("Entry", "GeronimoServerBehaviourDelegate.doChanged", module.getName(), configId);
+ Trace.tracePoint("Entry", Activator.traceCore, "GeronimoServerBehaviourDelegate.doChanged", module.getName(), configId);
configId = getLastKnowConfigurationId(module, configId);
if(configId != null) {
@@ -532,7 +532,7 @@ abstract public class GeronimoServerBeha
doAdded(module, configId);
}
- Trace.tracePoint("Exit ", "GeronimoServerBehaviourDelegate.doChanged");
+ Trace.tracePoint("Exit ", Activator.traceCore, "GeronimoServerBehaviourDelegate.doChanged");
}
@@ -598,8 +598,8 @@ abstract public class GeronimoServerBeha
try {
file.createNewFile();
} catch (IOException e) {
- Trace.trace(Trace.SEVERE, "can't create file "
- + file, e);
+ Trace.trace(Trace.ERROR, "can't create file "
+ + file, e, Activator.logCore);
throw new CoreException(new Status(IStatus.ERROR,
Activator.PLUGIN_ID, "can't create file "
+ file, e));
@@ -627,14 +627,14 @@ abstract public class GeronimoServerBeha
inChannel.close();
outChannel.close();
} catch (FileNotFoundException e) {
- Trace.trace(Trace.SEVERE, "can't find file "
- + sourceFile, e);
+ Trace.trace(Trace.ERROR, "can't find file "
+ + sourceFile, e, Activator.logCore);
throw new CoreException(new Status(IStatus.ERROR,
Activator.PLUGIN_ID, "can't find file "
+ sourceFile, e));
} catch (IOException e) {
- Trace.trace(Trace.SEVERE, "can't copy file "
- + sourceFile, e);
+ Trace.trace(Trace.ERROR, "can't copy file "
+ + sourceFile, e, Activator.logCore);
throw new CoreException(new Status(IStatus.ERROR,
Activator.PLUGIN_ID, "can't copy file "
+ sourceFile, e));
@@ -649,17 +649,17 @@ abstract public class GeronimoServerBeha
private String getLastKnowConfigurationId(IModule module, String configId) throws Exception {
- Trace.tracePoint("Entry ", "GeronimoServerBehaviourDelegate.getLastKnowConfigurationId", module.getName(), configId);
+ Trace.tracePoint("Entry ", Activator.traceCore, "GeronimoServerBehaviourDelegate.getLastKnowConfigurationId", module.getName(), configId);
//use the correct configId, second from the .metadata, then from the plan
configId = configId != null ? configId : DeploymentUtils.getLastKnownConfigurationId(module, getServer());
- Trace.tracePoint("Exit ", "GeronimoServerBehaviourDelegate.getLastKnowConfigurationId", configId);
+ Trace.tracePoint("Exit ", Activator.traceCore, "GeronimoServerBehaviourDelegate.getLastKnowConfigurationId", configId);
return configId;
}
protected void doRemoved(IModule module) throws Exception {
- Trace.tracePoint("Entry", "GeronimoServerBehaviourDelegate.doRemoved", module.getName());
+ Trace.tracePoint("Entry", Activator.traceCore, "GeronimoServerBehaviourDelegate.doRemoved", module.getName());
IStatus status = unDeploy(module);
if (!status.isOK()) {
@@ -668,11 +668,11 @@ abstract public class GeronimoServerBeha
ModuleArtifactMapper.getInstance().removeEntry(getServer(), module.getProject());
- Trace.tracePoint("Exit ", "GeronimoServerBehaviourDelegate.doRemoved");
+ Trace.tracePoint("Exit ", Activator.traceCore, "GeronimoServerBehaviourDelegate.doRemoved");
}
protected void doNoChange(IModule module) throws Exception {
- Trace.tracePoint("Entry", "GeronimoServerBehaviourDelegate.doNoChange", module.getName());
+ Trace.tracePoint("Entry", Activator.traceCore, "GeronimoServerBehaviourDelegate.doNoChange", module.getName());
if(DeploymentUtils.getLastKnownConfigurationId(module, getServer()) != null) {
start(module);
@@ -680,11 +680,11 @@ abstract public class GeronimoServerBeha
doAdded(module, null);
}
- Trace.tracePoint("Exit ", "GeronimoServerBehaviourDelegate.doNoChange");
+ Trace.tracePoint("Exit ", Activator.traceCore, "GeronimoServerBehaviourDelegate.doNoChange");
}
protected void doRestart(IModule module) throws Exception {
- Trace.tracePoint("Entry", "GeronimoServerBehaviourDelegate.doRestart", module.getName());
+ Trace.tracePoint("Entry", Activator.traceCore, "GeronimoServerBehaviourDelegate.doRestart", module.getName());
IStatus status = stop(module);
if (!status.isOK()) {
@@ -696,7 +696,7 @@ abstract public class GeronimoServerBeha
doFail(status, Messages.START_FAIL);
}
- Trace.tracePoint("Exit ", "GeronimoServerBehaviourDelegate.doRestart");
+ Trace.tracePoint("Exit ", Activator.traceCore, "GeronimoServerBehaviourDelegate.doRestart");
}
private TargetModuleID[] updateServerModuleConfigIDMap(IModule module, IStatus status) {
@@ -788,7 +788,7 @@ abstract public class GeronimoServerBeha
IRuntimeClasspathEntry[] existingCps = JavaRuntime.computeUnresolvedRuntimeClasspath(wc);
for (int i = 0; i < existingCps.length; i++) {
- Trace.trace(Trace.INFO, "cpentry: " + cp );
+ Trace.trace(Trace.INFO, "cpentry: " + cp , Activator.traceCore);
if (cp.contains(existingCps[i]) == false) {
cp.add(existingCps[i]);
}
@@ -803,7 +803,7 @@ abstract public class GeronimoServerBeha
List<IClasspathEntry> cpes = ClasspathContainersHelper.queryWorkspace( containerPath );
for ( IClasspathEntry cpe : cpes ) {
RuntimeClasspathEntry rcpe = new RuntimeClasspathEntry( cpe );
- Trace.trace(Trace.INFO, "Classpath Container Entry: " + rcpe );
+ Trace.trace(Trace.INFO, "Classpath Container Entry: " + rcpe, Activator.traceCore );
if (cp.contains(rcpe) == false) {
cp.add( rcpe );
}
@@ -823,8 +823,8 @@ abstract public class GeronimoServerBeha
try {
list.add(entry.getMemento());
} catch (CoreException e) {
- Trace.trace(Trace.SEVERE, "Could not resolve classpath entry: "
- + entry, e);
+ Trace.trace(Trace.ERROR, "Could not resolve classpath entry: "
+ + entry, e, Activator.logCore);
}
}
return list;
@@ -859,47 +859,47 @@ abstract public class GeronimoServerBeha
}
protected void startPingThread() {
- Trace.tracePoint("Entry", "GeronimoServerBehaviourDelegate.startPingThread");
+ Trace.tracePoint("Entry", Activator.traceCore, "GeronimoServerBehaviourDelegate.startPingThread");
pingThread = new PingThread(this, getServer());
pingThread.start();
- Trace.tracePoint("Exit ", "GeronimoServerBehaviourDelegate.startPingThread");
+ Trace.tracePoint("Exit ", Activator.traceCore, "GeronimoServerBehaviourDelegate.startPingThread");
}
protected void stopPingThread() {
- Trace.tracePoint("Entry", "GeronimoServerBehaviourDelegate.stopPingThread");
+ Trace.tracePoint("Entry", Activator.traceCore, "GeronimoServerBehaviourDelegate.stopPingThread");
if (pingThread != null) {
pingThread.interrupt();
pingThread = null;
}
- Trace.tracePoint("Exit ", "GeronimoServerBehaviourDelegate.stopPingThread");
+ Trace.tracePoint("Exit ", Activator.traceCore, "GeronimoServerBehaviourDelegate.stopPingThread");
}
protected abstract void stopKernel();
public void startUpdateServerStateTask() {
- Trace.tracePoint("Entry", "GeronimoServerBehaviourDelegate.startUpdateServerStateTask", getServer().getName());
+ Trace.tracePoint("Entry", Activator.traceCore, "GeronimoServerBehaviourDelegate.startUpdateServerStateTask", getServer().getName());
timer = new Timer(true);
timer.schedule(new UpdateServerStateTask(this, getServer()), TIMER_TASK_DELAY * 1000, TIMER_TASK_INTERVAL * 1000);
- Trace.tracePoint("Exit ", "GeronimoServerBehaviourDelegate.startUpdateServerStateTask");
+ Trace.tracePoint("Exit ", Activator.traceCore, "GeronimoServerBehaviourDelegate.startUpdateServerStateTask");
}
public void stopUpdateServerStateTask() {
- Trace.tracePoint("Entry", "GeronimoServerBehaviourDelegate.stopUpdateServerStateTask");
+ Trace.tracePoint("Entry", Activator.traceCore, "GeronimoServerBehaviourDelegate.stopUpdateServerStateTask");
if (timer != null)
timer.cancel();
- Trace.tracePoint("Exit ", "GeronimoServerBehaviourDelegate.stopUpdateServerStateTask");
+ Trace.tracePoint("Exit ", Activator.traceCore, "GeronimoServerBehaviourDelegate.stopUpdateServerStateTask");
}
protected IPath getModulePath(IModule[] module, URL baseURL) {
- Trace.tracePoint("Entry", "GeronimoServerBehaviourDelegate.getModulePath", Arrays.asList(module).toString(), baseURL);
+ Trace.tracePoint("Entry", Activator.traceCore, "GeronimoServerBehaviourDelegate.getModulePath", Arrays.asList(module).toString(), baseURL);
IPath modulePath = new Path(baseURL.getFile());
@@ -919,7 +919,7 @@ abstract public class GeronimoServerBeha
}
}
- Trace.tracePoint("Exit ", "GeronimoServerBehaviourDelegate.getModulePath", modulePath);
+ Trace.tracePoint("Exit ", Activator.traceCore, "GeronimoServerBehaviourDelegate.getModulePath", modulePath);
return modulePath;
}
@@ -947,7 +947,7 @@ abstract public class GeronimoServerBeha
jmxConnector = JMXConnectorFactory.connect(address, map);
}
MBeanServerConnection connection = jmxConnector.getMBeanServerConnection();
- Trace.trace(Trace.INFO, "Connected to kernel. " + url);
+ Trace.trace(Trace.INFO, "Connected to kernel. " + url, Activator.traceCore);
return connection;
} catch (MalformedURLException e) {
e.printStackTrace();
Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/GeronimoServerDelegate.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/GeronimoServerDelegate.java?rev=1127422&r1=1127421&r2=1127422&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/GeronimoServerDelegate.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/GeronimoServerDelegate.java Wed May 25 08:16:27 2011
@@ -27,6 +27,7 @@ import java.util.jar.JarFile;
import java.util.jar.Manifest;
import org.apache.geronimo.st.core.internal.Trace;
+import org.apache.geronimo.st.core.Activator;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -237,7 +238,7 @@ abstract public class GeronimoServerDele
return new URL(url);
} catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not get root URL", e);
+ Trace.trace(Trace.ERROR, "Could not get root URL", e, Activator.logCore);
return null;
}
@@ -392,6 +393,7 @@ abstract public class GeronimoServerDele
* @see org.eclipse.wst.server.core.model.ServerDelegate#setDefaults(org.eclipse.core.runtime.IProgressMonitor)
*/
public void setDefaults(IProgressMonitor monitor) {
+ Trace.tracePoint("Entry", Activator.traceCore, "GeronimoServerDelegate.setDefaults", monitor);
setAdminID("system");
setAdminPassword("manager");
setHTTPPort("8080");
@@ -404,6 +406,7 @@ abstract public class GeronimoServerDele
setInPlaceSharedLib(false);
setRunFromWorkspace(false);
setSelectClasspathContainers(false);
+ Trace.tracePoint("Exit", Activator.traceCore, "GeronimoServerDelegate.setDefaults", monitor);
}
public String getInstanceProperty(String name) {
Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/GeronimoSourcePathComputerDelegate.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/GeronimoSourcePathComputerDelegate.java?rev=1127422&r1=1127421&r2=1127422&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/GeronimoSourcePathComputerDelegate.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/GeronimoSourcePathComputerDelegate.java Wed May 25 08:16:27 2011
@@ -61,7 +61,7 @@ public class GeronimoSourcePathComputerD
* org.eclipse.core.runtime.IProgressMonitor)
*/
public ISourceContainer[] computeSourceContainers(ILaunchConfiguration configuration, IProgressMonitor monitor) throws CoreException {
- Trace.trace(Trace.INFO, ">> GeronimoSourcePathComputerDelegate.computeSourceContainers()");
+ Trace.trace(Trace.INFO, ">> GeronimoSourcePathComputerDelegate.computeSourceContainers()", Activator.traceCore);
IServer server = ServerUtil.getServer(configuration);
IModule[] modules = server.getModules();
@@ -88,20 +88,20 @@ public class GeronimoSourcePathComputerD
HashSet allContainers = new HashSet(Arrays.asList(defaultContainers));
Iterator i = getAdditionalSrcPathComputers().iterator();
ILaunchManager mgr = DebugPlugin.getDefault().getLaunchManager();
- Trace.trace(Trace.INFO, "Total # of unique source containers: " + allContainers.size());
+ Trace.trace(Trace.INFO, "Total # of unique source containers: " + allContainers.size(), Activator.traceCore);
while(i.hasNext()) {
ISourcePathComputer computer = mgr.getSourcePathComputer((String) i.next());
- Trace.trace(Trace.INFO, "Invoking Source Path Computer " + computer.getId());
+ Trace.trace(Trace.INFO, "Invoking Source Path Computer " + computer.getId(), Activator.traceCore);
ISourceContainer[] jsc = computer.computeSourceContainers(configuration, monitor);
if(jsc != null) {
- Trace.trace(Trace.INFO, "Additional Source Containers returned ...");
+ Trace.trace(Trace.INFO, "Additional Source Containers returned ...", Activator.traceCore);
for(int j = 0; j < jsc.length; j++) {
String name = jsc[j].getName();
- Trace.trace(Trace.INFO, "name = " + name);
+ Trace.trace(Trace.INFO, "name = " + name, Activator.traceCore);
}
}
allContainers.addAll(Arrays.asList(jsc));
- Trace.trace(Trace.INFO, "Number # of unique source containers: " + allContainers.size());
+ Trace.trace(Trace.INFO, "Number # of unique source containers: " + allContainers.size(), Activator.traceCore);
}
//add source container for Geroniom Runtime
@@ -174,7 +174,7 @@ public class GeronimoSourcePathComputerD
IConfigurationElement[] extensions = extensionPoint.getConfigurationElements();
for (int i = 0; i < extensions.length; i++) {
String id = extensions[i].getAttribute("id");
- Trace.trace(Trace.INFO, "Found extension point " + id);
+ Trace.trace(Trace.INFO, "Found extension point " + id, Activator.traceCore);
additionalSrcPathComputerIds.add(id);
}
}
Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/GeronimoUtils.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/GeronimoUtils.java?rev=1127422&r1=1127421&r2=1127422&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/GeronimoUtils.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/GeronimoUtils.java Wed May 25 08:16:27 2011
@@ -79,7 +79,7 @@ public class GeronimoUtils {
} else if (isRARModule(module)) {
return ModuleType.RAR;
} else {
- Trace.trace(Trace.SEVERE, "getJSR88ModuleType = null");
+ Trace.trace(Trace.ERROR, "getJSR88ModuleType = null", Activator.logCore);
return null;
}
}
Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/PingThread.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/PingThread.java?rev=1127422&r1=1127421&r2=1127422&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/PingThread.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/PingThread.java Wed May 25 08:16:27 2011
@@ -73,7 +73,7 @@ public class PingThread extends Thread {
ClassLoader cl = ((GeronimoServerBehaviourDelegate) geronimoServer).getContextClassLoader();
Thread.currentThread().setContextClassLoader(cl);
if (geronimoServer.isFullyStarted()) {
- Trace.trace(Trace.INFO, "Ping: success");
+ Trace.trace(Trace.INFO, "Ping: success", Activator.traceCore);
geronimoServer.setServerStarted();
return;
}
@@ -81,7 +81,7 @@ public class PingThread extends Thread {
Thread.currentThread().setContextClassLoader(old);
}
- Trace.trace(Trace.INFO, "Ping: fail");
+ Trace.trace(Trace.INFO, "Ping: fail", Activator.traceCore);
try {
sleep(pingInterval);
@@ -91,7 +91,7 @@ public class PingThread extends Thread {
}
//don't need to show this message to user, since wst Server will show the timeout message to user
- Trace.trace(Trace.SEVERE, "Ping: Can't ping for server startup.");
+ Trace.trace(Trace.ERROR, "Ping: Can't ping for server startup.", Activator.traceCore);
server.stop(false);
}
Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/UpdateServerStateTask.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/UpdateServerStateTask.java?rev=1127422&r1=1127421&r2=1127422&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/UpdateServerStateTask.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/UpdateServerStateTask.java Wed May 25 08:16:27 2011
@@ -66,7 +66,8 @@ public class UpdateServerStateTask exten
if (gs != null && !this.server.getId().equals(server.getId())) {
if (isSameConnectionURL(gs, thisServer)) {
if (!isSameRuntimeLocation(server) && server.getServerState() != IServer.STATE_STOPPED) {
- Trace.trace(Trace.WARNING, server.getId() + " Cannot update server state. URL conflict between multiple servers.");
+ Trace.trace(Trace.WARNING, server.getId() + " Cannot update server state. " +
+ " URL conflict between multiple servers.", Activator.logCore);
return false;
}
}
@@ -85,7 +86,7 @@ public class UpdateServerStateTask exten
}
private void updateServerState() {
- Trace.trace(Trace.INFO, ">> " + server.getId() + " Updating Server State.");
+ Trace.trace(Trace.INFO, ">> " + server.getId() + " Updating Server State.", Activator.traceCore);
try {
switch (server.getServerState()) {
case IServer.STATE_STOPPED:
@@ -105,7 +106,7 @@ public class UpdateServerStateTask exten
} catch (Exception e) {
e.printStackTrace();
}
- Trace.trace(Trace.INFO, "<< " + server.getId() + " Updating Server State.");
+ Trace.trace(Trace.INFO, "<< " + server.getId() + " Updating Server State.", Activator.traceCore);
}
private void updateFromStopped() throws CoreException {
Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/commands/DeployCommand.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/commands/DeployCommand.java?rev=1127422&r1=1127421&r2=1127422&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/commands/DeployCommand.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/commands/DeployCommand.java Wed May 25 08:16:27 2011
@@ -18,6 +18,7 @@ package org.apache.geronimo.st.core.comm
import java.io.File;
+import org.apache.geronimo.st.core.Activator;
import org.apache.geronimo.st.core.DeploymentUtils;
import org.apache.geronimo.st.core.IGeronimoServer;
import org.apache.geronimo.st.core.internal.Trace;
@@ -49,7 +50,7 @@ abstract public class DeployCommand exte
outputDir.toFile().mkdirs();
file = DeploymentUtils.createJarFile(getModule(), outputDir);
}
- Trace.trace(Trace.INFO, "File: " + file.getAbsolutePath());
+ Trace.trace(Trace.INFO, "File: " + file.getAbsolutePath(), Activator.traceCommands);
return file;
}
Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/commands/DistributeCommand.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/commands/DistributeCommand.java?rev=1127422&r1=1127421&r2=1127422&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/commands/DistributeCommand.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/commands/DistributeCommand.java Wed May 25 08:16:27 2011
@@ -22,6 +22,7 @@ import javax.enterprise.deploy.shared.Co
import javax.enterprise.deploy.spi.DeploymentManager;
import javax.enterprise.deploy.spi.Target;
+import org.apache.geronimo.st.core.Activator;
import org.apache.geronimo.st.core.internal.Trace;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -54,9 +55,9 @@ class DistributeCommand extends DeployCo
if (targets == null)
targets = dm.getTargets();
- Trace.trace(Trace.INFO, "Available targets: ");
+ Trace.trace(Trace.INFO, "Available targets: ", Activator.traceCommands);
for ( int ii=0; ii<targets.length; ii++ ) {
- Trace.trace(Trace.INFO, "--> Target[" + ii + "]: " + targets[ii]);
+ Trace.trace(Trace.INFO, "--> Target[" + ii + "]: " + targets[ii], Activator.traceCommands);
}
//
@@ -68,8 +69,8 @@ class DistributeCommand extends DeployCo
Target[] defaultTarget = new Target[1];
defaultTarget[0] = targets[0];
- Trace.trace(Trace.INFO, "Using default target:");
- Trace.trace(Trace.INFO, "--> " + defaultTarget[0]);
+ Trace.trace(Trace.INFO, "Using default target:", Activator.traceCommands);
+ Trace.trace(Trace.INFO, "--> " + defaultTarget[0], Activator.traceCommands);
File file = getTargetFile();
return new DeploymentCmdStatus(Status.OK_STATUS, dm.distribute( defaultTarget, file, null));
Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/commands/SynchronizedDeploymentOp.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/commands/SynchronizedDeploymentOp.java?rev=1127422&r1=1127421&r2=1127422&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/commands/SynchronizedDeploymentOp.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/commands/SynchronizedDeploymentOp.java Wed May 25 08:16:27 2011
@@ -79,7 +79,7 @@ public class SynchronizedDeploymentOp im
}
private synchronized ProgressObject run() throws Exception {
- Trace.trace(Trace.INFO, "--> run()");
+ Trace.trace(Trace.INFO, "--> run()", Activator.traceCommands);
IStatus ds = command.execute(_monitor);
@@ -96,19 +96,19 @@ public class SynchronizedDeploymentOp im
po.removeProgressListener(this);
if (timedOut) {
- Trace.trace(Trace.SEVERE, "Command Timed Out!");
+ Trace.trace(Trace.ERROR, "Command Timed Out!", Activator.logCommands);
status = new MultiStatus(Activator.PLUGIN_ID, 0, "", null);
status.add(new Status(IStatus.ERROR, Activator.PLUGIN_ID, 0, command.getCommandType() + " timed out.", null));
}
}
- Trace.trace(Trace.INFO, "<-- run()");
+ Trace.trace(Trace.INFO, "<-- run()", Activator.traceCommands);
return po;
}
private synchronized void sendNotification() {
timedOut = false;
- Trace.trace(Trace.INFO, "notifyAll()");
+ Trace.trace(Trace.INFO, "notifyAll()", Activator.traceCommands);
notifyAll();
}
@@ -121,7 +121,7 @@ public class SynchronizedDeploymentOp im
DeploymentStatus deploymentStatus = event.getDeploymentStatus();
if (deploymentStatus != null) {
DeploymentStatusMessage dsm = new DeploymentStatusMessage(deploymentStatus);
- Trace.trace(Trace.INFO, dsm.toString());
+ Trace.trace(Trace.INFO, dsm.toString(), Activator.traceCommands);
_monitor.subTask(dsm.toString());
if (command.getCommandType() == deploymentStatus.getCommand()) {
if (deploymentStatus.isCompleted()) {
Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/internal/Trace.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/internal/Trace.java?rev=1127422&r1=1127421&r2=1127422&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/internal/Trace.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/internal/Trace.java Wed May 25 08:16:27 2011
@@ -16,8 +16,8 @@
*/
package org.apache.geronimo.st.core.internal;
+import org.apache.geronimo.runtime.common.log.Logger;
import org.apache.geronimo.st.core.Activator;
-import org.eclipse.core.runtime.IStatus;
/**
* Helper class to route trace output.
@@ -29,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();
}
@@ -56,60 +64,61 @@ public class Trace {
* @param s
* a message
*/
- public static void trace(byte level, String s) {
- trace(level, s, null, false);
- }
-
- public static void trace(byte level, String s, boolean newLine) {
- trace(level, s, null, newLine);
- }
-
- public static void trace(byte level, String s, Throwable t) {
- trace(level, s, null, false);
+ public static void trace(int level, String s, boolean opt) {
+ trace(level, s, null, opt);
}
- public static void trace(byte level, String s, Throwable t, boolean newLine) {
+ /**
+ * Trace the given message and exception.
+ *
+ * @param level
+ * the trace level
+ * @param s
+ * a message
+ * @param t
+ * a throwable
+ */
+ public static void trace(int level, String s, Throwable t, boolean opt) {
if (Activator.getDefault() == null || !Activator.getDefault().isDebugging())
return;
-
- if (newLine) {
- System.out.println();
+ 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();
}
-
- System.out.println(Activator.PLUGIN_ID + ": " + s);
- if (t != null)
- t.printStackTrace();
}
/**
- * Trace the given message
+ * Trace the given message
*
* @param tracePoint
* The trace point (e.g., "Exit", "Entry", "Constructor", etc....
- *
+ *
* @param classDotMethod
* The class name + method name (e.g., "Class.method()")
- *
+ *
* @param parms
- * Method parameter(s) if the trace point is an "Entry" 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,
- Object... parms) {
- if (parms == null) {
- trace(Trace.INFO, tracePoint + ": " + classDotMethod + "( null )");
- } else {
- trace(Trace.INFO, tracePoint + ": " + classDotMethod + "(");
- for (int ii = 0; ii < parms.length; ii++) {
+ * Method parameter(s) if the trace point is an "Entry"
+ * or
+ * Return value if the trace point is an "Exit"
+ */
+ public static void tracePoint(String tracePoint, String classDotMethod, boolean opt) {
+ trace(Trace.INFO, tracePoint + ": " + classDotMethod + "()", opt);
+ }
+ public static void tracePoint(String tracePoint, boolean opt, String classDotMethod, Object... parms) {
+ if ( parms == null ) {
+ trace(Trace.INFO, tracePoint + ": " + classDotMethod + "( null )" , opt);
+ }
+ else {
+ 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);
}
- }
+ }
}
\ No newline at end of file
Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/operations/GeronimoAccountManager.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/operations/GeronimoAccountManager.java?rev=1127422&r1=1127421&r2=1127422&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/operations/GeronimoAccountManager.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/operations/GeronimoAccountManager.java Wed May 25 08:16:27 2011
@@ -25,6 +25,7 @@ import java.io.IOException;
import java.util.Properties;
import java.util.Set;
+import org.apache.geronimo.st.core.Activator;
import org.apache.geronimo.st.core.internal.Trace;
import org.eclipse.wst.server.core.IRuntime;
@@ -55,10 +56,10 @@ public class GeronimoAccountManager {
groupProperties.load(fis);
fis.close();
} catch (FileNotFoundException e) {
- Trace.trace(Trace.SEVERE, e.getMessage());
+ Trace.trace(Trace.ERROR, e.getMessage(), Activator.logOperations);
throw e;
} catch (IOException e) {
- Trace.trace(Trace.SEVERE, e.getMessage());
+ Trace.trace(Trace.ERROR, e.getMessage(), Activator.logOperations);
throw e;
}
}
@@ -142,10 +143,10 @@ public class GeronimoAccountManager {
userProperties.store(fos, "");
fos.close();
} catch (FileNotFoundException e) {
- Trace.trace(Trace.SEVERE, e.getMessage());
+ Trace.trace(Trace.ERROR, e.getMessage(), Activator.logOperations);
throw e;
} catch (IOException e) {
- Trace.trace(Trace.SEVERE, e.getMessage());
+ Trace.trace(Trace.ERROR, e.getMessage(), Activator.logOperations);
throw e;
}
}
Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/operations/ImportDeploymentPlanOperation.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/operations/ImportDeploymentPlanOperation.java?rev=1127422&r1=1127421&r2=1127422&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/operations/ImportDeploymentPlanOperation.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/operations/ImportDeploymentPlanOperation.java Wed May 25 08:16:27 2011
@@ -17,6 +17,7 @@
package org.apache.geronimo.st.core.operations;
import org.apache.geronimo.jaxbmodel.common.operations.ConversionHelper;
+import org.apache.geronimo.st.core.Activator;
import org.apache.geronimo.st.core.GeronimoUtils;
import org.apache.geronimo.st.core.internal.Trace;
import org.eclipse.core.commands.ExecutionException;
@@ -44,7 +45,7 @@ public class ImportDeploymentPlanOperati
public ImportDeploymentPlanOperation() {
super();
this.plan = null;
- Trace.tracePoint("Constructor", "ImportDeploymentPlanOperation");
+ Trace.tracePoint("Constructor", "ImportDeploymentPlanOperation", Activator.traceOperations);
}
/**
@@ -53,7 +54,7 @@ public class ImportDeploymentPlanOperati
public ImportDeploymentPlanOperation(IDataModel model) {
super(model);
this.plan = null;
- Trace.tracePoint("Constructor", "ImportDeploymentPlanOperation", model);
+ Trace.tracePoint("Constructor", Activator.traceOperations, "ImportDeploymentPlanOperation", model);
}
/**
@@ -62,7 +63,7 @@ public class ImportDeploymentPlanOperati
public ImportDeploymentPlanOperation(IDataModel model, IFile plan) {
super(model);
this.plan = plan;
- Trace.tracePoint("Constructor", "ImportDeploymentPlanOperation", model, plan);
+ Trace.tracePoint("Constructor", Activator.traceOperations, "ImportDeploymentPlanOperation", model, plan);
}
/*
@@ -72,7 +73,7 @@ public class ImportDeploymentPlanOperati
* org.eclipse.core.runtime.IAdaptable)
*/
public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- Trace.tracePoint("Entry", "ImportDeploymentPlanOperation.execute", monitor, info);
+ Trace.tracePoint("Entry", Activator.traceOperations, "ImportDeploymentPlanOperation.execute", monitor, info);
if (!isGeronimoRuntimeTarget())
return Status.OK_STATUS;
@@ -108,7 +109,7 @@ public class ImportDeploymentPlanOperati
throw new ExecutionException("ImportDeploymentPlanOperation.execute(): Error converting plan: " + planFile.getFullPath(), e);
}
- Trace.tracePoint("Exit ", "ImportDeploymentPlanOperation.execute", Status.OK_STATUS);
+ Trace.tracePoint("Exit ", Activator.traceOperations, "ImportDeploymentPlanOperation.execute", Status.OK_STATUS);
return Status.OK_STATUS;
}
}
Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/operations/SharedLibEntryCreationOperation.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/operations/SharedLibEntryCreationOperation.java?rev=1127422&r1=1127421&r2=1127422&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/operations/SharedLibEntryCreationOperation.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/src/main/java/org/apache/geronimo/st/core/operations/SharedLibEntryCreationOperation.java Wed May 25 08:16:27 2011
@@ -98,7 +98,7 @@ public class SharedLibEntryCreationOpera
* org.eclipse.core.runtime.IAdaptable)
*/
public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- Trace.trace(Trace.INFO, ">> SharedLibEntryCreationOperation.execute()");
+ Trace.trace(Trace.INFO, ">> SharedLibEntryCreationOperation.execute()", Activator.traceOperations);
this.monitor = ProgressUtil.getMonitorFor(monitor);
this.monitor.beginTask("Processing in-place shared libraries.", 100);
@@ -140,7 +140,7 @@ public class SharedLibEntryCreationOpera
if (regenerate(dummyJarFile, entries)) {
TEMP_LOCATION.toFile().mkdirs();
File temp = TEMP_LOCATION.append(project.getName() + ".eclipse.jar").toFile();
- Trace.trace(Trace.INFO, "Updating external sharedlib entries for " + module.getName());
+ Trace.trace(Trace.INFO, "Updating external sharedlib entries for " + module.getName(), Activator.traceOperations);
if(temp.exists())
delete(temp);
Manifest manifest = new Manifest();
@@ -159,16 +159,16 @@ public class SharedLibEntryCreationOpera
}catch (CoreException e){
IStatus status = e.getStatus();
- Trace.trace(Trace.SEVERE, status.getMessage(), e);
+ Trace.trace(Trace.ERROR, status.getMessage(), e, Activator.logOperations);
throw new ExecutionException(status.getMessage(), e);
}catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Failure in updating shared library.", e);
+ Trace.trace(Trace.ERROR, "Failure in updating shared library.", e, Activator.logOperations);
throw new ExecutionException("Failure in updating shared library", e);
} finally {
monitor.done();
}
- Trace.trace(Trace.INFO, "<< SharedLibEntryCreationOperation.execute()");
+ Trace.trace(Trace.INFO, "<< SharedLibEntryCreationOperation.execute()", Activator.traceOperations);
return Status.OK_STATUS;
}
@@ -206,7 +206,7 @@ public class SharedLibEntryCreationOpera
} catch (Exception e) {
throw e;
}
- Trace.trace(Trace.INFO, "Created " + dest.getAbsolutePath());
+ Trace.trace(Trace.INFO, "Created " + dest.getAbsolutePath(), Activator.traceOperations);
}
private String getSharedLibPath() throws Exception {
@@ -225,7 +225,7 @@ public class SharedLibEntryCreationOpera
}
private HashSet processModule(IModule module) throws Exception {
- Trace.trace(Trace.INFO, "SharedLibEntryCreationOperation.process() " + module.getName());
+ Trace.trace(Trace.INFO, "SharedLibEntryCreationOperation.process() " + module.getName(), Activator.traceOperations);
IProject project = module.getProject();
// filter the cp entries needed to be added to the dummy shared lib
@@ -257,9 +257,9 @@ public class SharedLibEntryCreationOpera
private void delete(File dummyJarFile) throws CoreException {
if(dummyJarFile.delete()) {
- Trace.trace(Trace.INFO, dummyJarFile.getAbsolutePath() + " deleted sucessfully.");
+ Trace.trace(Trace.INFO, dummyJarFile.getAbsolutePath() + " deleted sucessfully.", Activator.traceOperations);
} else {
- Trace.trace(Trace.SEVERE, "Failed to delete " + dummyJarFile.getAbsolutePath(), null);
+ Trace.trace(Trace.ERROR, "Failed to delete " + dummyJarFile.getAbsolutePath(), null, Activator.logOperations);
throw new CoreException(new Status(IStatus.ERROR,Activator.PLUGIN_ID,"Failed to delete " + dummyJarFile.getAbsolutePath(),null));
}
}
@@ -321,12 +321,12 @@ public class SharedLibEntryCreationOpera
try {
String url = f.toURL().toExternalForm();
if (!entries.contains(url)) {
- Trace.trace(Trace.INFO, "Adding " + url);
+ Trace.trace(Trace.INFO, "Adding " + url, Activator.traceOperations);
monitor.subTask("Linking " + url + " to shared lib.");
entries.add(url);
}
} catch (MalformedURLException e1) {
- Trace.trace(Trace.INFO, "Failed to add " + path);
+ Trace.trace(Trace.INFO, "Failed to add " + path, Activator.traceOperations);
e1.printStackTrace();
}
}
@@ -434,6 +434,6 @@ public class SharedLibEntryCreationOpera
DeploymentStatus status = po.getDeploymentStatus();
String command = status.getCommand().toString();
String state = status.getState().toString();
- Trace.trace(Trace.INFO, "SharedLib " + " " + command + " " + state);
+ Trace.trace(Trace.INFO, "SharedLib " + " " + command + " " + state, Activator.traceOperations);
}
}
Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/.options
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/.options?rev=1127422&r1=1127421&r2=1127422&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/.options (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/.options Wed May 25 08:16:27 2011
@@ -1 +1,20 @@
-org.apache.geronimo.st.ui/debug=true
\ No newline at end of file
+org.apache.geronimo.st.ui/debug=true
+org.apache.geronimo.st.ui/console=true
+
+org.apache.geronimo.st.ui/log/ui=true
+org.apache.geronimo.st.ui/log/actions=true
+org.apache.geronimo.st.ui/log/commands=true
+org.apache.geronimo.st.ui/log/internal=true
+org.apache.geronimo.st.ui/log/wizards=true
+org.apache.geronimo.st.ui/log/editors=true
+org.apache.geronimo.st.ui/log/pages=true
+org.apache.geronimo.st.ui/log/sections=true
+
+org.apache.geronimo.st.ui/trace/ui=false
+org.apache.geronimo.st.ui/trace/actions=false
+org.apache.geronimo.st.ui/trace/commands=false
+org.apache.geronimo.st.ui/trace/internal=false
+org.apache.geronimo.st.ui/trace/wizards=false
+org.apache.geronimo.st.ui/trace/editors=false
+org.apache.geronimo.st.ui/trace/pages=false
+org.apache.geronimo.st.ui/trace/sections=false
\ No newline at end of file
Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/Activator.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/Activator.java?rev=1127422&r1=1127421&r2=1127422&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/Activator.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/Activator.java Wed May 25 08:16:27 2011
@@ -23,6 +23,7 @@ import java.util.Map;
import org.apache.geronimo.st.ui.internal.Trace;
import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
@@ -39,10 +40,55 @@ public class Activator extends AbstractU
// The plug-in ID
public static final String PLUGIN_ID = "org.apache.geronimo.st.ui";
-
+ public static boolean console;
+ public static boolean logUi;
+ public static boolean logActions;
+ public static boolean logCommands;
+ public static boolean logInternal;
+ public static boolean logWizards;
+ public static boolean logEditors;
+ public static boolean logPages;
+ public static boolean logSections;
+
+ public static boolean traceUi;
+ public static boolean traceActions;
+ public static boolean traceCommands;
+ public static boolean traceInternal;
+ 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"));
+
+ logUi = Boolean.parseBoolean(Platform.getDebugOption("org.apache.geronimo.st.v11.ui/log/ui"));
+ logActions = Boolean.parseBoolean(Platform.getDebugOption("org.apache.geronimo.st.v11.ui/log/actions"));
+ logCommands = Boolean.parseBoolean(Platform.getDebugOption("org.apache.geronimo.st.v11.ui/log/commands"));
+ logInternal = Boolean.parseBoolean(Platform.getDebugOption("org.apache.geronimo.st.v11.ui/log/internal"));
+ 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"));
+
+ traceUi = Boolean.parseBoolean(Platform.getDebugOption("org.apache.geronimo.st.v11.ui/trace/ui"));
+ traceActions = Boolean.parseBoolean(Platform.getDebugOption("org.apache.geronimo.st.v11.ui/trace/actions"));
+ traceCommands = Boolean.parseBoolean(Platform.getDebugOption("org.apache.geronimo.st.v11.ui/trace/commands"));
+ traceInternal = Boolean.parseBoolean(Platform.getDebugOption("org.apache.geronimo.st.v11.ui/trace/internal"));
+ 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;
-
+
private static String iconLocation;
private Map imageDescriptors = new HashMap();
@@ -146,7 +192,7 @@ public class Activator extends AbstractU
registry.put(key, id);
imageDescriptors.put(key, id);
} catch (Exception e) {
- Trace.trace(Trace.WARNING, "Error registering image", e);
+ Trace.trace(Trace.WARNING, "Error registering image", e, Activator.logUi);
}
}
Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/actions/LaunchGeronimoConsoleAction.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/actions/LaunchGeronimoConsoleAction.java?rev=1127422&r1=1127421&r2=1127422&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/actions/LaunchGeronimoConsoleAction.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/actions/LaunchGeronimoConsoleAction.java Wed May 25 08:16:27 2011
@@ -20,6 +20,7 @@ import java.net.MalformedURLException;
import java.net.URL;
import org.apache.geronimo.st.core.GeronimoServerDelegate;
+import org.apache.geronimo.st.ui.Activator;
import org.apache.geronimo.st.ui.internal.Messages;
import org.apache.geronimo.st.ui.internal.Trace;
import org.eclipse.core.runtime.IConfigurationElement;
@@ -51,12 +52,12 @@ public class LaunchGeronimoConsoleAction
.getConfigurationElementsFor("org.apache.geronimo.st.ui.actionURLs");
for (IConfigurationElement element : extensions) {
Trace.trace(Trace.INFO, element.getName() + " = "
- + element.getValue() + ".");
+ + element.getValue() + ".", Activator.traceActions);
if (element.getName().equals("server_prefix")) {
serverPrefix = element.getValue();
Trace
.trace(Trace.INFO, "server_prefix = " + serverPrefix
- + ".");
+ + ".", Activator.traceActions);
}
}
}
Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/actions/LaunchGeronimoSupportAction.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/actions/LaunchGeronimoSupportAction.java?rev=1127422&r1=1127421&r2=1127422&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/actions/LaunchGeronimoSupportAction.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/actions/LaunchGeronimoSupportAction.java Wed May 25 08:16:27 2011
@@ -19,6 +19,7 @@ package org.apache.geronimo.st.ui.action
import java.net.MalformedURLException;
import java.net.URL;
+import org.apache.geronimo.st.ui.Activator;
import org.apache.geronimo.st.ui.internal.Messages;
import org.apache.geronimo.st.ui.internal.Trace;
import org.eclipse.core.runtime.IConfigurationElement;
@@ -52,19 +53,19 @@ public class LaunchGeronimoSupportAction
.getConfigurationElementsFor("org.apache.geronimo.st.ui.actionURLs");
for (IConfigurationElement element : extensions) {
Trace.trace(Trace.INFO, element.getName() + " = "
- + element.getValue() + ".");
+ + element.getValue() + ".", Activator.traceActions);
if (element.getName().equals("server_prefix")) {
serverPrefix = element.getValue();
Trace
.trace(Trace.INFO, "server_prefix = " + serverPrefix
- + ".");
+ + ".", Activator.traceActions);
} else if (element.getName().equals("action_URL")
&& element
.getAttribute("class")
.equals(
"org.apache.geronimo.st.ui.actions.LaunchGeronimoSupportAction")) {
supportURL = element.getAttribute("URL");
- Trace.trace(Trace.INFO, "support URL = " + supportURL + ".");
+ Trace.trace(Trace.INFO, "support URL = " + supportURL + ".", Activator.traceActions);
}
}
}
Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/commands/SetClasspathContainersCommand.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/commands/SetClasspathContainersCommand.java?rev=1127422&r1=1127421&r2=1127422&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/commands/SetClasspathContainersCommand.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/commands/SetClasspathContainersCommand.java Wed May 25 08:16:27 2011
@@ -19,6 +19,7 @@ package org.apache.geronimo.st.ui.comman
import java.util.ArrayList;
import java.util.List;
import org.apache.geronimo.st.core.GeronimoServerDelegate;
+import org.apache.geronimo.st.ui.Activator;
import org.apache.geronimo.st.ui.internal.Trace;
import org.eclipse.wst.server.core.IServerWorkingCopy;
@@ -40,8 +41,8 @@ public class SetClasspathContainersComma
super(server, "SetClasspathContainersCommand");
this.newList = createList( checkList );
- Trace.tracePoint("ENTRY", "SetClasspathContainersCommand", checkList, checkList.length );
- Trace.tracePoint("EXIT", "SetClasspathContainersCommand");
+ Trace.tracePoint("ENTRY", Activator.traceCommands, "SetClasspathContainersCommand", checkList, checkList.length );
+ Trace.tracePoint("EXIT", Activator.traceCommands, "SetClasspathContainersCommand");
}
@@ -51,13 +52,13 @@ public class SetClasspathContainersComma
* @see org.apache.geronimo.st.ui.commands.ServerCommand#execute()
*/
public void execute() {
- Trace.tracePoint("ENTRY", "SetClasspathContainersCommand.execute");
+ Trace.tracePoint("ENTRY", Activator.traceCommands, "SetClasspathContainersCommand.execute");
GeronimoServerDelegate gs = (GeronimoServerDelegate) server.getAdapter(GeronimoServerDelegate.class);
oldList = gs.getClasspathContainers();
gs.setClasspathContainers(newList);
- Trace.tracePoint("EXIT", "SetClasspathContainersCommand.execute");
+ Trace.tracePoint("EXIT", Activator.traceCommands, "SetClasspathContainersCommand.execute");
}
@@ -67,12 +68,12 @@ public class SetClasspathContainersComma
* @see org.apache.geronimo.st.ui.commands.ServerCommand#undo()
*/
public void undo() {
- Trace.tracePoint("ENTRY", "SetClasspathContainersCommand.undo");
+ Trace.tracePoint("ENTRY", Activator.traceCommands, "SetClasspathContainersCommand.undo");
GeronimoServerDelegate gs = (GeronimoServerDelegate) server.getAdapter(GeronimoServerDelegate.class);
gs.setClasspathContainers(oldList);
- Trace.tracePoint("EXIT", "SetClasspathContainersCommand.undo");
+ Trace.tracePoint("EXIT", Activator.traceCommands, "SetClasspathContainersCommand.undo");
}
@@ -80,14 +81,14 @@ public class SetClasspathContainersComma
// Convert object array to List<String>
//
public List<String> createList( Object[] checkList ) {
- Trace.tracePoint("ENTRY", "SetClasspathContainersCommand.createList");
+ Trace.tracePoint("ENTRY", Activator.traceCommands, "SetClasspathContainersCommand.createList");
List<String> containers = new ArrayList<String>();
for (Object container : checkList) {
containers.add( (String)container );
}
- Trace.tracePoint("EXIT", "SetClasspathContainersCommand.createList", containers );
+ Trace.tracePoint("EXIT", Activator.traceCommands, "SetClasspathContainersCommand.createList", containers );
return containers;
}
Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/editors/AbstractGeronimoFormContentLoader.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/editors/AbstractGeronimoFormContentLoader.java?rev=1127422&r1=1127421&r2=1127422&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/editors/AbstractGeronimoFormContentLoader.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/editors/AbstractGeronimoFormContentLoader.java Wed May 25 08:16:27 2011
@@ -23,6 +23,7 @@ import javax.xml.bind.JAXBException;
import org.apache.geronimo.jaxbmodel.common.operations.JAXBUtils;
import org.apache.geronimo.st.core.GeronimoUtils;
+import org.apache.geronimo.st.ui.Activator;
import org.apache.geronimo.st.ui.internal.Trace;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
@@ -94,10 +95,10 @@ public abstract class AbstractGeronimoFo
if (runtime == null) return null;
version = runtime.getRuntimeType().getVersion();
} catch (CoreException e) {
- Trace.tracePoint("CoreException", this.getClass().getSimpleName() + ".getVersion");
+ Trace.tracePoint("CoreException", Activator.logEditors, this.getClass().getSimpleName() + ".getVersion");
e.printStackTrace();
} catch (IllegalArgumentException ie) {
- Trace.tracePoint("IllegalArgumentException", this.getClass().getSimpleName() + ".getVersion");
+ Trace.tracePoint("IllegalArgumentException", Activator.logEditors, this.getClass().getSimpleName() + ".getVersion");
throw new IllegalArgumentException("The project [" + project.getName() + "] does not have a Targeted Runtime specified.");
}
}
Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/editors/AbstractGeronimoJAXBBasedEditor.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/editors/AbstractGeronimoJAXBBasedEditor.java?rev=1127422&r1=1127421&r2=1127422&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/editors/AbstractGeronimoJAXBBasedEditor.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/editors/AbstractGeronimoJAXBBasedEditor.java Wed May 25 08:16:27 2011
@@ -23,6 +23,7 @@ import javax.xml.bind.JAXBElement;
import org.apache.geronimo.st.core.operations.ImportDeploymentPlanDataModelProvider;
import org.apache.geronimo.st.core.operations.ImportDeploymentPlanOperation;
+import org.apache.geronimo.st.ui.Activator;
import org.apache.geronimo.st.ui.internal.Messages;
import org.apache.geronimo.st.ui.internal.Trace;
import org.apache.geronimo.st.ui.pages.AbstractGeronimoFormPage;
@@ -91,14 +92,14 @@ public abstract class AbstractGeronimoJA
}
}
} catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error saving", e);
+ Trace.trace(Trace.ERROR, "Error saving", e, Activator.logEditors);
MessageDialog.openError(Display.getCurrent().getActiveShell(), "Error saving", e.getMessage());
} finally {
try {
if (is != null)
is.close();
} catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Error saving", e);
+ Trace.trace(Trace.ERROR, "Error saving", e, Activator.logEditors);
MessageDialog.openError(Display.getCurrent().getActiveShell(), "Error saving", e.getMessage());
}
}
@@ -188,7 +189,7 @@ public abstract class AbstractGeronimoJA
} catch (Exception e) {
// if catching an exception , it will try to correct the plan
// or open the plan with default editor
- Trace.trace(Trace.WARNING, "Error loading deployment plan", e);
+ Trace.trace(Trace.WARNING, "Error loading deployment plan", e, Activator.logEditors);
}
boolean fix = false;
@@ -210,7 +211,7 @@ public abstract class AbstractGeronimoJA
converted = true;
} catch (Exception e) {
// conversion failed somehow
- Trace.trace(Trace.WARNING, "Error converting deployment plan", e);
+ Trace.trace(Trace.WARNING, "Error converting deployment plan", e, Activator.logEditors);
}
if (converted) {
@@ -218,7 +219,7 @@ public abstract class AbstractGeronimoJA
rootJAXBElement = loadFile(fei.getFile());
} catch (Exception e) {
// still can't load it
- Trace.trace(Trace.WARNING, "Error loading converted deployment plan", e);
+ Trace.trace(Trace.WARNING, "Error loading converted deployment plan", e, Activator.logEditors);
}
}
Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/editors/SharedDeploymentPlanEditor.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/editors/SharedDeploymentPlanEditor.java?rev=1127422&r1=1127421&r2=1127422&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/editors/SharedDeploymentPlanEditor.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/editors/SharedDeploymentPlanEditor.java Wed May 25 08:16:27 2011
@@ -60,18 +60,18 @@ public class SharedDeploymentPlanEditor
* @see org.apache.geronimo.st.ui.editors.AbstractGeronimoDeploymentPlanEditor#doAddPages()
*/
public void doAddPages() throws PartInitException {
- Trace.tracePoint("ENTRY", "SharedDeploymentPlanEditor.doAddPages");
+ Trace.tracePoint("ENTRY", Activator.traceEditors, "SharedDeploymentPlanEditor.doAddPages");
if (getRootElement() != null && getLoader() != null) {
currentLoader.doAddPages(this);
}
addSourcePage();
- Trace.tracePoint("EXIT", "SharedDeploymentPlanEditor.doAddPages");
+ Trace.tracePoint("EXIT", Activator.traceEditors, "SharedDeploymentPlanEditor.doAddPages");
}
private static synchronized void loadExtensionPoints() {
- Trace.tracePoint("ENTRY", "SharedDeploymentPlanEditor.loadExtensionPoints");
+ Trace.tracePoint("ENTRY", Activator.traceEditors, "SharedDeploymentPlanEditor.loadExtensionPoints");
IExtensionRegistry registry = Platform.getExtensionRegistry();
IConfigurationElement[] cf = registry.getConfigurationElementsFor(Activator.PLUGIN_ID, "loader");
@@ -83,13 +83,13 @@ public class SharedDeploymentPlanEditor
String version = element.getAttribute("version");
loaders.put(version, loader);
} catch (CoreException e) {
- Trace.tracePoint("CoreException", "SharedDeploymentPlanEditor.loadExtensionPoints");
+ Trace.tracePoint("CoreException", Activator.logEditors, "SharedDeploymentPlanEditor.loadExtensionPoints");
e.printStackTrace();
}
}
}
- Trace.tracePoint("EXIT", "SharedDeploymentPlanEditor.loadExtensionPoints");
+ Trace.tracePoint("EXIT", Activator.traceEditors, "SharedDeploymentPlanEditor.loadExtensionPoints");
}
/*
@@ -98,9 +98,9 @@ public class SharedDeploymentPlanEditor
* @see org.apache.geronimo.st.ui.editors.AbstractGeronimoDeploymentPlanEditor#loadDeploymentPlan(org.eclipse.core.resources.IFile)
*/
public JAXBElement loadFile(IFile file) throws Exception {
- Trace.tracePoint("ENTRY", "SharedDeploymentPlanEditor.loadDeploymentPlan", file);
+ Trace.tracePoint("ENTRY", Activator.traceEditors, "SharedDeploymentPlanEditor.loadDeploymentPlan", file);
JAXBElement jaxbElement = getLoader() != null ? currentLoader.loadDeploymentPlan(file) : null;
- Trace.tracePoint("EXIT", "SharedDeploymentPlanEditor.loadDeploymentPlan", jaxbElement);
+ Trace.tracePoint("EXIT", Activator.traceEditors, "SharedDeploymentPlanEditor.loadDeploymentPlan", jaxbElement);
return jaxbElement;
}
@@ -111,7 +111,7 @@ public class SharedDeploymentPlanEditor
}
private IGeronimoFormContentLoader getLoader() {
- Trace.tracePoint("ENTRY", "SharedDeploymentPlanEditor.getLoader");
+ Trace.tracePoint("ENTRY", Activator.traceEditors, "SharedDeploymentPlanEditor.getLoader");
if (currentLoader == null) {
IEditorInput input = getEditorInput();
@@ -126,16 +126,16 @@ public class SharedDeploymentPlanEditor
currentLoader = (IGeronimoFormContentLoader) loaders.get(version);
runtimeVersion = version;
} catch (CoreException e) {
- Trace.tracePoint("CoreException", "SharedDeploymentPlanEditor.getLoader");
+ Trace.tracePoint("CoreException", Activator.logEditors, "SharedDeploymentPlanEditor.getLoader");
e.printStackTrace();
} catch (IllegalArgumentException ie) {
- Trace.tracePoint("IllegalArgumentException", "SharedDeploymentPlanEditor.getLoader");
+ Trace.tracePoint("IllegalArgumentException", Activator.logEditors, "SharedDeploymentPlanEditor.getLoader");
throw new IllegalArgumentException("The project [" + project.getName() + "] does not have a Targeted Runtime specified.");
}
}
}
- Trace.tracePoint("EXIT", "SharedDeploymentPlanEditor.getLoader", currentLoader);
+ Trace.tracePoint("EXIT", Activator.traceEditors, "SharedDeploymentPlanEditor.getLoader", currentLoader);
return currentLoader;
}
Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/GeronimoRuntimeWizardFragment.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/GeronimoRuntimeWizardFragment.java?rev=1127422&r1=1127421&r2=1127422&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/GeronimoRuntimeWizardFragment.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/GeronimoRuntimeWizardFragment.java Wed May 25 08:16:27 2011
@@ -154,7 +154,7 @@ public class GeronimoRuntimeWizardFragme
@Override
public void linkActivated(HyperlinkEvent hyperlinkEvent) {
String url = hyperlinkEvent.getHref().toString();
- Trace.trace(Trace.INFO, "Hyperlink " + url + ".");
+ Trace.trace(Trace.INFO, "Hyperlink " + url + ".", Activator.traceInternal);
try {
int style = IWorkbenchBrowserSupport.AS_EXTERNAL
| IWorkbenchBrowserSupport.STATUS;
Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Trace.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Trace.java?rev=1127422&r1=1127421&r2=1127422&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Trace.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/internal/Trace.java Wed May 25 08:16:27 2011
@@ -16,8 +16,8 @@
*/
package org.apache.geronimo.st.ui.internal;
+import org.apache.geronimo.runtime.common.log.Logger;
import org.apache.geronimo.st.ui.Activator;
-import org.eclipse.core.runtime.IStatus;
/**
@@ -30,21 +30,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();
}
@@ -57,8 +65,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);
}
/**
@@ -71,14 +79,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();
+ }
}
/**
@@ -95,20 +106,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);
}
}
}
\ No newline at end of file
Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/sections/ServerEditorSecuritySection.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/sections/ServerEditorSecuritySection.java?rev=1127422&r1=1127421&r2=1127422&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/sections/ServerEditorSecuritySection.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/sections/ServerEditorSecuritySection.java Wed May 25 08:16:27 2011
@@ -18,6 +18,7 @@ package org.apache.geronimo.st.ui.sectio
import org.apache.geronimo.st.core.IGeronimoServer;
import org.apache.geronimo.st.core.operations.GeronimoAccountManager;
+import org.apache.geronimo.st.ui.Activator;
import org.apache.geronimo.st.ui.CommonMessages;
import org.apache.geronimo.st.ui.commands.SetPasswordCommand;
import org.apache.geronimo.st.ui.commands.SetUsernameCommand;
@@ -105,7 +106,7 @@ public class ServerEditorSecuritySection
manager.init();
} catch (Exception e1) {
MessageDialog.openError(Display.getCurrent().getActiveShell(), CommonMessages.errorOpenWizard, CommonMessages.cannotRead);
- Trace.trace(Trace.SEVERE, "Properties file containing user information can't be read!", e1);
+ Trace.trace(Trace.ERROR, "Properties file containing user information can't be read!", e1, Activator.logSections);
return;
}
ManageAccountWizard wizard = new ManageAccountWizard(manager);
Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/sections/ServerEditorTestEnvSection.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/sections/ServerEditorTestEnvSection.java?rev=1127422&r1=1127421&r2=1127422&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/sections/ServerEditorTestEnvSection.java (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/src/main/java/org/apache/geronimo/st/ui/sections/ServerEditorTestEnvSection.java Wed May 25 08:16:27 2011
@@ -19,6 +19,7 @@ package org.apache.geronimo.st.ui.sectio
import java.util.List;
import org.apache.geronimo.st.core.ClasspathContainersHelper;
+import org.apache.geronimo.st.ui.Activator;
import org.apache.geronimo.st.ui.commands.SetClasspathContainersCommand;
import org.apache.geronimo.st.ui.commands.SetInPlaceSharedLibCommand;
import org.apache.geronimo.st.ui.commands.SetNotRedeployJSPFilesCommand;
@@ -72,7 +73,7 @@ public class ServerEditorTestEnvSection
public void createSection(Composite parent) {
super.createSection(parent);
- Trace.tracePoint("ENTRY", "ServerEditorTestEnvSection.createSection", parent);
+ Trace.tracePoint("ENTRY", Activator.traceSections, "ServerEditorTestEnvSection.createSection", parent);
toolkit = getFormToolkit(parent.getDisplay());
@@ -213,14 +214,14 @@ public class ServerEditorTestEnvSection
checkbox.getTable().setEnabled( false );
}
- Trace.tracePoint("EXIT", "ServerEditorTestEnvSection.createSection");
+ Trace.tracePoint("EXIT", Activator.traceSections, "ServerEditorTestEnvSection.createSection");
}
//
// CheckboxTableViewer: checkbox
//
public void createCheckbox() {
- Trace.tracePoint("ENTRY", "ServerEditorTestEnvSection.createCheckbox");
+ Trace.tracePoint("ENTRY", Activator.traceSections, "ServerEditorTestEnvSection.createCheckbox");
if ( checkbox == null ) {
@@ -245,6 +246,6 @@ public class ServerEditorTestEnvSection
});
}
- Trace.tracePoint("EXIT", "ServerEditorTestEnvSection.createCheckbox");
+ Trace.tracePoint("EXIT", Activator.traceSections, "ServerEditorTestEnvSection.createCheckbox");
}
}
Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.core/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.core/META-INF/MANIFEST.MF?rev=1127422&r1=1127421&r2=1127422&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.core/META-INF/MANIFEST.MF (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v11.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.v11.core.Activator
Bundle-Vendor: Apache.org
Bundle-Localization: plugin
+Import-Package: org.apache.geronimo.runtime.common.log
Require-Bundle: org.apache.geronimo.runtime.v11,
org.apache.geronimo.st.core,
org.apache.geronimo.jaxbmodel.common,