summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-01-08 04:48:57 (EST)
committerEike Stepper2007-01-08 04:48:57 (EST)
commitd36d321be93df5030a4684753e2f145f058fe3d1 (patch)
tree326ee9e486b6c64535b00873038459d982626763
parentb155eedc55cd1af50931375888effcf306ef204f (diff)
downloadcdo-d36d321be93df5030a4684753e2f145f058fe3d1.zip
cdo-d36d321be93df5030a4684753e2f145f058fe3d1.tar.gz
cdo-d36d321be93df5030a4684753e2f145f058fe3d1.tar.bz2
Develop CDO2.
Stop protocolData from being transmitted. Let exceptions propagate from active signals.
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/AbstractConnector.java5
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/embedded/AbstractEmbeddedConnector.java4
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/tcp/AbstractTCPConnector.java6
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/tcp/ControlChannelImpl.java7
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/Signal.java12
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/SignalProtocol.java4
6 files changed, 21 insertions, 17 deletions
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/AbstractConnector.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/AbstractConnector.java
index 66f7323..ac9ac92 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/AbstractConnector.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/AbstractConnector.java
@@ -357,7 +357,7 @@ public abstract class AbstractConnector extends AbstractLifecycle implements Con
{
short channelIndex = findFreeChannelIndex();
ChannelImpl channel = createChannel(channelIndex, protocolID, protocolData);
- registerChannelWithPeer(channelIndex, protocolID, protocolData);
+ registerChannelWithPeer(channelIndex, protocolID);
try
{
@@ -616,8 +616,7 @@ public abstract class AbstractConnector extends AbstractLifecycle implements Con
super.onDeactivate();
}
- protected abstract void registerChannelWithPeer(short channelIndex, String protocolID,
- Object protocolData) throws ConnectorException;
+ protected abstract void registerChannelWithPeer(short channelIndex, String protocolID) throws ConnectorException;
private static int getNextConnectorID()
{
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/embedded/AbstractEmbeddedConnector.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/embedded/AbstractEmbeddedConnector.java
index 88392f6..1cda337 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/embedded/AbstractEmbeddedConnector.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/embedded/AbstractEmbeddedConnector.java
@@ -43,12 +43,12 @@ public abstract class AbstractEmbeddedConnector extends AbstractConnector
}
@Override
- protected void registerChannelWithPeer(short channelIndex, String protocolID, Object protocolData)
+ protected void registerChannelWithPeer(short channelIndex, String protocolID)
throws ConnectorException
{
try
{
- ChannelImpl channel = getPeer().createChannel(channelIndex, protocolID, protocolData);
+ ChannelImpl channel = getPeer().createChannel(channelIndex, protocolID, null);
if (channel == null)
{
throw new ConnectorException("Failed to register channel with peer"); //$NON-NLS-1$
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/tcp/AbstractTCPConnector.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/tcp/AbstractTCPConnector.java
index 08ca2f5..aab164b 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/tcp/AbstractTCPConnector.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/tcp/AbstractTCPConnector.java
@@ -240,12 +240,12 @@ public abstract class AbstractTCPConnector extends AbstractConnector implements
}
@Override
- protected void registerChannelWithPeer(short channelIndex, String protocolID, Object protocolData)
+ protected void registerChannelWithPeer(short channelIndex, String protocolID)
throws ConnectorException
{
try
{
- if (!controlChannel.registerChannel(channelIndex, protocolID, protocolData))
+ if (!controlChannel.registerChannel(channelIndex, protocolID))
{
throw new ConnectorException("Failed to register channel with peer"); //$NON-NLS-1$
}
@@ -254,7 +254,7 @@ public abstract class AbstractTCPConnector extends AbstractConnector implements
{
throw ex;
}
- catch (IOException ex)
+ catch (Exception ex)
{
throw new ConnectorException(ex);
}
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/tcp/ControlChannelImpl.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/tcp/ControlChannelImpl.java
index 6fe449a..ebca313 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/tcp/ControlChannelImpl.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/tcp/ControlChannelImpl.java
@@ -19,7 +19,6 @@ import org.eclipse.internal.net4j.bundle.Net4j;
import org.eclipse.internal.net4j.transport.BufferUtil;
import org.eclipse.internal.net4j.transport.ChannelImpl;
-import java.io.IOException;
import java.nio.ByteBuffer;
/**
@@ -53,7 +52,7 @@ public final class ControlChannelImpl extends ChannelImpl
setConnector(connector);
}
- public boolean registerChannel(short channelIndex, String protocolID, Object protocolData) throws IOException
+ public boolean registerChannel(short channelIndex, String protocolID)
{
assertValidChannelIndex(channelIndex);
Synchronizer<Boolean> registration = registrations.correlate(channelIndex);
@@ -63,7 +62,6 @@ public final class ControlChannelImpl extends ChannelImpl
byteBuffer.put(OPCODE_REGISTRATION);
byteBuffer.putShort(channelIndex);
BufferUtil.putUTF8(byteBuffer, protocolID);
- BufferUtil.putObject(byteBuffer, protocolData);
handleBuffer(buffer);
return registration.get(REGISTRATION_TIMEOUT);
@@ -106,9 +104,8 @@ public final class ControlChannelImpl extends ChannelImpl
{
byte[] handlerFactoryUTF8 = BufferUtil.getByteArray(byteBuffer);
String protocolID = BufferUtil.fromUTF8(handlerFactoryUTF8);
- Object protocolData = BufferUtil.getObject(byteBuffer);
ChannelImpl channel = ((AbstractTCPConnector)getConnector()).createChannel(channelIndex,
- protocolID, protocolData);
+ protocolID, null);
if (channel != null)
{
channel.activate();
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/Signal.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/Signal.java
index d00af91..79f1cb8 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/Signal.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/Signal.java
@@ -35,7 +35,7 @@ public abstract class Signal implements Runnable
{
}
- protected final SignalProtocol getProtocol()
+ protected SignalProtocol getProtocol()
{
return protocol;
}
@@ -59,7 +59,7 @@ public abstract class Signal implements Runnable
{
try
{
- execute(inputStream, outputStream);
+ runSync();
}
catch (Exception ex)
{
@@ -68,6 +68,14 @@ public abstract class Signal implements Runnable
TRACER.trace(ex);
}
}
+ }
+
+ protected void runSync() throws Exception
+ {
+ try
+ {
+ execute(inputStream, outputStream);
+ }
finally
{
getProtocol().stopSignal(this);
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/SignalProtocol.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/SignalProtocol.java
index d4700f5..233e443 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/SignalProtocol.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/SignalProtocol.java
@@ -149,7 +149,7 @@ public abstract class SignalProtocol extends AbstractProtocol
protected abstract SignalReactor createSignalReactor(short signalID);
- void startSignal(SignalActor signalActor, long timeout)
+ void startSignal(SignalActor signalActor, long timeout) throws Exception
{
if (signalActor.getProtocol() != this)
{
@@ -162,7 +162,7 @@ public abstract class SignalProtocol extends AbstractProtocol
signalActor.setOutputStream(new SignalOutputStream(correlationID, signalID, true));
signals.put(correlationID, signalActor);
- signalActor.run();
+ signalActor.runSync();
}
void stopSignal(Signal signal)