Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2013-02-18 02:22:32 -0500
committerUwe Stieber2013-02-18 03:02:41 -0500
commitf4cafbc48cd36b0d43a94075d202f6678206d4ed (patch)
tree58e343ac7dd3e4aabbf275fe9147f9f0d214e5fc /target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src
parentfaa831aa55d496d33b800bad15f7bdcf4eea13a6 (diff)
downloadorg.eclipse.tcf-f4cafbc48cd36b0d43a94075d202f6678206d4ed.tar.gz
org.eclipse.tcf-f4cafbc48cd36b0d43a94075d202f6678206d4ed.tar.xz
org.eclipse.tcf-f4cafbc48cd36b0d43a94075d202f6678206d4ed.zip
Target Explorer: Initial definition of the connection service
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/interfaces/IConnectionService.java68
1 files changed, 68 insertions, 0 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/interfaces/IConnectionService.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/interfaces/IConnectionService.java
new file mode 100644
index 000000000..ec375ffa1
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/interfaces/IConnectionService.java
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Wind River Systems, 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:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.runtime.services.interfaces;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
+
+/**
+ * Connection service.
+ * <p>
+ * Allows to connect or disconnect to a given connectable context.
+ */
+public interface IConnectionService extends IService {
+
+ /**
+ * The constants for the (cached) connection state.
+ */
+ public enum State { Disconnected, Connecting, Connected, Disconnecting }
+
+ /**
+ * Returns the connection state of the given connectable context.
+ *
+ * @param context The connectable context. Must not be <code>null</code>.
+ * @return The connection state.
+ */
+ public State getState(Object context);
+
+ /**
+ * Connects the given connectable context.
+ * <p>
+ * If the given context is in connecting state, the callback is invoked once the
+ * connectable enters the connected state.
+ * <p>
+ * If the given context is in connected state, the callback is invoked immediately.
+ * <p>
+ * If the given context is in disconnecting state, the callback is invoked immediately
+ * with an cancel status.
+ *
+ * @param context The connectable context. Must not be <code>null</code>.
+ * @param callback The callback. Must not be <code>null</code>.
+ * @param monitor The progress monitor or <code>null</code>.
+ */
+ public void connect(Object context, ICallback callback, IProgressMonitor monitor);
+
+ /**
+ * Disconnects the given connectable context.
+ * <p>
+ * If the given context is in disconnecting state, the callback is invoked once the
+ * connectable enters the disconnected state.
+ * <p>
+ * If the given context is in disconnected state, the callback is invoked immediately.
+ * <p>
+ * If the given context is in connecting state, the connect sequence is aborted and
+ * rolled back. The callback is invoked once the connectable enters the disconnected state.
+ *
+ * @param context The connectable context. Must not be <code>null</code>.
+ * @param callback The callback. Must not be <code>null</code>.
+ * @param monitor The progress monitor or <code>null</code>.
+ */
+ public void disconnect(Object context, ICallback callback, IProgressMonitor monitor);
+}

Back to the top