Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2006-10-29 23:06:12 +0000
committerslewis2006-10-29 23:06:12 +0000
commitc976758c84de8e29b349eb5934e949a10c695d4a (patch)
treed0f0a9e7c2bda33cd478565bf63aca24452d7863
parent7811aaadf674e978ce439124d4d1d2a4bd7855f6 (diff)
downloadorg.eclipse.ecf-c976758c84de8e29b349eb5934e949a10c695d4a.tar.gz
org.eclipse.ecf-c976758c84de8e29b349eb5934e949a10c695d4a.tar.xz
org.eclipse.ecf-c976758c84de8e29b349eb5934e949a10c695d4a.zip
Fixes to make remoteservice and remoteservice provider Activator classes be internal package
-rw-r--r--framework/bundles/org.eclipse.ecf.remoteservice/META-INF/MANIFEST.MF2
-rw-r--r--framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/internal/remoteservice/Activator.java (renamed from framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/Activator.java)2
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.remoteservice/.options25
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.remoteservice/META-INF/MANIFEST.MF2
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.remoteservice/src/org/eclipse/ecf/internal/provider/remoteservice/Activator.java (renamed from providers/bundles/org.eclipse.ecf.provider.remoteservice/src/org/eclipse/ecf/provider/remoteservice/Activator.java)2
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.remoteservice/src/org/eclipse/ecf/internal/provider/remoteservice/IRemoteServiceProviderDebugOptions.java26
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.remoteservice/src/org/eclipse/ecf/provider/remoteservice/Trace.java112
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.remoteservice/src/org/eclipse/ecf/provider/remoteservice/generic/RegistrySharedObject.java44
8 files changed, 77 insertions, 138 deletions
diff --git a/framework/bundles/org.eclipse.ecf.remoteservice/META-INF/MANIFEST.MF b/framework/bundles/org.eclipse.ecf.remoteservice/META-INF/MANIFEST.MF
index 895d15f0e..b6fbe92e8 100644
--- a/framework/bundles/org.eclipse.ecf.remoteservice/META-INF/MANIFEST.MF
+++ b/framework/bundles/org.eclipse.ecf.remoteservice/META-INF/MANIFEST.MF
@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: ECF Remoteservice API
Bundle-SymbolicName: org.eclipse.ecf.remoteservice
Bundle-Version: 0.9.3
-Bundle-Activator: org.eclipse.ecf.remoteservice.Activator
+Bundle-Activator: org.eclipse.ecf.internal.remoteservice.Activator
Bundle-Vendor: Eclipse.org
Bundle-Localization: plugin
Require-Bundle: org.eclipse.core.runtime,
diff --git a/framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/Activator.java b/framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/internal/remoteservice/Activator.java
index c03fba22a..1389f763e 100644
--- a/framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/Activator.java
+++ b/framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/internal/remoteservice/Activator.java
@@ -9,7 +9,7 @@
* Composent, Inc. - initial API and implementation
*****************************************************************************/
-package org.eclipse.ecf.remoteservice;
+package org.eclipse.ecf.internal.remoteservice;
import org.eclipse.core.runtime.Plugin;
import org.osgi.framework.BundleContext;
diff --git a/providers/bundles/org.eclipse.ecf.provider.remoteservice/.options b/providers/bundles/org.eclipse.ecf.provider.remoteservice/.options
index 78302bb25..df993860f 100644
--- a/providers/bundles/org.eclipse.ecf.provider.remoteservice/.options
+++ b/providers/bundles/org.eclipse.ecf.provider.remoteservice/.options
@@ -1,4 +1,25 @@
-org.eclipse.ecf.provider.remoteservice/debug = true
+# Debugging options for the org.eclipse.ecf.provider.remoteservice plug-in
+
+# Turn on general debugging for the org.eclipse.ecf.provider.remoteservice plug-in
+org.eclipse.ecf.provider.remoteservice/debug=true
org.eclipse.ecf.provider.remoteservice/debug/filter = *
org.eclipse.ecf.provider.remoteservice/debug/flag = true
-org.eclipse.ecf.provider.remoteservice/debug/registrysharedobject = true
+
+# Trace when exceptions are caught
+org.eclipse.ecf.provider.remoteservice/debug/exceptions/catching=false
+# Trace when exceptions are thrown
+org.eclipse.ecf.provider.remoteservice/debug/exceptions/throwing=false
+
+# Trace when methods are entered
+org.eclipse.ecf.provider.remoteservice/debug/methods/entering=false
+# Trace when methods are exited
+org.eclipse.ecf.provider.remoteservice/debug/methods/exiting=false
+
+org.eclipse.ecf.provider.remoteservice/debug/containerfactory = true
+org.eclipse.ecf.provider.remoteservice/debug/sharedobjectcontainerfactory = true
+org.eclipse.ecf.provider.remoteservice/debug/idfactory = true
+org.eclipse.ecf.provider.remoteservice/debug/connectionfactory = true
+org.eclipse.ecf.provider.remoteservice/debug/factoryinit = true
+org.eclipse.ecf.provider.remoteservice/debug/abstractsharedobject = true
+org.eclipse.ecf.provider.remoteservice/debug/twophasecommiteventprocessor = true
+org.eclipse.ecf.provider.remoteservice/debug/optimisticsharedobject = true
diff --git a/providers/bundles/org.eclipse.ecf.provider.remoteservice/META-INF/MANIFEST.MF b/providers/bundles/org.eclipse.ecf.provider.remoteservice/META-INF/MANIFEST.MF
index 26d1c1ce8..7d3e0dcfb 100644
--- a/providers/bundles/org.eclipse.ecf.provider.remoteservice/META-INF/MANIFEST.MF
+++ b/providers/bundles/org.eclipse.ecf.provider.remoteservice/META-INF/MANIFEST.MF
@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: ECF Remoteservice Provider
Bundle-SymbolicName: org.eclipse.ecf.provider.remoteservice;singleton:=true
Bundle-Version: 0.9.3
-Bundle-Activator: org.eclipse.ecf.provider.remoteservice.Activator
+Bundle-Activator: org.eclipse.ecf.internal.provider.remoteservice.Activator
Bundle-Vendor: Eclipse.org
Bundle-Localization: plugin
Require-Bundle: org.eclipse.core.runtime,
diff --git a/providers/bundles/org.eclipse.ecf.provider.remoteservice/src/org/eclipse/ecf/provider/remoteservice/Activator.java b/providers/bundles/org.eclipse.ecf.provider.remoteservice/src/org/eclipse/ecf/internal/provider/remoteservice/Activator.java
index a83bb9da6..0a5d48be1 100644
--- a/providers/bundles/org.eclipse.ecf.provider.remoteservice/src/org/eclipse/ecf/provider/remoteservice/Activator.java
+++ b/providers/bundles/org.eclipse.ecf.provider.remoteservice/src/org/eclipse/ecf/internal/provider/remoteservice/Activator.java
@@ -6,7 +6,7 @@
*
* Contributors: Composent, Inc. - initial API and implementation
******************************************************************************/
-package org.eclipse.ecf.provider.remoteservice;
+package org.eclipse.ecf.internal.provider.remoteservice;
import org.eclipse.core.runtime.Plugin;
import org.osgi.framework.BundleContext;
diff --git a/providers/bundles/org.eclipse.ecf.provider.remoteservice/src/org/eclipse/ecf/internal/provider/remoteservice/IRemoteServiceProviderDebugOptions.java b/providers/bundles/org.eclipse.ecf.provider.remoteservice/src/org/eclipse/ecf/internal/provider/remoteservice/IRemoteServiceProviderDebugOptions.java
new file mode 100644
index 000000000..0528859b0
--- /dev/null
+++ b/providers/bundles/org.eclipse.ecf.provider.remoteservice/src/org/eclipse/ecf/internal/provider/remoteservice/IRemoteServiceProviderDebugOptions.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This
+ * program and the accompanying materials are made available under the terms of
+ * the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: Composent, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.ecf.internal.provider.remoteservice;
+
+public interface IRemoteServiceProviderDebugOptions {
+
+ public static final String DEBUG = Activator.PLUGIN_ID + "/debug"; //$NON-NLS-1$
+
+ public static final String EXCEPTIONS_CATCHING = DEBUG
+ + "/exceptions/catching"; //$NON-NLS-1$
+
+ public static final String EXCEPTIONS_THROWING = DEBUG
+ + "/exceptions/throwing"; //$NON-NLS-1$
+
+ public static final String METHODS_ENTERING = DEBUG + "/methods/entering"; //$NON-NLS-1$
+
+ public static final String METHODS_EXITING = DEBUG + "/methods/exiting"; //$NON-NLS-1$
+
+
+}
diff --git a/providers/bundles/org.eclipse.ecf.provider.remoteservice/src/org/eclipse/ecf/provider/remoteservice/Trace.java b/providers/bundles/org.eclipse.ecf.provider.remoteservice/src/org/eclipse/ecf/provider/remoteservice/Trace.java
deleted file mode 100644
index 4e5ecba2a..000000000
--- a/providers/bundles/org.eclipse.ecf.provider.remoteservice/src/org/eclipse/ecf/provider/remoteservice/Trace.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/****************************************************************************
-* Copyright (c) 2004 Composent, Inc. and others.
-* All rights reserved. This program and the accompanying materials
-* are made available under the terms of the Eclipse Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/epl-v10.html
-*
-* Contributors:
-* Composent, Inc. - initial API and implementation
-*****************************************************************************/
-
-package org.eclipse.ecf.provider.remoteservice;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.PrintStream;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import org.eclipse.core.runtime.Platform;
-
-public class Trace {
- private static final String TRACENAME = Activator.PLUGIN_ID+".Trace";
-
- public static final String tracePrefix = "(trace)";
-
- public static boolean ON = true;
- protected static boolean isEclipse = false;
- protected static String pluginName = "";
- protected static String debugPrefix = "/debug/";
- protected static Trace errTrace = new Trace(TRACENAME+".err");
-
- protected static PrintStream getPrintStream(String outputFileName) {
- if (outputFileName != null) try {
- File f = new File(outputFileName);
- PrintStream ps = new PrintStream(new FileOutputStream(f,true));
- System.out.println(TRACENAME+" directed to "+f.getCanonicalPath());
- return ps;
- } catch (Exception e) {
- System.err.println("Exception opening output file '"+outputFileName+"' for tracing...using System.out");
- }
- return System.out;
- }
-
- protected static PrintStream printStream = null;
-
- static {
- String val = System.getProperty(TRACENAME);
- printStream = getPrintStream(val);
- if (val != null) {
- ON = true;
- isEclipse = false;
- } else {
- try {
- ON = Platform.inDebugMode();
- pluginName = Activator.getDefault().getBundle().getSymbolicName();
- } catch (Exception e) {
- System.out.println("WARNING: Platform not available for trace");
- }
- isEclipse = true;
- }
- }
-
- public static Trace create(String key) {
- if (isEclipse) {
- String res = "";
- try {
- res = Platform.getDebugOption(pluginName + debugPrefix + key);
- } catch (Exception e) {
- // ignore...this means that the Platform class not found.
- }
- if (res != null) {
- Boolean on = new Boolean(res);
- if (on.booleanValue())
- return new Trace(pluginName + "(" + key + ")");
- else
- return null;
- } else {
- return null;
- }
- } else
- return new Trace(key);
- }
-
- String name;
-
- public void dumpStack(Throwable e, String msg) {
- msg(msg);
- if (e != null) e.printStackTrace(printStream);
- }
-
- public static void errDumpStack(Throwable e, String msg) {
- errTrace.dumpStack(e,msg);
- }
- public void msg(String msg) {
- StringBuffer sb = new StringBuffer(name);
- sb.append(getTimeString()).append(msg);
- printStream.println(sb.toString());
- }
- public static void errMsg(String msg) {
- errTrace.msg(msg);
- }
- protected static String getTimeString() {
- Date d = new Date();
- SimpleDateFormat df = new SimpleDateFormat("[MM/dd/yy;HH:mm:ss:SSS]");
- return df.format(d);
- }
-
- protected Trace(String str) {
- name = tracePrefix+str;
- }
-
-} \ No newline at end of file
diff --git a/providers/bundles/org.eclipse.ecf.provider.remoteservice/src/org/eclipse/ecf/provider/remoteservice/generic/RegistrySharedObject.java b/providers/bundles/org.eclipse.ecf.provider.remoteservice/src/org/eclipse/ecf/provider/remoteservice/generic/RegistrySharedObject.java
index a4dab9188..1ee082da4 100644
--- a/providers/bundles/org.eclipse.ecf.provider.remoteservice/src/org/eclipse/ecf/provider/remoteservice/generic/RegistrySharedObject.java
+++ b/providers/bundles/org.eclipse.ecf.provider.remoteservice/src/org/eclipse/ecf/provider/remoteservice/generic/RegistrySharedObject.java
@@ -31,8 +31,9 @@ import org.eclipse.ecf.core.sharedobject.SharedObjectMsg;
import org.eclipse.ecf.core.util.ECFException;
import org.eclipse.ecf.core.util.Event;
import org.eclipse.ecf.core.util.IEventProcessor;
-import org.eclipse.ecf.provider.remoteservice.Trace;
-import org.eclipse.ecf.remoteservice.Activator;
+import org.eclipse.ecf.core.util.Trace;
+import org.eclipse.ecf.internal.provider.remoteservice.Activator;
+import org.eclipse.ecf.internal.provider.remoteservice.IRemoteServiceProviderDebugOptions;
import org.eclipse.ecf.remoteservice.IRemoteCall;
import org.eclipse.ecf.remoteservice.IRemoteCallListener;
import org.eclipse.ecf.remoteservice.IRemoteFilter;
@@ -47,9 +48,8 @@ import org.eclipse.ecf.remoteservice.events.IRemoteServiceEvent;
import org.eclipse.ecf.remoteservice.events.IRemoteServiceRegisteredEvent;
import org.eclipse.ecf.remoteservice.events.IRemoteServiceUnregisteredEvent;
-public class RegistrySharedObject extends BaseSharedObject implements IRemoteServiceContainerAdapter {
-
- Trace trace = Trace.create("registrysharedobject");
+public class RegistrySharedObject extends BaseSharedObject implements
+ IRemoteServiceContainerAdapter {
protected RemoteServiceRegistryImpl localRegistry;
@@ -161,15 +161,16 @@ public class RegistrySharedObject extends BaseSharedObject implements IRemoteSer
protected void handleContainerDisconnectedEvent(
IContainerDisconnectedEvent event) {
- trace("handleContainerDisconnectedEvent("+event+")");
+ trace("handleContainerDisconnectedEvent(" + event + ")");
ID targetID = event.getTargetID();
synchronized (remoteRegistrys) {
RemoteServiceRegistryImpl registry = getRemoteRegistry(targetID);
if (registry != null) {
removeRemoteRegistry(targetID);
- RemoteServiceRegistrationImpl registrations [] = registry.getRegistrations();
+ RemoteServiceRegistrationImpl registrations[] = registry
+ .getRegistrations();
if (registrations != null) {
- for(int i=0; i < registrations.length; i++) {
+ for (int i = 0; i < registrations.length; i++) {
trace("handleContainerDisconnectedEvent.unregistering serviceid="
+ registrations[i].getServiceId());
registry.unpublishService(registrations[i]);
@@ -588,7 +589,8 @@ public class RegistrySharedObject extends BaseSharedObject implements IRemoteSer
sendSharedObjectMsgTo(responseTarget, SharedObjectMsg.createMsg(
CALL_RESPONSE, response));
} catch (IOException e) {
- logSendError(CALL_RESPONSE_ERROR_CODE, CALL_RESPONSE_ERROR_MESSAGE, e);
+ logSendError(CALL_RESPONSE_ERROR_CODE, CALL_RESPONSE_ERROR_MESSAGE,
+ e);
}
}
@@ -681,7 +683,8 @@ public class RegistrySharedObject extends BaseSharedObject implements IRemoteSer
}
}
- protected IRemoteServiceUnregisteredEvent createUnregisteredEvent(final RemoteServiceRegistrationImpl registration) {
+ protected IRemoteServiceUnregisteredEvent createUnregisteredEvent(
+ final RemoteServiceRegistrationImpl registration) {
return new IRemoteServiceUnregisteredEvent() {
public String[] getClazzes() {
@@ -699,16 +702,17 @@ public class RegistrySharedObject extends BaseSharedObject implements IRemoteSer
public String toString() {
StringBuffer buf = new StringBuffer(
"RemoteServiceUnregisteredEvent[");
- buf.append("containerID=").append(
- registration.getContainerID());
+ buf.append("containerID=")
+ .append(registration.getContainerID());
buf.append(";clazzes=").append(
Arrays.asList(registration.getClasses()));
- buf.append(";reference=").append(
- registration.getReference()).append("]");
+ buf.append(";reference=").append(registration.getReference())
+ .append("]");
return buf.toString();
}
};
}
+
/**
* End message send/handlers
*/
@@ -736,14 +740,14 @@ public class RegistrySharedObject extends BaseSharedObject implements IRemoteSer
}
protected void trace(String msg) {
- if (Trace.ON && trace != null)
- trace.msg(msg);
+ Trace.trace(Activator.getDefault(),
+ IRemoteServiceProviderDebugOptions.DEBUG, msg);
}
- protected void traceException(String msg, Throwable t) {
- if (Trace.ON && trace != null) {
- trace.errDumpStack(t, msg);
- }
+ protected void traceException(String methodName, Throwable t) {
+ Trace.catching(Activator.getDefault(),
+ IRemoteServiceProviderDebugOptions.EXCEPTIONS_CATCHING,
+ RegistrySharedObject.class, methodName, t);
}
protected List requests = Collections.synchronizedList(new ArrayList());

Back to the top