Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2006-10-23 15:29:34 -0400
committerEike Stepper2006-10-23 15:29:34 -0400
commit23c06b895f9b472914055e7ad751163203d7a272 (patch)
tree68b27a6166727406707801bdd2deedd559597d11 /plugins/org.eclipse.net4j
parentbb8c3765a13a93cb90777b8a59d660bb75d0372e (diff)
downloadcdo-23c06b895f9b472914055e7ad751163203d7a272.tar.gz
cdo-23c06b895f9b472914055e7ad751163203d7a272.tar.xz
cdo-23c06b895f9b472914055e7ad751163203d7a272.zip
Net4jFactory
Diffstat (limited to 'plugins/org.eclipse.net4j')
-rw-r--r--plugins/org.eclipse.net4j/META-INF/MANIFEST.MF1
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/BufferUtil.java25
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/tcp/AbstractTCPConnector.java3
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/tcp/TCPAcceptorImpl.java3
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/tcp/TCPUtil.java48
5 files changed, 5 insertions, 75 deletions
diff --git a/plugins/org.eclipse.net4j/META-INF/MANIFEST.MF b/plugins/org.eclipse.net4j/META-INF/MANIFEST.MF
index da8d7fac78..746ebe40e3 100644
--- a/plugins/org.eclipse.net4j/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.net4j/META-INF/MANIFEST.MF
@@ -9,6 +9,7 @@ Import-Package: org.osgi.framework;version="1.3.0"
Export-Package: org.eclipse.internal.net4j.transport;version="0.8.0",
org.eclipse.internal.net4j.transport.embedded;version="0.8.0",
org.eclipse.internal.net4j.transport.tcp;version="0.8.0",
+ org.eclipse.net4j;version="0.8.0",
org.eclipse.net4j.message;version="0.8.0",
org.eclipse.net4j.remote;version="0.8.0",
org.eclipse.net4j.signal;version="0.8.0",
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/BufferUtil.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/BufferUtil.java
index b8847df93a..143b47de7b 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/BufferUtil.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/BufferUtil.java
@@ -28,31 +28,6 @@ public final class BufferUtil
{
}
- public static BufferProvider createBufferFactory(short bufferCapacity)
- {
- return new BufferFactoryImpl(bufferCapacity);
- }
-
- public static BufferProvider createBufferFactory()
- {
- return new BufferFactoryImpl(DEFAULT_BUFFER_CAPACITY);
- }
-
- public static BufferProvider createBufferPool(BufferProvider factory)
- {
- return new BufferPoolImpl(factory);
- }
-
- public static BufferProvider createBufferPool(short bufferCapacity)
- {
- return createBufferPool(createBufferFactory(bufferCapacity));
- }
-
- public static BufferProvider createBufferPool()
- {
- return createBufferPool(DEFAULT_BUFFER_CAPACITY);
- }
-
public static BufferProvider getBufferProvider(Object object)
{
if (object instanceof BufferProvider)
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 3724e0025e..016fa432e5 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
@@ -10,6 +10,7 @@
**************************************************************************/
package org.eclipse.internal.net4j.transport.tcp;
+import org.eclipse.net4j.Net4jFactory;
import org.eclipse.net4j.transport.Buffer;
import org.eclipse.net4j.transport.Channel;
import org.eclipse.net4j.transport.ConnectorException;
@@ -260,7 +261,7 @@ public abstract class AbstractTCPConnector extends AbstractConnector implements
super.onAccessBeforeActivate();
if (selector == null)
{
- selector = TCPUtil.createTCPSelector();
+ selector = Net4jFactory.createTCPSelector();
LifecycleUtil.activate(selector);
}
}
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/tcp/TCPAcceptorImpl.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/tcp/TCPAcceptorImpl.java
index 801c281c32..2a7e2bcf0c 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/tcp/TCPAcceptorImpl.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/tcp/TCPAcceptorImpl.java
@@ -10,6 +10,7 @@
**************************************************************************/
package org.eclipse.internal.net4j.transport.tcp;
+import org.eclipse.net4j.Net4jFactory;
import org.eclipse.net4j.transport.Buffer;
import org.eclipse.net4j.transport.BufferProvider;
import org.eclipse.net4j.transport.ProtocolFactory;
@@ -295,7 +296,7 @@ public class TCPAcceptorImpl extends AbstractLifecycle implements TCPAcceptor, B
if (selector == null)
{
- selector = TCPUtil.createTCPSelector();
+ selector = Net4jFactory.createTCPSelector();
LifecycleUtil.activate(selector);
}
}
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/tcp/TCPUtil.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/tcp/TCPUtil.java
index 634ca4389c..4bc7693040 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/tcp/TCPUtil.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/transport/tcp/TCPUtil.java
@@ -10,11 +10,6 @@
**************************************************************************/
package org.eclipse.internal.net4j.transport.tcp;
-import org.eclipse.net4j.transport.BufferProvider;
-import org.eclipse.net4j.transport.tcp.TCPAcceptor;
-import org.eclipse.net4j.transport.tcp.TCPConnector;
-import org.eclipse.net4j.transport.tcp.TCPSelector;
-
import java.nio.channels.SelectionKey;
import java.nio.channels.ServerSocketChannel;
import java.nio.channels.SocketChannel;
@@ -28,58 +23,15 @@ public final class TCPUtil
{
}
- public static TCPSelector createTCPSelector()
- {
- TCPSelectorImpl selector = new TCPSelectorImpl();
- return selector;
- }
-
- public static TCPAcceptor createTCPAcceptor(BufferProvider bufferProvider, TCPSelector selector,
- String address, int port)
- {
- TCPAcceptorImpl acceptor = new TCPAcceptorImpl();
- acceptor.setBufferProvider(bufferProvider);
- acceptor.setSelector(selector);
- acceptor.setListenPort(port);
- acceptor.setListenAddr(address);
- return acceptor;
- }
-
- public static TCPAcceptor createTCPAcceptor(BufferProvider bufferProvider, TCPSelector selector)
- {
- return createTCPAcceptor(bufferProvider, selector, TCPAcceptor.DEFAULT_ADDRESS,
- TCPAcceptor.DEFAULT_PORT);
- }
-
- public static TCPConnector createTCPConnector(BufferProvider bufferProvider,
- TCPSelector selector, String host, int port)
- {
- ClientTCPConnectorImpl connector = new ClientTCPConnectorImpl();
- connector.setBufferProvider(bufferProvider);
- connector.setSelector(selector);
- connector.setHost(host);
- connector.setPort(port);
- return connector;
- }
-
- public static TCPConnector createTCPConnector(BufferProvider bufferProvider,
- TCPSelector selector, String host)
- {
- return createTCPConnector(bufferProvider, selector, host, TCPConnector.DEFAULT_PORT);
- }
-
public static String toString(ServerSocketChannel channel)
{
return channel.toString();
- // return "ServerSocketChannel[" + channel.socket().getLocalSocketAddress()
// + "]";
}
public static String toString(SocketChannel channel)
{
return channel.toString();
- // return "SocketChannel[" + channel.socket().getRemoteSocketAddress() +
- // "]";
}
public static String formatInterestOps(int newOps)

Back to the top