summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-03-11 10:14:09 (EDT)
committerEike Stepper2007-03-11 10:14:09 (EDT)
commitb6103732fdb64f10c1cab2d87c87f3702bd7026d (patch)
tree594914041869f74a9e3bb795c6579c90719fa4ef
parent246a6d17420a69f106f067a2d20e4f5236fc306c (diff)
downloadcdo-b6103732fdb64f10c1cab2d87c87f3702bd7026d.zip
cdo-b6103732fdb64f10c1cab2d87c87f3702bd7026d.tar.gz
cdo-b6103732fdb64f10c1cab2d87c87f3702bd7026d.tar.bz2
*** empty log message ***
-rw-r--r--plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TCPTransportTest.java9
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/TransportUtil.java40
2 files changed, 40 insertions, 9 deletions
diff --git a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TCPTransportTest.java b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TCPTransportTest.java
index 4907ebf..4f3841f 100644
--- a/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TCPTransportTest.java
+++ b/plugins/org.eclipse.net4j.tests/src/org/eclipse/net4j/tests/TCPTransportTest.java
@@ -18,6 +18,7 @@ import org.eclipse.net4j.transport.IAcceptorAcceptedEvent;
import org.eclipse.net4j.transport.IBuffer;
import org.eclipse.net4j.transport.IChannel;
import org.eclipse.net4j.transport.IConnectorChannelsEvent;
+import org.eclipse.net4j.util.container.IContainerDelta;
import org.eclipse.net4j.util.event.IEvent;
import org.eclipse.net4j.util.event.IListener;
@@ -163,7 +164,7 @@ public class TCPTransportTest extends AbstractTCPTest
if (event instanceof IConnectorChannelsEvent)
{
IConnectorChannelsEvent e = (IConnectorChannelsEvent)event;
- if (e.getType() == ConnectorChaIConnectorChannelsEvent)
+ if (e.getDeltaKind() == IContainerDelta.Kind.ADDED)
{
inputStream[0] = new ChannelInputStream(e.getChannel(), 2000);
counter.countDown();
@@ -226,7 +227,7 @@ public class TCPTransportTest extends AbstractTCPTest
if (event instanceof IConnectorChannelsEvent)
{
IConnectorChannelsEvent e = (IConnectorChannelsEvent)event;
- if (e.getType() == ConnectorChaIConnectorChannelsEvent)
+ if (e.getDeltaKind() == IContainerDelta.Kind.ADDED)
{
inputStream[0] = new ChannelInputStream(e.getChannel(), 2000);
counter.countDown();
@@ -292,7 +293,7 @@ public class TCPTransportTest extends AbstractTCPTest
if (event instanceof IConnectorChannelsEvent)
{
IConnectorChannelsEvent e = (IConnectorChannelsEvent)event;
- if (e.getType() == ConnectorChaIConnectorChannelsEvent)
+ if (e.getDeltaKind() == IContainerDelta.Kind.ADDED)
{
inputStream[0] = new ChannelInputStream(e.getChannel(), 2000);
counter.countDown();
@@ -372,7 +373,7 @@ public class TCPTransportTest extends AbstractTCPTest
if (event instanceof IConnectorChannelsEvent)
{
IConnectorChannelsEvent e = (IConnectorChannelsEvent)event;
- if (e.getType() == ConnectorChaIConnectorChannelsEvent)
+ if (e.getDeltaKind() == IContainerDelta.Kind.ADDED)
{
inputStream[0] = new ChannelInputStream(e.getChannel(), 2000);
counter.countDown();
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/TransportUtil.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/TransportUtil.java
index 69e381b..61733e8 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/TransportUtil.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/transport/TransportUtil.java
@@ -24,28 +24,58 @@ public final class TransportUtil
{
}
- public static IBufferProvider.Introspection createBufferFactory(short bufferCapacity)
+ public static IBufferProvider createBufferFactory(short bufferCapacity)
{
return new BufferFactory(bufferCapacity);
}
- public static IBufferProvider.Introspection createBufferFactory()
+ public static IBufferProvider createBufferFactory()
{
return new BufferFactory(DEFAULT_BUFFER_CAPACITY);
}
- public static IBufferPool.Introspection createBufferPool(IBufferProvider factory)
+ public static IBufferPool createBufferPool(IBufferProvider factory)
{
return new BufferPool(factory);
}
- public static IBufferPool.Introspection createBufferPool(short bufferCapacity)
+ public static IBufferPool createBufferPool(short bufferCapacity)
{
return createBufferPool(createBufferFactory(bufferCapacity));
}
- public static IBufferPool.Introspection createBufferPool()
+ public static IBufferPool createBufferPool()
{
return createBufferPool(createBufferFactory());
}
+
+ public static long getProvidedBuffers(IBufferProvider bufferProvider)
+ {
+ if (bufferProvider instanceof IBufferProvider.Introspection)
+ {
+ return ((IBufferProvider.Introspection)bufferProvider).getProvidedBuffers();
+ }
+
+ return -1L;
+ }
+
+ public static long getRetainedBuffers(IBufferProvider bufferProvider)
+ {
+ if (bufferProvider instanceof IBufferProvider.Introspection)
+ {
+ return ((IBufferProvider.Introspection)bufferProvider).getRetainedBuffers();
+ }
+
+ return -1L;
+ }
+
+ public static int getPooledBuffers(IBufferPool bufferPool)
+ {
+ if (bufferPool instanceof IBufferPool.Introspection)
+ {
+ return ((IBufferPool.Introspection)bufferPool).getPooledBuffers();
+ }
+
+ return -1;
+ }
}