Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2004-12-31 06:37:52 +0000
committerslewis2004-12-31 06:37:52 +0000
commit588b61050bee3240bc17144bc30ff79b1662b227 (patch)
tree43d2d5bd0641a5a9cccd3971e86d0cfceb960dfb
parent857ca5a5bc3adf9ad65c4770f119dc1d39aef2d2 (diff)
downloadorg.eclipse.ecf-588b61050bee3240bc17144bc30ff79b1662b227.tar.gz
org.eclipse.ecf-588b61050bee3240bc17144bc30ff79b1662b227.tar.xz
org.eclipse.ecf-588b61050bee3240bc17144bc30ff79b1662b227.zip
Updates to test code to allow for multiple server ports during testing. Also added trace code.
-rw-r--r--framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/SharedObjectContainerFactory.java2
-rw-r--r--framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/comm/ConnectionFactory.java22
-rw-r--r--framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/identity/IDFactory.java20
-rw-r--r--framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/internal/core/Trace.java18
4 files changed, 42 insertions, 20 deletions
diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/SharedObjectContainerFactory.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/SharedObjectContainerFactory.java
index 7fbecc2a4..0d6d5c4cb 100644
--- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/SharedObjectContainerFactory.java
+++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/SharedObjectContainerFactory.java
@@ -164,7 +164,7 @@ public class SharedObjectContainerFactory {
public static ISharedObjectContainer makeSharedObjectContainer(
SharedObjectContainerDescription desc, String[] argTypes,
Object[] args) throws SharedObjectContainerInstantiationException {
- debug("makeSharedObjectContainer("+desc+","+argTypes+","+args+")");
+ debug("makeSharedObjectContainer("+desc+","+Trace.convertStringAToString(argTypes)+","+Trace.convertObjectAToString(args)+")");
if (desc == null)
throw new SharedObjectContainerInstantiationException(
"SharedObjectContainerDescription cannot be null");
diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/comm/ConnectionFactory.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/comm/ConnectionFactory.java
index f305a2c12..7240715af 100644
--- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/comm/ConnectionFactory.java
+++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/comm/ConnectionFactory.java
@@ -17,13 +17,28 @@ import java.util.List;
import org.eclipse.ecf.core.comm.provider.ISynchAsynchConnectionInstantiator;
import org.eclipse.ecf.core.util.AbstractFactory;
+import org.eclipse.ecf.internal.core.Trace;
public class ConnectionFactory {
+ private static Trace debug = Trace.create("connectionfactory");
+
private static Hashtable connectiontypes = new Hashtable();
+ private static void debug(String msg) {
+ if (Trace.ON && debug != null) {
+ debug.msg(msg);
+ }
+ }
+
+ private static void dumpStack(String msg, Throwable e) {
+ if (Trace.ON && debug != null) {
+ debug.dumpStack(e, msg);
+ }
+ }
public final static ConnectionDescription getDescription(
ConnectionDescription scd) {
+ debug("getDescription("+scd+")");
return getDescription0(scd);
}
protected static ConnectionDescription getDescription0(
@@ -41,13 +56,16 @@ public class ConnectionFactory {
return (ConnectionDescription) connectiontypes.get(name);
}
public final static ConnectionDescription getDescriptionByName(String name) {
+ debug("getDescriptionByName("+name+")");
return getDescription0(name);
}
public final static ConnectionDescription removeDescription(
ConnectionDescription scd) {
+ debug("removeDescription("+scd+")");
return removeDescription0(scd);
}
public static final List getDescriptions() {
+ debug("getDescriptions()");
return getDescriptions0();
}
@@ -59,6 +77,7 @@ public class ConnectionFactory {
}
public final static ConnectionDescription addDescription(
ConnectionDescription scd) {
+ debug("addDescription("+scd+")");
return addDescription0(scd);
}
@@ -69,6 +88,7 @@ public class ConnectionFactory {
return (ConnectionDescription) connectiontypes.put(n.getName(), n);
}
public final static boolean containsDescription(ConnectionDescription scd) {
+ debug("containsDescription("+scd+")");
return containsDescription0(scd);
}
protected static boolean containsDescription0(ConnectionDescription scd) {
@@ -82,6 +102,7 @@ public class ConnectionFactory {
ConnectionDescription desc, String[] argTypes, Object[] args)
throws ConnectionInstantiationException {
+ debug("makeSynchAsynchConnection("+handler+","+desc+","+Trace.convertStringAToString(argTypes)+","+Trace.convertObjectAToString(args)+")");
if (handler == null)
throw new ConnectionInstantiationException("ISynchAsynchConnectionEventHandler cannot be null");
if (desc == null)
@@ -106,6 +127,7 @@ public class ConnectionFactory {
"Exception getting instantiator for '" + desc.getName()
+ "'", e);
}
+ debug("makeSynchAsynchConnection:got instantiator:"+instantiator);
// Ask instantiator to actually create instance
return instantiator.makeInstance(handler, clazzes, args);
}
diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/identity/IDFactory.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/identity/IDFactory.java
index ee6a32132..a72e2c25b 100644
--- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/identity/IDFactory.java
+++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/identity/IDFactory.java
@@ -183,24 +183,6 @@ public class IDFactory {
logException(s, null);
throw e;
}
- private static String convertStringAToString(String [] strings) {
- if (strings==null) return "";
- StringBuffer sb = new StringBuffer();
- for(int i=0; i < strings.length; i++) {
- sb.append(strings[i]);
- if (i != (strings.length-1)) sb.append(";");
- }
- return sb.toString();
- }
- private static String convertObjectAToString(Object [] objs) {
- if (objs==null) return "";
- StringBuffer sb = new StringBuffer();
- for(int i=0; i < objs.length; i++) {
- sb.append(objs[i].toString());
- if (i != (objs.length-1)) sb.append(";");
- }
- return sb.toString();
- }
/**
* Make a new identity. Given a classloader, Namespace, constructor argument
* types, and an array of arguments, return a new instance of an ID
@@ -219,7 +201,7 @@ public class IDFactory {
*/
public static final ID makeID(Namespace n, String[] argTypes, Object[] args)
throws IDInstantiationException {
- debug("makeID("+n+","+convertStringAToString(argTypes)+","+convertObjectAToString(args)+")");
+ debug("makeID("+n+","+Trace.convertStringAToString(argTypes)+","+Trace.convertObjectAToString(args)+")");
// Verify namespace is non-null
if (n == null)
logAndThrow("Namespace cannot be null");
diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/internal/core/Trace.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/internal/core/Trace.java
index bc93b3511..e10712415 100644
--- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/internal/core/Trace.java
+++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/internal/core/Trace.java
@@ -72,6 +72,24 @@ public class Trace {
protected Trace(String str) {
name = str;
}
+ public static String convertStringAToString(String [] strings) {
+ if (strings==null) return "";
+ StringBuffer sb = new StringBuffer();
+ for(int i=0; i < strings.length; i++) {
+ sb.append(strings[i]);
+ if (i != (strings.length-1)) sb.append(";");
+ }
+ return sb.toString();
+ }
+ public static String convertObjectAToString(Object [] objs) {
+ if (objs==null) return "";
+ StringBuffer sb = new StringBuffer();
+ for(int i=0; i < objs.length; i++) {
+ sb.append(objs[i].toString());
+ if (i != (objs.length-1)) sb.append(";");
+ }
+ return sb.toString();
+ }
public static void setThreadDebugGroup(Object obj) {
// Do nothing

Back to the top