Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/internal/tcf/core/TransportManager.java2
-rw-r--r--plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/internal/tcf/services/local/ChannelProxy.java2
-rw-r--r--plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/core/AbstractChannel.java30
-rw-r--r--plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/core/ChannelTCP.java2
-rw-r--r--plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/protocol/IChannel.java8
-rw-r--r--plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/protocol/IPeer.java10
-rw-r--r--plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/protocol/ITransportProvider.java2
-rw-r--r--plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/model/TCFLaunch.java2
-rw-r--r--plugins/org.eclipse.tm.tcf.rse/src/org/eclipse/tm/internal/tcf/rse/TCFConnectorService.java2
9 files changed, 37 insertions, 23 deletions
diff --git a/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/internal/tcf/core/TransportManager.java b/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/internal/tcf/core/TransportManager.java
index e9e5e61c5..cda2376b6 100644
--- a/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/internal/tcf/core/TransportManager.java
+++ b/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/internal/tcf/core/TransportManager.java
@@ -164,7 +164,7 @@ public class TransportManager {
*/
public static void sendEvent(String service_name, String event_name, byte[] data) {
for (AbstractChannel c : channels) {
- // Skip channels that are executing "redirect" command - STATE_OPENNING
+ // Skip channels that are executing "redirect" command - STATE_OPENING
if (c.getState() == IChannel.STATE_OPEN) {
IService s = c.getLocalService(service_name);
if (s != null) c.sendEvent(s, event_name, data);
diff --git a/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/internal/tcf/services/local/ChannelProxy.java b/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/internal/tcf/services/local/ChannelProxy.java
index 14f4a92fa..9fc1444dd 100644
--- a/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/internal/tcf/services/local/ChannelProxy.java
+++ b/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/internal/tcf/services/local/ChannelProxy.java
@@ -119,7 +119,7 @@ class ChannelProxy {
ch_x = (AbstractChannel)x;
ch_y = (AbstractChannel)y;
assert ch_x.getState() == IChannel.STATE_OPEN;
- assert ch_y.getState() == IChannel.STATE_OPENNING;
+ assert ch_y.getState() == IChannel.STATE_OPENING;
try {
ch_y.setProxy(proxy_y, ch_x.getRemoteServices());
ch_y.addChannelListener(new IChannel.IChannelListener() {
diff --git a/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/core/AbstractChannel.java b/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/core/AbstractChannel.java
index 49135a8ac..4c6949d34 100644
--- a/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/core/AbstractChannel.java
+++ b/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/core/AbstractChannel.java
@@ -133,7 +133,7 @@ public abstract class AbstractChannel implements IChannel {
private boolean notifying_channel_opened;
private boolean registered_with_trasport;
private boolean shutdown;
- private int state = STATE_OPENNING;
+ private int state = STATE_OPENING;
private IToken redirect_command;
private final IPeer local_peer;
private IPeer remote_peer;
@@ -410,7 +410,7 @@ public abstract class AbstractChannel implements IChannel {
*/
public void redirect(final Map<String,String> peer_attrs) {
assert Protocol.isDispatchThread();
- if (state == STATE_OPENNING) {
+ if (state == STATE_OPENING) {
redirect_queue.add(peer_attrs);
}
else {
@@ -456,7 +456,7 @@ public abstract class AbstractChannel implements IChannel {
public void doneRedirect(IToken token, Exception x) {
assert redirect_command == token;
redirect_command = null;
- if (state != STATE_OPENNING) return;
+ if (state != STATE_OPENING) return;
if (x != null) terminate(x);
remote_peer = peer;
remote_service_by_class.clear();
@@ -471,7 +471,7 @@ public abstract class AbstractChannel implements IChannel {
public void doneRedirect(IToken token, Exception x) {
assert redirect_command == token;
redirect_command = null;
- if (state != STATE_OPENNING) return;
+ if (state != STATE_OPENING) return;
if (x != null) terminate(x);
final IPeer parent = remote_peer;
remote_peer = new TransientPeer(peer_attrs) {
@@ -487,7 +487,7 @@ public abstract class AbstractChannel implements IChannel {
}
});
}
- state = STATE_OPENNING;
+ state = STATE_OPENING;
}
catch (Throwable x) {
terminate(x);
@@ -692,27 +692,27 @@ public abstract class AbstractChannel implements IChannel {
public Collection<String> getLocalServices() {
assert Protocol.isDispatchThread();
- assert state != STATE_OPENNING;
+ assert state != STATE_OPENING;
return local_service_by_name.keySet();
}
public Collection<String> getRemoteServices() {
assert Protocol.isDispatchThread();
- assert state != STATE_OPENNING;
+ assert state != STATE_OPENING;
return remote_service_by_name.keySet();
}
@SuppressWarnings("unchecked")
public <V extends IService> V getLocalService(Class<V> cls) {
assert Protocol.isDispatchThread();
- assert state != STATE_OPENNING;
+ assert state != STATE_OPENING;
return (V)local_service_by_class.get(cls);
}
@SuppressWarnings("unchecked")
public <V extends IService> V getRemoteService(Class<V> cls) {
assert Protocol.isDispatchThread();
- assert state != STATE_OPENNING;
+ assert state != STATE_OPENING;
return (V)remote_service_by_class.get(cls);
}
@@ -726,13 +726,13 @@ public abstract class AbstractChannel implements IChannel {
public IService getLocalService(String service_name) {
assert Protocol.isDispatchThread();
- assert state != STATE_OPENNING;
+ assert state != STATE_OPENING;
return local_service_by_name.get(service_name);
}
public IService getRemoteService(String service_name) {
assert Protocol.isDispatchThread();
- assert state != STATE_OPENNING;
+ assert state != STATE_OPENING;
return remote_service_by_name.get(service_name);
}
@@ -753,7 +753,7 @@ public abstract class AbstractChannel implements IChannel {
public IToken sendCommand(IService service, String name, byte[] args, ICommandListener listener) {
assert Protocol.isDispatchThread();
- if (state == STATE_OPENNING) throw new Error("Channel is waiting for Hello message");
+ if (state == STATE_OPENING) throw new Error("Channel is waiting for Hello message");
if (state == STATE_CLOSED) throw new Error("Channel is closed");
final Message msg = new Message('C');
msg.service = service.getName();
@@ -806,7 +806,7 @@ public abstract class AbstractChannel implements IChannel {
public void sendEvent(IService service, String name, byte[] args) {
assert Protocol.isDispatchThread();
- if (!(state == STATE_OPEN || state == STATE_OPENNING && service instanceof ILocator)) {
+ if (!(state == STATE_OPEN || state == STATE_OPENING && service instanceof ILocator)) {
throw new Error("Channel is closed");
}
Message msg = new Message('E');
@@ -850,7 +850,7 @@ public abstract class AbstractChannel implements IChannel {
}
switch (msg.type) {
case 'C':
- if (state == STATE_OPENNING) {
+ if (state == STATE_OPENING) {
throw new IOException("Received command " + msg.service + "." + msg.name + " before Hello message");
}
if (proxy != null) {
@@ -892,7 +892,7 @@ public abstract class AbstractChannel implements IChannel {
proxy.onEvent(msg.service, msg.name, msg.data);
}
else if (hello) {
- assert state == STATE_OPENNING;
+ assert state == STATE_OPENING;
state = STATE_OPEN;
assert redirect_command == null;
if (redirect_queue.size() > 0) {
diff --git a/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/core/ChannelTCP.java b/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/core/ChannelTCP.java
index 0cd4a7ddb..8de761a72 100644
--- a/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/core/ChannelTCP.java
+++ b/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/core/ChannelTCP.java
@@ -29,6 +29,8 @@ import org.eclipse.tm.tcf.protocol.Protocol;
*/
public class ChannelTCP extends StreamChannel {
+ /* TODO: need to give clients access to socket properties, like connect timeout */
+
private Socket socket;
private InputStream inp;
private OutputStream out;
diff --git a/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/protocol/IChannel.java b/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/protocol/IChannel.java
index 21ff2fa22..d981bb11e 100644
--- a/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/protocol/IChannel.java
+++ b/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/protocol/IChannel.java
@@ -30,11 +30,17 @@ public interface IChannel {
* Channel state IDs
*/
static final int
- STATE_OPENNING = 0,
+ STATE_OPENING = 0,
STATE_OPEN = 1,
STATE_CLOSED = 2;
/**
+ * @deprecated - misspelled, use STATE_OPENING.
+ */
+ static final int
+ STATE_OPENNING = 0;
+
+ /**
* @return channel state, see STATE_*
*/
int getState();
diff --git a/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/protocol/IPeer.java b/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/protocol/IPeer.java
index 6ec39d070..f67ec35ee 100644
--- a/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/protocol/IPeer.java
+++ b/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/protocol/IPeer.java
@@ -107,8 +107,14 @@ public interface IPeer {
/**
* Open channel to communicate with this peer.
* Note: the channel is not fully open yet when this method returns.
- * Its state is IChannel.STATE_OPENNING.
- * Protocol.Listener will be called when the channel will be opened or closed.
+ * Its state is IChannel.STATE_OPENING.
+ * Protocol.ChannelOpenListener and IChannel.IChannelListener listeners will be called when
+ * the channel will change state to open or closed.
+ * Clients are supposed to register IChannel.IChannelListener right after calling openChannel(), or,
+ * at least, in same dispatch cycle. For example:
+ * channel = peer.openChannel();
+ * channel.addChannelListener(new IChannel.IChannelListener() {
+ * ...
*/
IChannel openChannel();
}
diff --git a/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/protocol/ITransportProvider.java b/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/protocol/ITransportProvider.java
index 2251161ea..7416c74fc 100644
--- a/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/protocol/ITransportProvider.java
+++ b/plugins/org.eclipse.tm.tcf.core/src/org/eclipse/tm/tcf/protocol/ITransportProvider.java
@@ -28,7 +28,7 @@ public interface ITransportProvider {
/**
* Open channel to communicate with this peer using this transport.
* Note: the channel can be not fully open yet when this method returns.
- * Itís state can be IChannel.STATE_OPENNING.
+ * Itís state can be IChannel.STATE_OPENING.
* Protocol.Listener will be called when the channel will be opened or closed.
* @param peer - a IPeer object that describes remote end-point of the channel.
* @return TCF communication channel.
diff --git a/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/model/TCFLaunch.java b/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/model/TCFLaunch.java
index b2dd59118..edf969c83 100644
--- a/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/model/TCFLaunch.java
+++ b/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/model/TCFLaunch.java
@@ -742,7 +742,7 @@ public class TCFLaunch extends Launch {
}
});
- assert channel.getState() == IChannel.STATE_OPENNING;
+ assert channel.getState() == IChannel.STATE_OPENING;
connecting = true;
}
catch (Throwable e) {
diff --git a/plugins/org.eclipse.tm.tcf.rse/src/org/eclipse/tm/internal/tcf/rse/TCFConnectorService.java b/plugins/org.eclipse.tm.tcf.rse/src/org/eclipse/tm/internal/tcf/rse/TCFConnectorService.java
index 3340b0bd5..66813a719 100644
--- a/plugins/org.eclipse.tm.tcf.rse/src/org/eclipse/tm/internal/tcf/rse/TCFConnectorService.java
+++ b/plugins/org.eclipse.tm.tcf.rse/src/org/eclipse/tm/internal/tcf/rse/TCFConnectorService.java
@@ -187,7 +187,7 @@ public class TCFConnectorService extends BasicConnectorService {
}
});
- assert channel.getState() == IChannel.STATE_OPENNING;
+ assert channel.getState() == IChannel.STATE_OPENING;
}
return false;
}

Back to the top