Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2009-04-01 14:27:21 -0400
committerslewis2009-04-01 14:27:21 -0400
commit98be8974b7ae66c80d5d85e9560d06942e81975c (patch)
treee6a34bc28dd1dbc87689fc21dc6f3014937df7d7 /providers/bundles/org.eclipse.ecf.provider.filetransfer
parentc81f145b9e573f7efd7fc5db0a4ea719025d152b (diff)
downloadorg.eclipse.ecf-98be8974b7ae66c80d5d85e9560d06942e81975c.tar.gz
org.eclipse.ecf-98be8974b7ae66c80d5d85e9560d06942e81975c.tar.xz
org.eclipse.ecf-98be8974b7ae66c80d5d85e9560d06942e81975c.zip
Added debug and timeout from patch on bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=270644v20090402-1119
Diffstat (limited to 'providers/bundles/org.eclipse.ecf.provider.filetransfer')
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.filetransfer/.options14
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.filetransfer/src/org/eclipse/ecf/internal/provider/filetransfer/DebugOptions.java23
-rw-r--r--providers/bundles/org.eclipse.ecf.provider.filetransfer/src/org/eclipse/ecf/provider/filetransfer/events/socket/SocketEventCreateUtil.java11
3 files changed, 48 insertions, 0 deletions
diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer/.options b/providers/bundles/org.eclipse.ecf.provider.filetransfer/.options
new file mode 100644
index 000000000..82c3af2a8
--- /dev/null
+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer/.options
@@ -0,0 +1,14 @@
+# Debugging options for the org.eclipse.ecf.provider.filetransfer plug-in
+
+# Turn on general debugging for the org.eclipse.ecf.provider.filetransfer plug-in
+org.eclipse.ecf.provider.filetransfer/debug=true
+
+# Trace when exceptions are caught
+org.eclipse.ecf.provider.filetransfer/debug/exceptions/catching=true
+# Trace when exceptions are thrown
+org.eclipse.ecf.provider.filetransfer/debug/exceptions/throwing=true
+
+# Trace when methods are entered
+org.eclipse.ecf.provider.filetransfer/debug/methods/entering=true
+# Trace when methods are exited
+org.eclipse.ecf.provider.filetransfer/debug/methods/exiting=true
diff --git a/providers/bundles/org.eclipse.ecf.provider.filetransfer/src/org/eclipse/ecf/internal/provider/filetransfer/DebugOptions.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer/src/org/eclipse/ecf/internal/provider/filetransfer/DebugOptions.java
new file mode 100644
index 000000000..6eb11bb7a
--- /dev/null
+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer/src/org/eclipse/ecf/internal/provider/filetransfer/DebugOptions.java
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * 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.filetransfer;
+
+public interface DebugOptions {
+
+ 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.filetransfer/src/org/eclipse/ecf/provider/filetransfer/events/socket/SocketEventCreateUtil.java b/providers/bundles/org.eclipse.ecf.provider.filetransfer/src/org/eclipse/ecf/provider/filetransfer/events/socket/SocketEventCreateUtil.java
index 349dceb41..339764473 100644
--- a/providers/bundles/org.eclipse.ecf.provider.filetransfer/src/org/eclipse/ecf/provider/filetransfer/events/socket/SocketEventCreateUtil.java
+++ b/providers/bundles/org.eclipse.ecf.provider.filetransfer/src/org/eclipse/ecf/provider/filetransfer/events/socket/SocketEventCreateUtil.java
@@ -14,10 +14,13 @@ package org.eclipse.ecf.provider.filetransfer.events.socket;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.Socket;
+import org.eclipse.ecf.core.util.Trace;
import org.eclipse.ecf.filetransfer.events.socket.ISocketEvent;
import org.eclipse.ecf.filetransfer.events.socket.ISocketEventSource;
import org.eclipse.ecf.filetransfer.events.socket.ISocketListener;
import org.eclipse.ecf.filetransfer.events.socketfactory.INonconnectedSocketFactory;
+import org.eclipse.ecf.internal.filetransfer.Activator;
+import org.eclipse.ecf.internal.provider.filetransfer.DebugOptions;
public class SocketEventCreateUtil {
@@ -29,19 +32,27 @@ public class SocketEventCreateUtil {
}
public static Socket createSocket(final ISocketListener spyListener, final ISocketEventSource socketEventSource, final INonconnectedSocketFactory unconnectedFactory, final InetSocketAddress remoteInetAddress, final InetSocketAddress localInetAddress, int timeout) throws IOException {
+ Trace.entering(Activator.PLUGIN_ID, DebugOptions.METHODS_ENTERING, SocketEventCreateUtil.class, "createSocket " + remoteInetAddress.toString() + " timeout=" + timeout); //$NON-NLS-1$ //$NON-NLS-2$
+
final Socket factorySocket = unconnectedFactory.createSocket();
fireEvent(spyListener, new SocketCreatedEvent(socketEventSource, factorySocket));
try {
+ Trace.trace(Activator.PLUGIN_ID, "bind(" + localInetAddress.toString() + ")"); //$NON-NLS-1$//$NON-NLS-2$
factorySocket.bind(localInetAddress);
+ Trace.trace(Activator.PLUGIN_ID, "connect(" + remoteInetAddress.toString() + ", " + timeout + ")"); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
factorySocket.connect(remoteInetAddress, timeout);
+ Trace.trace(Activator.PLUGIN_ID, "connected"); //$NON-NLS-1$
} catch (IOException e) {
+ Trace.catching(Activator.PLUGIN_ID, DebugOptions.EXCEPTIONS_CATCHING, SocketEventCreateUtil.class, "createSocket", e); //$NON-NLS-1$
fireEvent(spyListener, new SocketClosedEvent(socketEventSource, factorySocket, factorySocket));
+ Trace.throwing(Activator.PLUGIN_ID, DebugOptions.EXCEPTIONS_THROWING, SocketEventCreateUtil.class, "createSocket", e); //$NON-NLS-1$
throw e;
}
final Socket[] wrap = new Socket[1];
final Socket myWrap = new AbstractSocketWrapper(factorySocket) {
public void close() throws IOException {
try {
+ Trace.trace(Activator.PLUGIN_ID, "closing socket " + this.toString()); //$NON-NLS-1$
super.close();
} finally {
fireEvent(spyListener, new SocketClosedEvent(socketEventSource, factorySocket, wrap[0]));

Back to the top