Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'target_explorer/plugins')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.core.scripting/src/org/eclipse/tcf/te/tcf/core/scripting/launcher/ScriptLauncher.java6
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/interfaces/IChannelManager.java34
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/internal/ChannelManager.java30
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/nls/Messages.properties2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem/src/org/eclipse/tcf/te/tcf/filesystem/internal/operations/FSOperation.java16
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem/src/org/eclipse/tcf/te/tcf/filesystem/model/FSModel.java22
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/OpenChannelStep.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/launcher/ProcessLauncher.java4
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/handler/AbstractChannelCommandHandler.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/model/ProcessModel.java52
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/model/steps/AttachStep.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/model/steps/DetachStep.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/model/steps/TerminateStep.java4
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.terminals.core/src/org/eclipse/tcf/te/tcf/terminals/core/launcher/TerminalsLauncher.java5
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/tcf/filesystem/callbacks/QueryChildrenCallbackTest.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/tcf/tests/TcfCoreTests.java6
16 files changed, 109 insertions, 82 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core.scripting/src/org/eclipse/tcf/te/tcf/core/scripting/launcher/ScriptLauncher.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core.scripting/src/org/eclipse/tcf/te/tcf/core/scripting/launcher/ScriptLauncher.java
index 4f1f44f26..d8bab60e9 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core.scripting/src/org/eclipse/tcf/te/tcf/core/scripting/launcher/ScriptLauncher.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core.scripting/src/org/eclipse/tcf/te/tcf/core/scripting/launcher/ScriptLauncher.java
@@ -10,6 +10,8 @@
package org.eclipse.tcf.te.tcf.core.scripting.launcher;
import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IStatus;
@@ -108,7 +110,9 @@ public class ScriptLauncher extends PlatformObject implements IScriptLauncher {
this.properties = properties;
// Open a dedicated channel to the given peer
- Tcf.getChannelManager().openChannel(peer, true, new IChannelManager.DoneOpenChannel() {
+ Map<String, Boolean> flags = new HashMap<String, Boolean>();
+ flags.put(IChannelManager.FLAG_FORCE_NEW, Boolean.TRUE);
+ Tcf.getChannelManager().openChannel(peer, flags, new IChannelManager.DoneOpenChannel() {
/* (non-Javadoc)
* @see org.eclipse.tcf.te.tcf.core.interfaces.IChannelManager.DoneOpenChannel#doneOpenChannel(java.lang.Throwable, org.eclipse.tcf.protocol.IChannel)
*/
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/interfaces/IChannelManager.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/interfaces/IChannelManager.java
index 735a9605d..9c5f5431c 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/interfaces/IChannelManager.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/interfaces/IChannelManager.java
@@ -21,6 +21,26 @@ import org.eclipse.tcf.protocol.IPeer;
public interface IChannelManager extends IAdaptable {
/**
+ * If set to <code>true</code>, a new and not reference counted channel is opened.
+ * The returned channel must be closed by the caller himself. The channel manager
+ * is not keeping track of non reference counted channels.
+ * <p>
+ * If not present in the flags map passed in to open channel, the default value is
+ * <code>false</code>.
+ */
+ public static final String FLAG_FORCE_NEW = "forceNew"; //$NON-NLS-1$
+
+ /**
+ * If set to <code>true</code>, the channel is opened if necessary, but no value
+ * add is launched and associated with the channel. This option should be used
+ * with extreme caution.
+ * <p>
+ * If not present in the flags map passed in to open channel, the default value is
+ * <code>false</code>.
+ */
+ public static final String FLAG_NO_VALUE_ADD = "noValueAdd"; //$NON-NLS-1$
+
+ /**
* Client call back interface for openChannel(...).
*/
interface DoneOpenChannel {
@@ -36,34 +56,28 @@ public interface IChannelManager extends IAdaptable {
/**
* Opens a new channel to communicate with the given peer.
* <p>
- * If <code>forceNew</code> is <code>true</code>, a new and not reference counted channel is
- * opened and returned. The returned channel must be closed by the caller himself. The channel
- * manager is not keeping track of non reference counted channels.
- * <p>
* Reference counted channels are cached by the channel manager and must be closed via {@link #closeChannel(IChannel)}.
* <p>
* The method can be called from any thread context.
*
* @param peer The peer. Must not be <code>null</code>.
+ * @param flags Map containing the flags to parameterize the channel opening, or <code>null</code>.
* @param done The client callback. Must not be <code>null</code>.
*/
- public void openChannel(IPeer peer, boolean forceNew, DoneOpenChannel done);
+ public void openChannel(IPeer peer, Map<String, Boolean> flags, DoneOpenChannel done);
/**
* Opens a new channel to communicate with the peer described by the given peer attributes.
* <p>
- * If <code>forceNew</code> is <code>true</code>, a new and not reference counted channel is
- * opened and returned. The returned channel must be closed by the caller himself. The channel
- * manager is not keeping track of non reference counted channels.
- * <p>
* Reference counted channels are cached by the channel manager and must be closed via {@link #closeChannel(IChannel)}.
* <p>
* The method can be called from any thread context.
*
* @param peerAttributes The peer attributes. Must not be <code>null</code>.
+ * @param flags Map containing the flags to parameterize the channel opening, or <code>null</code>.
* @param done The client callback. Must not be <code>null</code>.
*/
- public void openChannel(Map<String, String> peerAttributes, boolean forceNew, DoneOpenChannel done);
+ public void openChannel(Map<String, String> peerAttributes, Map<String, Boolean> flags, DoneOpenChannel done);
/**
* Returns the shared channel instance for the given peer. Channels retrieved using this
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/internal/ChannelManager.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/internal/ChannelManager.java
index 2fbb73529..b71f80f43 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/internal/ChannelManager.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/internal/ChannelManager.java
@@ -98,14 +98,14 @@ public final class ChannelManager extends PlatformObject implements IChannelMana
}
/* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.core.interfaces.IChannelManager#openChannel(org.eclipse.tcf.protocol.IPeer, boolean, org.eclipse.tcf.te.tcf.core.interfaces.IChannelManager.DoneOpenChannel)
+ * @see org.eclipse.tcf.te.tcf.core.interfaces.IChannelManager#openChannel(org.eclipse.tcf.protocol.IPeer, java.util.Map, org.eclipse.tcf.te.tcf.core.interfaces.IChannelManager.DoneOpenChannel)
*/
@Override
- public void openChannel(final IPeer peer, final boolean forceNew, final DoneOpenChannel done) {
+ public void openChannel(final IPeer peer, final Map<String, Boolean> flags, final DoneOpenChannel done) {
Runnable runnable = new Runnable() {
@Override
public void run() {
- internalOpenChannel(peer, forceNew, done);
+ internalOpenChannel(peer, flags, done);
}
};
if (Protocol.isDispatchThread()) runnable.run();
@@ -115,18 +115,15 @@ public final class ChannelManager extends PlatformObject implements IChannelMana
/**
* Internal implementation of {@link #openChannel(IPeer, org.eclipse.tcf.te.tcf.core.interfaces.IChannelManager.DoneOpenChannel)}.
* <p>
- * If <code>forceNew</code> is <code>true</code>, a new and not reference counted channel is opened and returned. The returned
- * channel must be closed by the caller himself. The channel manager is not keeping track of non reference counted channels.
- * <p>
* Reference counted channels are cached by the channel manager and must be closed via {@link #closeChannel(IChannel)} .
* <p>
* Method must be called within the TCF dispatch thread.
*
* @param peer The peer. Must not be <code>null</code>.
- * @param forceNew Specify <code>true</code> to force opening a new channel, <code>false</code> otherwise.
+ * @param flags Map containing the flags to parameterize the channel opening, or <code>null</code>.
* @param done The client callback. Must not be <code>null</code>.
*/
- /* default */ void internalOpenChannel(final IPeer peer, final boolean forceNew, final DoneOpenChannel done) {
+ /* default */ void internalOpenChannel(final IPeer peer, final Map<String, Boolean> flags, final DoneOpenChannel done) {
Assert.isNotNull(peer);
Assert.isNotNull(done);
Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
@@ -138,10 +135,13 @@ public final class ChannelManager extends PlatformObject implements IChannelMana
final String id = peer.getID();
if (CoreBundleActivator.getTraceHandler().isSlotEnabled(0, ITraceIds.TRACE_CHANNEL_MANAGER)) {
- CoreBundleActivator.getTraceHandler().trace(NLS.bind(Messages.ChannelManager_openChannel_message, id, Boolean.valueOf(forceNew)),
+ CoreBundleActivator.getTraceHandler().trace(NLS.bind(Messages.ChannelManager_openChannel_message, id, flags),
0, ITraceIds.TRACE_CHANNEL_MANAGER, IStatus.INFO, this);
}
+ // Extract the flags of interest form the given flags map
+ boolean forceNew = flags != null && flags.containsKey(IChannelManager.FLAG_FORCE_NEW) ? flags.get(IChannelManager.FLAG_FORCE_NEW).booleanValue() : false;
+
// Check if there is already a channel opened to this peer
channel = !forceNew ? channels.get(id) : null;
if (channel != null && (channel.getState() == IChannel.STATE_OPEN || channel.getState() == IChannel.STATE_OPENING)) {
@@ -253,14 +253,14 @@ public final class ChannelManager extends PlatformObject implements IChannelMana
}
/* (non-Javadoc)
- * @see org.eclipse.tcf.te.tcf.core.interfaces.IChannelManager#openChannel(java.util.Map, boolean, org.eclipse.tcf.te.tcf.core.interfaces.IChannelManager.DoneOpenChannel)
+ * @see org.eclipse.tcf.te.tcf.core.interfaces.IChannelManager#openChannel(java.util.Map, java.util.Map, org.eclipse.tcf.te.tcf.core.interfaces.IChannelManager.DoneOpenChannel)
*/
@Override
- public void openChannel(final Map<String, String> peerAttributes, final boolean forceNew, final DoneOpenChannel done) {
+ public void openChannel(final Map<String, String> peerAttributes, final Map<String, Boolean> flags, final DoneOpenChannel done) {
Runnable runnable = new Runnable() {
@Override
public void run() {
- internalOpenChannel(peerAttributes, forceNew, done);
+ internalOpenChannel(peerAttributes, flags, done);
}
};
if (Protocol.isDispatchThread()) runnable.run();
@@ -273,14 +273,14 @@ public final class ChannelManager extends PlatformObject implements IChannelMana
* Method must be called within the TCF dispatch thread.
*
* @param peerAttributes The peer attributes. Must not be <code>null</code>.
- * @param forceNew Specify <code>true</code> to force opening a new channel, <code>false</code> otherwise.
+ * @param flags Map containing the flags to parameterize the channel opening, or <code>null</code>.
* @param done The client callback. Must not be <code>null</code>.
*/
- /* default */ void internalOpenChannel(final Map<String, String> peerAttributes, final boolean forceNew, final DoneOpenChannel done) {
+ /* default */ void internalOpenChannel(final Map<String, String> peerAttributes, final Map<String, Boolean> flags, final DoneOpenChannel done) {
Assert.isNotNull(peerAttributes);
Assert.isNotNull(done);
Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
- internalOpenChannel(getOrCreatePeerInstance(peerAttributes), forceNew, done);
+ internalOpenChannel(getOrCreatePeerInstance(peerAttributes), flags, done);
}
/**
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/nls/Messages.properties b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/nls/Messages.properties
index 074a24a6d..d2c944354 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/nls/Messages.properties
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/nls/Messages.properties
@@ -8,7 +8,7 @@ InternalChannelOpenListener_onChannelOpen_message=Channel opened.
InternalChannelListener_onChannelClosed_message=Channel closed. {0}
InternalChannelListener_onChannelClosed_cause=; Possibly caused by: {0}
-ChannelManager_openChannel_message=Request to open channel. Peer id = {0}, forceNew = {1}
+ChannelManager_openChannel_message=Request to open channel. Peer id = {0}, flags = {1}
ChannelManager_openChannel_reuse_message=Reusing already opened channel. Peer id = {0}, new reference count = {1}
ChannelManager_openChannel_new_message=Opening new channel. Peer id = {0}
ChannelManager_openChannel_success_message=Opening channel succeeded. Peer id = {0}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem/src/org/eclipse/tcf/te/tcf/filesystem/internal/operations/FSOperation.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem/src/org/eclipse/tcf/te/tcf/filesystem/internal/operations/FSOperation.java
index 1b69ca3ce..84495a5ff 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem/src/org/eclipse/tcf/te/tcf/filesystem/internal/operations/FSOperation.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem/src/org/eclipse/tcf/te/tcf/filesystem/internal/operations/FSOperation.java
@@ -122,11 +122,11 @@ public class FSOperation implements IRunnableWithProgress{
parent.removeChild(node);
}
}
-
+
/**
* Check if the file exists and delete if it does. Record
* the failure message if deleting fails.
- *
+ *
* @param file The file to be deleted.
*/
protected void deleteFileChecked(final File file) {
@@ -209,7 +209,7 @@ public class FSOperation implements IRunnableWithProgress{
channelManager = BlockingCallProxy.newInstance(IChannelManager.class, channelManager);
final TCFChannelException[] errors = new TCFChannelException[1];
final IChannel[] channels = new IChannel[1];
- channelManager.openChannel(peer, false, new DoneOpenChannel() {
+ channelManager.openChannel(peer, null, new DoneOpenChannel() {
@Override
public void doneOpenChannel(Throwable error, IChannel channel) {
if (error != null) {
@@ -234,15 +234,15 @@ public class FSOperation implements IRunnableWithProgress{
}
/**
- * Get a blocking file system service from the channel. The
- * returned file system service is a service that delegates the
+ * Get a blocking file system service from the channel. The
+ * returned file system service is a service that delegates the
* method call to the file system proxy. If the method returns
* asynchronously with a callback, it will block the call until
* the callback returns.
* <p>
- * <em>Note: All the method of the returned file system
+ * <em>Note: All the method of the returned file system
* service must be called outside of the dispatching thread.</em>
- *
+ *
* @param channel The channel to get the file system service.
* @return The blocking file system service.
*/
@@ -302,7 +302,7 @@ public class FSOperation implements IRunnableWithProgress{
/**
* Get the children the specified folder node. If the folder has not yet been loaded, then load it.
- *
+ *
* @param node The folder node.
* @return The children of the folder node.
* @throws TCFException Thrown during querying the children nodes.
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem/src/org/eclipse/tcf/te/tcf/filesystem/model/FSModel.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem/src/org/eclipse/tcf/te/tcf/filesystem/model/FSModel.java
index e78fe0371..ac30354e5 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem/src/org/eclipse/tcf/te/tcf/filesystem/model/FSModel.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem/src/org/eclipse/tcf/te/tcf/filesystem/model/FSModel.java
@@ -39,7 +39,7 @@ public final class FSModel {
/**
* Get the file system model of the peer model. If it does not
* exist yet, create a new instance and store it.
- *
+ *
* @param peerModel The peer model
* @return The file system model connected this peer model.
*/
@@ -75,7 +75,7 @@ public final class FSModel {
/**
* Get the root node of the peer model.
- *
+ *
* @return The root node.
*/
public FSTreeNode getRoot() {
@@ -84,7 +84,7 @@ public final class FSModel {
/**
* Set the root node of the peer model.
- *
+ *
* @param root The root node
*/
public void setRoot(FSTreeNode root) {
@@ -93,9 +93,9 @@ public final class FSModel {
/**
* Get the corresponding FSTreeNode based on the path of the local cache file.
- *
+ *
* @param filePath The local cache's file path.
- * @return The FSTreeNode.
+ * @return The FSTreeNode.
*/
public static FSTreeNode getTreeNode(String filePath) {
String cache_root = CacheManager.getInstance().getCacheRoot().getAbsolutePath();
@@ -149,7 +149,7 @@ public final class FSModel {
/**
* Find the tree node in the peer's file system tree.
- *
+ *
* @param peer The peer model.
* @param path The relative path to the cache file.
* @return The FSTreeNode corresponding to this file.
@@ -185,7 +185,7 @@ public final class FSModel {
/**
* Search the path in the children list. If it exists, then search the children of the found
* node recursively until the whole path is found. Or else return null.
- *
+ *
* @param children The children nodes to search the path.
* @param path The path to be searched.
* @return The leaf node that has the searched path.
@@ -232,7 +232,7 @@ public final class FSModel {
/**
* Find in the children array the node that has the specified name.
- *
+ *
* @param children The children array in which to find the node.
* @param name The name of the node to be searched.
* @return The node that has the specified name.
@@ -249,7 +249,7 @@ public final class FSModel {
/**
* Create a root node for the specified peer.
- *
+ *
* @param peerNode The peer.
*/
public void createRoot(final IPeerModel peerNode) {
@@ -268,12 +268,12 @@ public final class FSModel {
/**
* Query the children of the given file system node.
- *
+ *
* @param parentNode The file system node. Must not be <code>null</code>.
*/
public void queryChildren(FSTreeNode parentNode) {
Assert.isNotNull(parentNode);
parentNode.queryStarted();
- Tcf.getChannelManager().openChannel(parentNode.peerNode.getPeer(), false, new QueryDoneOpenChannel(parentNode));
+ Tcf.getChannelManager().openChannel(parentNode.peerNode.getPeer(), null, new QueryDoneOpenChannel(parentNode));
}
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/OpenChannelStep.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/OpenChannelStep.java
index 823f34fe3..9de321564 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/OpenChannelStep.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.core/src/org/eclipse/tcf/te/tcf/launch/core/steps/OpenChannelStep.java
@@ -44,7 +44,7 @@ public class OpenChannelStep extends AbstractTcfLaunchStep {
*/
@Override
public void execute(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor, final ICallback callback) {
- Tcf.getChannelManager().openChannel(getActivePeerModel(data).getPeer(), false, new IChannelManager.DoneOpenChannel() {
+ Tcf.getChannelManager().openChannel(getActivePeerModel(data).getPeer(), null, new IChannelManager.DoneOpenChannel() {
@Override
public void doneOpenChannel(final Throwable error, final IChannel channel) {
callback.done(OpenChannelStep.this, StatusHelper.getStatus(error));
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/launcher/ProcessLauncher.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/launcher/ProcessLauncher.java
index a4b3df965..9b53fcfd8 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/launcher/ProcessLauncher.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/launcher/ProcessLauncher.java
@@ -323,7 +323,9 @@ public class ProcessLauncher extends PlatformObject implements IProcessLauncher
this.properties = properties;
// Open a dedicated channel to the given peer
- Tcf.getChannelManager().openChannel(peer, true, new IChannelManager.DoneOpenChannel() {
+ Map<String, Boolean> flags = new HashMap<String, Boolean>();
+ flags.put(IChannelManager.FLAG_FORCE_NEW, Boolean.TRUE);
+ Tcf.getChannelManager().openChannel(peer, flags, new IChannelManager.DoneOpenChannel() {
/* (non-Javadoc)
* @see org.eclipse.tcf.te.tcf.core.interfaces.IChannelManager.DoneOpenChannel#doneOpenChannel(java.lang.Throwable, org.eclipse.tcf.protocol.IChannel)
*/
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/handler/AbstractChannelCommandHandler.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/handler/AbstractChannelCommandHandler.java
index ceb9b4d10..396c827fd 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/handler/AbstractChannelCommandHandler.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/handler/AbstractChannelCommandHandler.java
@@ -62,7 +62,7 @@ public abstract class AbstractChannelCommandHandler extends AbstractHandler {
// If the peer is available, we can open a channel to the remote peer
if (peer != null) {
// Get the channel
- Tcf.getChannelManager().openChannel(peer, false, new IChannelManager.DoneOpenChannel() {
+ Tcf.getChannelManager().openChannel(peer, null, new IChannelManager.DoneOpenChannel() {
@Override
public void doneOpenChannel(final Throwable error, final IChannel channel) {
if (error == null) {
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/model/ProcessModel.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/model/ProcessModel.java
index 18bb108ba..9a3051f62 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/model/ProcessModel.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/model/ProcessModel.java
@@ -39,8 +39,8 @@ public class ProcessModel implements IPreferenceConsts{
/**
* Get the process model stored in the peer model.
- * If there's no process model yet, create a new process model.
- *
+ * If there's no process model yet, create a new process model.
+ *
* @param peerModel The target's peer model.
* @return The process model representing the process.
*/
@@ -65,7 +65,7 @@ public class ProcessModel implements IPreferenceConsts{
}
return null;
}
-
+
// The root node of the peer model
private ProcessTreeNode root;
// The polling interval in seconds. If it is zero, then stop polling periodically.
@@ -86,7 +86,7 @@ public class ProcessModel implements IPreferenceConsts{
/**
* Get the root node of the peer model.
- *
+ *
* @return The root node.
*/
public ProcessTreeNode getRoot() {
@@ -95,7 +95,7 @@ public class ProcessModel implements IPreferenceConsts{
/**
* Set the root node of the peer model.
- *
+ *
* @param root The root node
*/
public void createRoot(IPeerModel peerModel ) {
@@ -112,9 +112,9 @@ public class ProcessModel implements IPreferenceConsts{
}
/**
- * Set the status of the polling and
+ * Set the status of the polling and
* fire a property change event.
- *
+ *
* @param stopped if the polling should be stopped.
*/
void setStopped(boolean stopped) {
@@ -158,10 +158,10 @@ public class ProcessModel implements IPreferenceConsts{
}};
pollingTimer.schedule(pollingTask, interval * 1000L);
}
-
+
/**
- * Set new interval.
- *
+ * Set new interval.
+ *
* @param interval The new interval.
*/
public void setInterval(int interval) {
@@ -181,7 +181,7 @@ public class ProcessModel implements IPreferenceConsts{
/**
* Get the current interval.
- *
+ *
* @return the current interval.
*/
public int getInterval() {
@@ -190,31 +190,31 @@ public class ProcessModel implements IPreferenceConsts{
/**
* Query the children of the given process context.
- *
+ *
* @param parentNode The process context node. Must not be <code>null</code>.
*/
public void queryChildren(ProcessTreeNode parentNode) {
Assert.isNotNull(parentNode);
parentNode.childrenQueryRunning = true;
- Tcf.getChannelManager().openChannel(parentNode.peerNode.getPeer(), false, new QueryDoneOpenChannel(parentNode));
+ Tcf.getChannelManager().openChannel(parentNode.peerNode.getPeer(), null, new QueryDoneOpenChannel(parentNode));
}
/**
* Recursively refresh the children of the given process context with a callback, which is
* called when whole process is finished.
- *
+ *
* @param parentNode The process context node. Must not be <code>null</code>.
* @param callback The callback object, or <code>null</code> when callback is not needed.
*/
public void refresh(final ProcessTreeNode parentNode, final ICallback callback) {
Assert.isNotNull(parentNode);
parentNode.childrenQueryRunning = true;
- Tcf.getChannelManager().openChannel(parentNode.peerNode.getPeer(), false, new RefreshDoneOpenChannel(callback, parentNode));
+ Tcf.getChannelManager().openChannel(parentNode.peerNode.getPeer(), null, new RefreshDoneOpenChannel(callback, parentNode));
}
/**
* Recursively refresh the children of the given process context.
- *
+ *
* @param parentNode The process context node. Must not be <code>null</code>.
*/
public void refresh(final ProcessTreeNode parentNode) {
@@ -224,7 +224,7 @@ public class ProcessModel implements IPreferenceConsts{
/**
* Recursively refresh the tree from the root node with a callback, which
* is called when the whole process is finished.
- *
+ *
* @param callback The callback object or <code>null</code> when callback is not needed.
*/
public void refresh(ICallback callback) {
@@ -246,11 +246,11 @@ public class ProcessModel implements IPreferenceConsts{
refresh(this.root, null);
}
}
-
+
/**
- * Update the most recently used interval adding
+ * Update the most recently used interval adding
* a new interval.
- *
+ *
* @param interval The new interval.
*/
public void addMRUInterval(int interval){
@@ -290,16 +290,16 @@ public class ProcessModel implements IPreferenceConsts{
/**
* If the polling has been stopped.
- *
+ *
* @return true if it is stopped.
*/
public boolean isRefreshStopped() {
return stopped;
}
-
+
/**
* Get the peer model associated with this model.
- *
+ *
* @return The peer model.
*/
IPeerModel getPeerModel() {
@@ -308,12 +308,12 @@ public class ProcessModel implements IPreferenceConsts{
/**
* Refresh the children without refreshing itself.
- *
+ *
* @param parentNode The parent whose children are to be refreshed.
*/
public void refreshChildren(ProcessTreeNode parentNode) {
Assert.isNotNull(parentNode);
- Tcf.getChannelManager().openChannel(parentNode.peerNode.getPeer(), false, new RefreshChildrenDoneOpenChannel(parentNode));
+ Tcf.getChannelManager().openChannel(parentNode.peerNode.getPeer(), null, new RefreshChildrenDoneOpenChannel(parentNode));
}
-}
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/model/steps/AttachStep.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/model/steps/AttachStep.java
index 1a0162fe4..5a586b92e 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/model/steps/AttachStep.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/model/steps/AttachStep.java
@@ -103,7 +103,7 @@ public class AttachStep {
Assert.isNotNull(node);
// Open a channel
- Tcf.getChannelManager().openChannel(node.peerNode.getPeer(), false, new IChannelManager.DoneOpenChannel() {
+ Tcf.getChannelManager().openChannel(node.peerNode.getPeer(), null, new IChannelManager.DoneOpenChannel() {
@Override
public void doneOpenChannel(final Throwable error, final IChannel channel) {
if (error == null) {
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/model/steps/DetachStep.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/model/steps/DetachStep.java
index 9a56e3939..7d0ca2a02 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/model/steps/DetachStep.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/model/steps/DetachStep.java
@@ -80,7 +80,7 @@ public class DetachStep {
Assert.isNotNull(node);
// Open a channel
- Tcf.getChannelManager().openChannel(node.peerNode.getPeer(), false, new IChannelManager.DoneOpenChannel() {
+ Tcf.getChannelManager().openChannel(node.peerNode.getPeer(), null, new IChannelManager.DoneOpenChannel() {
@Override
public void doneOpenChannel(final Throwable error, final IChannel channel) {
if (error == null) {
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/model/steps/TerminateStep.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/model/steps/TerminateStep.java
index 39c132ce5..de3f410ed 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/model/steps/TerminateStep.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/model/steps/TerminateStep.java
@@ -55,7 +55,7 @@ public class TerminateStep {
} else {
onError(node, Messages.DetachStep_error_disconnect, null, callback);
}
- }
+ }
else {
onError(node, Messages.DetachStep_error_disconnect, null, callback);
}
@@ -75,7 +75,7 @@ public class TerminateStep {
Assert.isNotNull(node);
// Open a channel
- Tcf.getChannelManager().openChannel(node.peerNode.getPeer(), false, new IChannelManager.DoneOpenChannel() {
+ Tcf.getChannelManager().openChannel(node.peerNode.getPeer(), null, new IChannelManager.DoneOpenChannel() {
@Override
public void doneOpenChannel(final Throwable error, final IChannel channel) {
if (error == null) {
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.terminals.core/src/org/eclipse/tcf/te/tcf/terminals/core/launcher/TerminalsLauncher.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.terminals.core/src/org/eclipse/tcf/te/tcf/terminals/core/launcher/TerminalsLauncher.java
index 317ab66a3..27ad44d86 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.terminals.core/src/org/eclipse/tcf/te/tcf/terminals/core/launcher/TerminalsLauncher.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.terminals.core/src/org/eclipse/tcf/te/tcf/terminals/core/launcher/TerminalsLauncher.java
@@ -21,6 +21,7 @@ import java.io.PipedOutputStream;
import java.text.DateFormat;
import java.util.ArrayList;
import java.util.Date;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicReference;
@@ -247,7 +248,9 @@ public class TerminalsLauncher extends PlatformObject implements ITerminalsLaunc
this.properties = properties;
// Open a dedicated channel to the given peer
- Tcf.getChannelManager().openChannel(peer, true, new IChannelManager.DoneOpenChannel() {
+ Map<String, Boolean> flags = new HashMap<String, Boolean>();
+ flags.put(IChannelManager.FLAG_FORCE_NEW, Boolean.TRUE);
+ Tcf.getChannelManager().openChannel(peer, flags, new IChannelManager.DoneOpenChannel() {
/* (non-Javadoc)
* @see org.eclipse.tcf.te.tcf.core.interfaces.IChannelManager.DoneOpenChannel#doneOpenChannel(java.lang.Throwable, org.eclipse.tcf.protocol.IChannel)
*/
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/tcf/filesystem/callbacks/QueryChildrenCallbackTest.java b/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/tcf/filesystem/callbacks/QueryChildrenCallbackTest.java
index 872127804..bfec631d8 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/tcf/filesystem/callbacks/QueryChildrenCallbackTest.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/tcf/filesystem/callbacks/QueryChildrenCallbackTest.java
@@ -31,7 +31,7 @@ public class QueryChildrenCallbackTest extends FSPeerTestCase {
statusRef.set(status);
}
};
- Tcf.getChannelManager().openChannel(peer, false, new QueryDoneOpenChannel(testRoot,callback));
+ Tcf.getChannelManager().openChannel(peer, null, new QueryDoneOpenChannel(testRoot,callback));
waitAndDispatch(0, callback.getDoneConditionTester(new NullProgressMonitor()));
assertTrue(statusRef.get().isOK());
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/tcf/tests/TcfCoreTests.java b/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/tcf/tests/TcfCoreTests.java
index 485b4f8be..0eddb1182 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/tcf/tests/TcfCoreTests.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tests/src/org/eclipse/tcf/te/tests/tcf/tests/TcfCoreTests.java
@@ -9,6 +9,8 @@
*******************************************************************************/
package org.eclipse.tcf.te.tests.tcf.tests;
+import java.util.HashMap;
+import java.util.Map;
import java.util.concurrent.atomic.AtomicReference;
import junit.framework.Test;
@@ -53,7 +55,9 @@ public class TcfCoreTests extends TcfTestCase {
final AtomicReference<Callback> callback = new AtomicReference<Callback>();
callback.set(new Callback());
- Tcf.getChannelManager().openChannel(peer, true, new IChannelManager.DoneOpenChannel() {
+ Map<String, Boolean> flags = new HashMap<String, Boolean>();
+ flags.put(IChannelManager.FLAG_FORCE_NEW, Boolean.TRUE);
+ Tcf.getChannelManager().openChannel(peer, flags, new IChannelManager.DoneOpenChannel() {
@Override
public void doneOpenChannel(Throwable error, IChannel channel) {

Back to the top