Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2006-10-30 02:35:18 +0000
committerslewis2006-10-30 02:35:18 +0000
commitbf3498c214d93cec972d62e57ca6ed3a8ff5fbae (patch)
tree031043a343485bd442305db27baa860d45a6c253 /framework/bundles/org.eclipse.ecf.discovery/src
parentc976758c84de8e29b349eb5934e949a10c695d4a (diff)
downloadorg.eclipse.ecf-bf3498c214d93cec972d62e57ca6ed3a8ff5fbae.tar.gz
org.eclipse.ecf-bf3498c214d93cec972d62e57ca6ed3a8ff5fbae.tar.xz
org.eclipse.ecf-bf3498c214d93cec972d62e57ca6ed3a8ff5fbae.zip
Moved DiscoveryPlugin to internal package. Removed Trace and .options file
Diffstat (limited to 'framework/bundles/org.eclipse.ecf.discovery/src')
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/Trace.java125
-rw-r--r--framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/internal/discovery/DiscoveryPlugin.java (renamed from framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/DiscoveryPlugin.java)2
2 files changed, 1 insertions, 126 deletions
diff --git a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/Trace.java b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/Trace.java
deleted file mode 100644
index a5c22eaae..000000000
--- a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/Trace.java
+++ /dev/null
@@ -1,125 +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.discovery;
-
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import org.eclipse.core.runtime.Platform;
-
-public class Trace {
- public static final String tracePrefix = "(trace)";
-
- public static boolean ON = false;
- protected static boolean isEclipse = false;
- protected static String pluginName = "";
- protected static String debugPrefix = "/debug/";
- static {
- try {
- ON = Platform.inDebugMode();
- String bundleName = DiscoveryPlugin.getDefault().getBundle().getSymbolicName();
- String val = System.getProperty(bundleName+".Trace");
- if (val != null) {
- setTrace(true);
- isEclipse = false;
- // No eclipse Platform available
- System.out.println("WARNING: Eclipse platform not available for trace...overridden by system property org.eclipse.ecf.Trace");
- } else {
- isEclipse = true;
- pluginName = bundleName;
- }
- } catch (Exception e) {
- try {
- String val = System.getProperty("org.eclipse.ecf.discovery.Trace");
- if (val != null) {
- setTrace(true);
- isEclipse = false;
- // No eclipse Platform available
- System.out.println("WARNING: Eclipse platform not available for trace...using system.out for org.eclipse.ecf");
- } else {
- System.out.println(Trace.class.getName()+": OFF");
- }
- } catch (Exception except) {
- }
- }
- }
- public static void setTrace(boolean on) {
- ON = on;
- }
-
- 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);
- e.printStackTrace(System.err);
- }
-
- public void msg(String msg) {
- StringBuffer sb = new StringBuffer(name);
- sb.append(getTimeString()).append(msg);
- System.out.println(sb.toString());
- }
-
- 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;
- }
- public static String convertStringAToString(String [] strings) {
- if (strings==null) return "";
- StringBuffer sb = new StringBuffer();
- for(int i=0; i < strings.length; i++) {
- if (strings[i]==null) sb.append("(null)");
- else 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++) {
- if (objs[i]==null) sb.append("(null)");
- else sb.append(objs[i].toString());
- if (i != (objs.length-1)) sb.append(";");
- }
- return sb.toString();
- }
-
- public static void setThreadDebugGroup(Object obj) {
- // Do nothing
- }
-} \ No newline at end of file
diff --git a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/DiscoveryPlugin.java b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/internal/discovery/DiscoveryPlugin.java
index 1433e0fa8..1867089a3 100644
--- a/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/discovery/DiscoveryPlugin.java
+++ b/framework/bundles/org.eclipse.ecf.discovery/src/org/eclipse/ecf/internal/discovery/DiscoveryPlugin.java
@@ -7,7 +7,7 @@
* Contributors: Composent, Inc. - initial API and implementation
******************************************************************************/
-package org.eclipse.ecf.discovery;
+package org.eclipse.ecf.internal.discovery;
import org.eclipse.core.runtime.Plugin;
import org.osgi.framework.BundleContext;

Back to the top