activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r379619 [15/30] - in /incubator/activemq/trunk: ./ activecluster/ activecluster/src/java/org/apache/activecluster/ activecluster/src/java/org/apache/activecluster/election/ activecluster/src/java/org/apache/activecluster/election/impl/ acti...
Date Tue, 21 Feb 2006 23:14:17 GMT
Modified: incubator/activemq/trunk/activeio/activeio-core/src/test/java/org/apache/activeio/packet/nio/NIOSyncChannelTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activeio/activeio-core/src/test/java/org/apache/activeio/packet/nio/NIOSyncChannelTest.java?rev=379619&r1=379618&r2=379619&view=diff
==============================================================================
--- incubator/activemq/trunk/activeio/activeio-core/src/test/java/org/apache/activeio/packet/nio/NIOSyncChannelTest.java (original)
+++ incubator/activemq/trunk/activeio/activeio-core/src/test/java/org/apache/activeio/packet/nio/NIOSyncChannelTest.java Tue Feb 21 15:12:56 2006
@@ -1,44 +1,44 @@
-/**
- *
- * Copyright 2005-2006 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.activeio.packet.nio;
-
-import java.io.IOException;
-import java.net.URI;
-import java.net.URISyntaxException;
-
-import org.apache.activeio.Channel;
-import org.apache.activeio.ChannelServer;
-import org.apache.activeio.packet.sync.SyncChannelTestSupport;
-import org.apache.activeio.packet.sync.nio.NIOSyncChannelFactory;
-
-/**
- * @version $Revision$
- */
-public class NIOSyncChannelTest extends SyncChannelTestSupport {
-
-    NIOSyncChannelFactory factory = new NIOSyncChannelFactory(true);
-    
-    protected Channel openChannel(URI connectURI) throws IOException {
-        return factory.openSyncChannel(connectURI);
-    }
-
-    protected ChannelServer bindChannel() throws IOException, URISyntaxException {
-        return factory.bindSyncChannel(new URI("tcp://localhost:0"));
-    }
-    
-
-}
+/**
+ *
+ * Copyright 2005-2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activeio.packet.nio;
+
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import org.apache.activeio.Channel;
+import org.apache.activeio.ChannelServer;
+import org.apache.activeio.packet.sync.SyncChannelTestSupport;
+import org.apache.activeio.packet.sync.nio.NIOSyncChannelFactory;
+
+/**
+ * @version $Revision$
+ */
+public class NIOSyncChannelTest extends SyncChannelTestSupport {
+
+    NIOSyncChannelFactory factory = new NIOSyncChannelFactory(true);
+    
+    protected Channel openChannel(URI connectURI) throws IOException {
+        return factory.openSyncChannel(connectURI);
+    }
+
+    protected ChannelServer bindChannel() throws IOException, URISyntaxException {
+        return factory.bindSyncChannel(new URI("tcp://localhost:0"));
+    }
+    
+
+}

Propchange: incubator/activemq/trunk/activeio/activeio-core/src/test/java/org/apache/activeio/packet/nio/NIOSyncChannelTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/activeio/activeio-core/src/test/java/org/apache/activeio/packet/sync/ConnectionlessSyncChannelTestSupport.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activeio/activeio-core/src/test/java/org/apache/activeio/packet/sync/ConnectionlessSyncChannelTestSupport.java?rev=379619&r1=379618&r2=379619&view=diff
==============================================================================
--- incubator/activemq/trunk/activeio/activeio-core/src/test/java/org/apache/activeio/packet/sync/ConnectionlessSyncChannelTestSupport.java (original)
+++ incubator/activemq/trunk/activeio/activeio-core/src/test/java/org/apache/activeio/packet/sync/ConnectionlessSyncChannelTestSupport.java Tue Feb 21 15:12:56 2006
@@ -1,182 +1,182 @@
-/**
- *
- * Copyright 2005-2006 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.activeio.packet.sync;
-
-import edu.emory.mathcs.backport.java.util.concurrent.Executor;
-import edu.emory.mathcs.backport.java.util.concurrent.ScheduledThreadPoolExecutor;
-
-import org.apache.activeio.Channel;
-import org.apache.activeio.adapter.AsyncToSyncChannel;
-import org.apache.activeio.packet.ByteArrayPacket;
-import org.apache.activeio.packet.FilterPacket;
-import org.apache.activeio.packet.Packet;
-import org.apache.activeio.packet.sync.SyncChannel;
-import org.apache.activeio.packet.sync.datagram.DatagramContext;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import java.io.IOException;
-import java.net.DatagramPacket;
-import java.net.InetSocketAddress;
-import java.net.SocketAddress;
-import java.net.SocketException;
-import java.net.URI;
-import java.net.URISyntaxException;
-
-import junit.framework.TestCase;
-
-
-/**
- * @version $Revision$
- */
-abstract public class ConnectionlessSyncChannelTestSupport extends TestCase {
-
-    private final Log log = LogFactory.getLog(ConnectionlessSyncChannelTestSupport.class);
-    private SyncChannel clientChannel;
-    private SyncChannel serverChannel;
-    private final Executor sendExecutor = new ScheduledThreadPoolExecutor(1);
-
-    public void testSmallSendReceive() throws IOException, URISyntaxException, InterruptedException {
-        if (isDisabled()) {
-            log.info("test disabled: " + getName());
-            return;
-        }
-        UDPFilterPacket fp = new UDPFilterPacket("Hello World".getBytes(), new InetSocketAddress(getAddress(), 4444));
-        doSendReceive(fp.duplicate());
-    }
-
-    public void testManySmallSendReceives() throws IOException, URISyntaxException, InterruptedException {
-        if (isDisabled()) {
-            log.info("test disabled: " + getName());
-            return;
-        }
-        log.info("Start of testManySmallSendReceives");
-        UDPFilterPacket fp = new UDPFilterPacket("Hello World".getBytes(), new InetSocketAddress(getAddress(), 4444));
-        long start = System.currentTimeMillis();
-        for (int i = 0; i < getTestIterations(); i++) {
-            doSendReceive(fp.duplicate());
-        }
-        long end = System.currentTimeMillis();
-        log.info("done. Duration: " + duration(start, end) + "s, duration per send: " + (unitDuration(start, end, getTestIterations()) * 1000.0) + "ms");
-    }
-
-    private float unitDuration(long start, long end, int testIterations) {
-        return duration(start, end) / testIterations;
-    }
-
-    private float duration(long start, long end) {
-        return (float) (((float) (end - start)) / 1000.0f);
-    }
-
-    protected int getTestIterations() {
-        return 1000;
-    }
-
-    protected void setUp() throws Exception {
-
-        log.info("Running: " + getName());
-
-        if (isDisabled()) {
-            return;
-        }
-
-        log.info("Client connecting to: " + getAddress() + ":4444");
-
-        clientChannel = AsyncToSyncChannel.adapt(openClientChannel(new URI("test://" + getAddress() + ":4444")));
-        clientChannel.start();
-
-        serverChannel = AsyncToSyncChannel.adapt(openServerChannel(new URI("test://" + getAddress() + ":4444")));
-        serverChannel.start();
-    }
-
-    private void doSendReceive(final Packet outboundPacket) throws IOException, InterruptedException {
-        ByteArrayPacket ip = new ByteArrayPacket(new byte[outboundPacket.remaining()]);
-
-        // Do the send async.
-        sendExecutor.execute(new Runnable() {
-            public void run() {
-                try {
-                    clientChannel.write(outboundPacket);
-                    clientChannel.flush();
-                }
-                catch (Exception e) {
-                    int i = 0;
-                }
-            }
-        });
-
-        while (ip.hasRemaining()) {
-            Packet packet = serverChannel.read(1000 * 5);
-            assertNotNull(packet);
-            packet.read(ip);
-        }
-        outboundPacket.clear();
-        ip.clear();
-        assertEquals(outboundPacket.sliceAsBytes(), ip.sliceAsBytes());
-    }
-
-    protected void tearDown() throws Exception {
-        if (isDisabled()) return;
-
-        log.info("Closing down the channels.");
-
-        serverChannel.dispose();
-        clientChannel.dispose();
-    }
-
-    protected boolean isDisabled() {
-        return false;
-    }
-
-    public void assertEquals(byte []b1, byte[] b2) {
-        assertEquals(b1.length, b2.length);
-        for (int i = 0; i < b2.length; i++) {
-            assertEquals(b1[i], b2[i]);
-        }
-    }
-
-    abstract protected Channel openClientChannel(URI connectURI) throws IOException;
-
-    abstract protected Channel openServerChannel(URI connectURI) throws IOException;
-
-    abstract protected String getAddress();
-
-    private final class UDPFilterPacket extends FilterPacket {
-        private final DatagramPacket packet;
-
-        private UDPFilterPacket(byte[] buf, SocketAddress address) throws SocketException {
-            super(new ByteArrayPacket(buf));
-            this.packet = new DatagramPacket(buf, buf.length, address);
-        }
-
-        private UDPFilterPacket(Packet op, DatagramPacket packet) {
-            super(op);
-            this.packet = packet;
-        }
-
-        public Object getAdapter(Class target) {
-            if (target == DatagramContext.class) {
-                return new DatagramContext(packet);
-            }
-            return super.getAdapter(target);
-        }
-
-        public Packet filter(Packet packet) {
-            return new UDPFilterPacket(packet, this.packet);
-        }
-    }
-}
+/**
+ *
+ * Copyright 2005-2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activeio.packet.sync;
+
+import edu.emory.mathcs.backport.java.util.concurrent.Executor;
+import edu.emory.mathcs.backport.java.util.concurrent.ScheduledThreadPoolExecutor;
+
+import org.apache.activeio.Channel;
+import org.apache.activeio.adapter.AsyncToSyncChannel;
+import org.apache.activeio.packet.ByteArrayPacket;
+import org.apache.activeio.packet.FilterPacket;
+import org.apache.activeio.packet.Packet;
+import org.apache.activeio.packet.sync.SyncChannel;
+import org.apache.activeio.packet.sync.datagram.DatagramContext;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.io.IOException;
+import java.net.DatagramPacket;
+import java.net.InetSocketAddress;
+import java.net.SocketAddress;
+import java.net.SocketException;
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import junit.framework.TestCase;
+
+
+/**
+ * @version $Revision$
+ */
+abstract public class ConnectionlessSyncChannelTestSupport extends TestCase {
+
+    private final Log log = LogFactory.getLog(ConnectionlessSyncChannelTestSupport.class);
+    private SyncChannel clientChannel;
+    private SyncChannel serverChannel;
+    private final Executor sendExecutor = new ScheduledThreadPoolExecutor(1);
+
+    public void testSmallSendReceive() throws IOException, URISyntaxException, InterruptedException {
+        if (isDisabled()) {
+            log.info("test disabled: " + getName());
+            return;
+        }
+        UDPFilterPacket fp = new UDPFilterPacket("Hello World".getBytes(), new InetSocketAddress(getAddress(), 4444));
+        doSendReceive(fp.duplicate());
+    }
+
+    public void testManySmallSendReceives() throws IOException, URISyntaxException, InterruptedException {
+        if (isDisabled()) {
+            log.info("test disabled: " + getName());
+            return;
+        }
+        log.info("Start of testManySmallSendReceives");
+        UDPFilterPacket fp = new UDPFilterPacket("Hello World".getBytes(), new InetSocketAddress(getAddress(), 4444));
+        long start = System.currentTimeMillis();
+        for (int i = 0; i < getTestIterations(); i++) {
+            doSendReceive(fp.duplicate());
+        }
+        long end = System.currentTimeMillis();
+        log.info("done. Duration: " + duration(start, end) + "s, duration per send: " + (unitDuration(start, end, getTestIterations()) * 1000.0) + "ms");
+    }
+
+    private float unitDuration(long start, long end, int testIterations) {
+        return duration(start, end) / testIterations;
+    }
+
+    private float duration(long start, long end) {
+        return (float) (((float) (end - start)) / 1000.0f);
+    }
+
+    protected int getTestIterations() {
+        return 1000;
+    }
+
+    protected void setUp() throws Exception {
+
+        log.info("Running: " + getName());
+
+        if (isDisabled()) {
+            return;
+        }
+
+        log.info("Client connecting to: " + getAddress() + ":4444");
+
+        clientChannel = AsyncToSyncChannel.adapt(openClientChannel(new URI("test://" + getAddress() + ":4444")));
+        clientChannel.start();
+
+        serverChannel = AsyncToSyncChannel.adapt(openServerChannel(new URI("test://" + getAddress() + ":4444")));
+        serverChannel.start();
+    }
+
+    private void doSendReceive(final Packet outboundPacket) throws IOException, InterruptedException {
+        ByteArrayPacket ip = new ByteArrayPacket(new byte[outboundPacket.remaining()]);
+
+        // Do the send async.
+        sendExecutor.execute(new Runnable() {
+            public void run() {
+                try {
+                    clientChannel.write(outboundPacket);
+                    clientChannel.flush();
+                }
+                catch (Exception e) {
+                    int i = 0;
+                }
+            }
+        });
+
+        while (ip.hasRemaining()) {
+            Packet packet = serverChannel.read(1000 * 5);
+            assertNotNull(packet);
+            packet.read(ip);
+        }
+        outboundPacket.clear();
+        ip.clear();
+        assertEquals(outboundPacket.sliceAsBytes(), ip.sliceAsBytes());
+    }
+
+    protected void tearDown() throws Exception {
+        if (isDisabled()) return;
+
+        log.info("Closing down the channels.");
+
+        serverChannel.dispose();
+        clientChannel.dispose();
+    }
+
+    protected boolean isDisabled() {
+        return false;
+    }
+
+    public void assertEquals(byte []b1, byte[] b2) {
+        assertEquals(b1.length, b2.length);
+        for (int i = 0; i < b2.length; i++) {
+            assertEquals(b1[i], b2[i]);
+        }
+    }
+
+    abstract protected Channel openClientChannel(URI connectURI) throws IOException;
+
+    abstract protected Channel openServerChannel(URI connectURI) throws IOException;
+
+    abstract protected String getAddress();
+
+    private final class UDPFilterPacket extends FilterPacket {
+        private final DatagramPacket packet;
+
+        private UDPFilterPacket(byte[] buf, SocketAddress address) throws SocketException {
+            super(new ByteArrayPacket(buf));
+            this.packet = new DatagramPacket(buf, buf.length, address);
+        }
+
+        private UDPFilterPacket(Packet op, DatagramPacket packet) {
+            super(op);
+            this.packet = packet;
+        }
+
+        public Object getAdapter(Class target) {
+            if (target == DatagramContext.class) {
+                return new DatagramContext(packet);
+            }
+            return super.getAdapter(target);
+        }
+
+        public Packet filter(Packet packet) {
+            return new UDPFilterPacket(packet, this.packet);
+        }
+    }
+}

Propchange: incubator/activemq/trunk/activeio/activeio-core/src/test/java/org/apache/activeio/packet/sync/ConnectionlessSyncChannelTestSupport.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/activeio/activeio-core/src/test/java/org/apache/activeio/packet/sync/SlowWriteSyncChannelFactory.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activeio/activeio-core/src/test/java/org/apache/activeio/packet/sync/SlowWriteSyncChannelFactory.java?rev=379619&r1=379618&r2=379619&view=diff
==============================================================================
--- incubator/activemq/trunk/activeio/activeio-core/src/test/java/org/apache/activeio/packet/sync/SlowWriteSyncChannelFactory.java (original)
+++ incubator/activemq/trunk/activeio/activeio-core/src/test/java/org/apache/activeio/packet/sync/SlowWriteSyncChannelFactory.java Tue Feb 21 15:12:56 2006
@@ -1,93 +1,93 @@
-/**
- *
- * Copyright 2005-2006 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.activeio.packet.sync;
-
-import java.io.IOException;
-import java.io.InterruptedIOException;
-import java.net.URI;
-
-import org.apache.activeio.Channel;
-import org.apache.activeio.packet.Packet;
-import org.apache.activeio.packet.sync.FilterSyncChannel;
-import org.apache.activeio.packet.sync.FilterSyncChannelServer;
-import org.apache.activeio.packet.sync.SyncChannel;
-import org.apache.activeio.packet.sync.SyncChannelFactory;
-import org.apache.activeio.packet.sync.SyncChannelServer;
-
-/**
- * Makes all the channels produced by another [@see org.apache.activeio.SyncChannelFactory}
- * have write operations that have built in delays for testing. 
- * 
- * @version $Revision$
- */
-public class SlowWriteSyncChannelFactory implements SyncChannelFactory {
-    
-    final SyncChannelFactory next;
-    private final int maxPacketSize;
-    private final long packetDelay;
-
-    public SlowWriteSyncChannelFactory(final SyncChannelFactory next, int maxPacketSize, long packetDelay) {
-        this.next = next;
-        this.maxPacketSize = maxPacketSize;
-        this.packetDelay = packetDelay;
-    }
-    
-    class SlowWriteSyncChannel extends FilterSyncChannel {
-        public SlowWriteSyncChannel(SyncChannel next) {
-            super(next);
-        }
-        public void write(Packet packet) throws IOException {
-            packet = packet.slice();
-            while(packet.hasRemaining()) {
-                int size = Math.max(maxPacketSize, packet.remaining());
-                packet.position(size);
-                Packet remaining = packet.slice();
-                packet.flip();
-                Packet data = packet.slice();
-                super.write(data);
-                packet = remaining;
-                try {
-                    Thread.sleep(packetDelay);
-                } catch (InterruptedException e) {
-                    throw new InterruptedIOException();
-                }
-            }
-        }
-    }
-
-    class SlowWriteSyncChannelServer extends FilterSyncChannelServer {
-        public SlowWriteSyncChannelServer(SyncChannelServer next) {
-            super(next);
-        }
-        public Channel accept(long timeout) throws IOException {
-            Channel channel = super.accept(timeout);
-            if( channel != null ) {
-                channel =  new SlowWriteSyncChannel((SyncChannel) channel);
-            }
-            return channel;
-        }
-    }
-    
-    public SyncChannelServer bindSyncChannel(URI location) throws IOException {
-        return next.bindSyncChannel(location);
-    }
-    
-    public SyncChannel openSyncChannel(URI location) throws IOException {
-        return new SlowWriteSyncChannel(next.openSyncChannel(location));
-    }
-    
-}
+/**
+ *
+ * Copyright 2005-2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activeio.packet.sync;
+
+import java.io.IOException;
+import java.io.InterruptedIOException;
+import java.net.URI;
+
+import org.apache.activeio.Channel;
+import org.apache.activeio.packet.Packet;
+import org.apache.activeio.packet.sync.FilterSyncChannel;
+import org.apache.activeio.packet.sync.FilterSyncChannelServer;
+import org.apache.activeio.packet.sync.SyncChannel;
+import org.apache.activeio.packet.sync.SyncChannelFactory;
+import org.apache.activeio.packet.sync.SyncChannelServer;
+
+/**
+ * Makes all the channels produced by another [@see org.apache.activeio.SyncChannelFactory}
+ * have write operations that have built in delays for testing. 
+ * 
+ * @version $Revision$
+ */
+public class SlowWriteSyncChannelFactory implements SyncChannelFactory {
+    
+    final SyncChannelFactory next;
+    private final int maxPacketSize;
+    private final long packetDelay;
+
+    public SlowWriteSyncChannelFactory(final SyncChannelFactory next, int maxPacketSize, long packetDelay) {
+        this.next = next;
+        this.maxPacketSize = maxPacketSize;
+        this.packetDelay = packetDelay;
+    }
+    
+    class SlowWriteSyncChannel extends FilterSyncChannel {
+        public SlowWriteSyncChannel(SyncChannel next) {
+            super(next);
+        }
+        public void write(Packet packet) throws IOException {
+            packet = packet.slice();
+            while(packet.hasRemaining()) {
+                int size = Math.max(maxPacketSize, packet.remaining());
+                packet.position(size);
+                Packet remaining = packet.slice();
+                packet.flip();
+                Packet data = packet.slice();
+                super.write(data);
+                packet = remaining;
+                try {
+                    Thread.sleep(packetDelay);
+                } catch (InterruptedException e) {
+                    throw new InterruptedIOException();
+                }
+            }
+        }
+    }
+
+    class SlowWriteSyncChannelServer extends FilterSyncChannelServer {
+        public SlowWriteSyncChannelServer(SyncChannelServer next) {
+            super(next);
+        }
+        public Channel accept(long timeout) throws IOException {
+            Channel channel = super.accept(timeout);
+            if( channel != null ) {
+                channel =  new SlowWriteSyncChannel((SyncChannel) channel);
+            }
+            return channel;
+        }
+    }
+    
+    public SyncChannelServer bindSyncChannel(URI location) throws IOException {
+        return next.bindSyncChannel(location);
+    }
+    
+    public SyncChannel openSyncChannel(URI location) throws IOException {
+        return new SlowWriteSyncChannel(next.openSyncChannel(location));
+    }
+    
+}

Propchange: incubator/activemq/trunk/activeio/activeio-core/src/test/java/org/apache/activeio/packet/sync/SlowWriteSyncChannelFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/activeio/activeio-core/src/test/java/org/apache/activeio/packet/sync/SyncChannelTestSupport.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activeio/activeio-core/src/test/java/org/apache/activeio/packet/sync/SyncChannelTestSupport.java?rev=379619&r1=379618&r2=379619&view=diff
==============================================================================
--- incubator/activemq/trunk/activeio/activeio-core/src/test/java/org/apache/activeio/packet/sync/SyncChannelTestSupport.java (original)
+++ incubator/activemq/trunk/activeio/activeio-core/src/test/java/org/apache/activeio/packet/sync/SyncChannelTestSupport.java Tue Feb 21 15:12:56 2006
@@ -1,201 +1,201 @@
-/**
- *
- * Copyright 2005-2006 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.activeio.packet.sync;
-
-import edu.emory.mathcs.backport.java.util.concurrent.Executor;
-import edu.emory.mathcs.backport.java.util.concurrent.ScheduledThreadPoolExecutor;
-import edu.emory.mathcs.backport.java.util.concurrent.Semaphore;
-
-import org.apache.activeio.Channel;
-import org.apache.activeio.ChannelServer;
-import org.apache.activeio.adapter.AsyncToSyncChannel;
-import org.apache.activeio.adapter.AsyncToSyncChannelServer;
-import org.apache.activeio.packet.ByteArrayPacket;
-import org.apache.activeio.packet.EOSPacket;
-import org.apache.activeio.packet.Packet;
-import org.apache.activeio.packet.sync.SyncChannel;
-import org.apache.activeio.packet.sync.SyncChannelServer;
-import org.apache.activeio.stream.sync.socket.SocketMetadata;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import java.io.IOException;
-import java.net.URI;
-import java.net.URISyntaxException;
-
-import junit.framework.TestCase;
-
-
-/**
- * Used to test the {@see org.apache.activeio.net.TcpSynchChannel}
- *  
- * @version $Revision$
- */
-abstract public class SyncChannelTestSupport extends TestCase {
-
-    Log log = LogFactory.getLog(SyncChannelTestSupport.class);
-    private SyncChannelServer server;
-    private SyncChannel clientChannel;
-    private SyncChannel serverChannel;
-    Executor sendExecutor = new ScheduledThreadPoolExecutor(1);
-
-    public void testSmallSendReceive() throws IOException, URISyntaxException, InterruptedException {
-        if( isDisabled() ) {
-            log.info("test disabled: "+getName());
-            return;
-        }
-        Packet outboundPacket = new ByteArrayPacket("Hello World".getBytes());
-        doSendReceive(outboundPacket.duplicate());
-    }
-
-    public void testPeerDisconnect() throws IOException, URISyntaxException, InterruptedException {
-        if( isDisabled() ) {
-            log.info("test disabled: "+getName());
-            return;
-        }
-
-        Packet outboundPacket = new ByteArrayPacket("Hello World".getBytes());
-        doSendReceive(outboundPacket.duplicate());
-        // disconnect the client.
-        clientChannel.dispose();
-
-        // The server should get an EOS packet.
-        Packet packet = serverChannel.read(1000);
-        assertEquals(EOSPacket.EOS_PACKET, packet);
-    }
-
-    public void testManySmallSendReceives() throws IOException, URISyntaxException, InterruptedException {
-        if( isDisabled() ) {
-            log.info("test disabled: "+getName());
-            return;
-        }
-        log.info("Start of testManySmallSendReceives");
-        Packet outboundPacket = new ByteArrayPacket("Hello World".getBytes());
-        long start = System.currentTimeMillis();
-        for( int i=0; i < getTestIterations(); i++ ) {
-            doSendReceive(outboundPacket.duplicate());
-        }
-        long end = System.currentTimeMillis();
-        log.info("done. Duration: "+duration(start,end)+", duration per send: "+unitDuration(start, end, getTestIterations()));
-    }
-
-    private float unitDuration(long start, long end, int testIterations) {
-                return duration(start,end)/testIterations;
-        }
-
-        private float duration(long start, long end) {
-                return (float) (((float)(end-start))/1000.0f);
-        }
-
-        protected int getTestIterations() {
-        return 1000;
-    }
-
-    protected void setUp() throws Exception {
-
-        log.info("Running: "+getName());
-
-        if( isDisabled() ) {
-            return;
-        }
-
-        log.info("Bind to an annonymous tcp port.");
-        server = AsyncToSyncChannelServer.adapt(bindChannel());
-        server.start();
-        log.info("Server Bound at URI: "+server.getBindURI());
-
-        log.info("Client connecting to: "+server.getConnectURI());
-        clientChannel = AsyncToSyncChannel.adapt( openChannel(server.getConnectURI()));
-        clientChannel.start();
-        SocketMetadata socket = (SocketMetadata) clientChannel.getAdapter(SocketMetadata.class);
-        if( socket != null )
-            socket.setTcpNoDelay(true);
-        log.info("Get connection that was accepted on the server side.");
-
-        Channel c = server.accept(1000*5);
-        assertNotNull(c);
-
-        serverChannel = AsyncToSyncChannel.adapt(c);
-        serverChannel.start();
-        socket = (SocketMetadata) serverChannel.getAdapter(SocketMetadata.class);
-        if( socket != null ) {
-            socket.setTcpNoDelay(true);
-            log.info("Server Channel's Remote addreess: "+socket.getRemoteSocketAddress());
-            log.info("Server Channel's Local addreess: "+socket.getLocalSocketAddress());
-        }
-    }
-
-    /**
-     * @param outboundPacket
-     * @throws IOException
-     * @throws URISyntaxException
-     * @throws InterruptedException
-     */
-    private void doSendReceive(final Packet outboundPacket) throws IOException, URISyntaxException, InterruptedException {
-        ByteArrayPacket inboundPacket = new ByteArrayPacket(new byte[outboundPacket.remaining()]);
-        final Semaphore runMutext = new Semaphore(0);
-
-        // Do the send async.
-        sendExecutor.execute( new Runnable() {
-            public void run() {
-                try {
-                    clientChannel.write(outboundPacket);
-                    clientChannel.flush();
-                    runMutext.release();
-                } catch (IOException e) {
-                }
-            }
-        });
-
-        while( inboundPacket.hasRemaining() ) {
-            Packet packet = serverChannel.read(1000*5);
-            assertNotNull(packet);
-            packet.read(inboundPacket);
-        }
-        outboundPacket.clear();
-        inboundPacket.clear();
-        assertEquals(outboundPacket.sliceAsBytes(), inboundPacket.sliceAsBytes());
-
-        runMutext.acquire();
-    }
-
-    protected void tearDown() throws Exception {
-        if( isDisabled() ) {
-            return;
-        }
-        log.info("Closing down the channels.");
-        serverChannel.dispose();
-        clientChannel.dispose();
-        server.dispose();
-    }
-
-    protected boolean isDisabled() {
-        return false;
-    }
-
-    public void assertEquals(byte []b1, byte[] b2 ) {
-        assertEquals(b1.length, b2.length);
-        for (int i = 0; i < b2.length; i++) {
-            assertEquals(b1[i], b2[i]);
-        }
-    }
-
-    abstract protected Channel openChannel(URI connectURI) throws IOException ;
-    abstract protected ChannelServer bindChannel() throws IOException, URISyntaxException;
-
-
-}
+/**
+ *
+ * Copyright 2005-2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activeio.packet.sync;
+
+import edu.emory.mathcs.backport.java.util.concurrent.Executor;
+import edu.emory.mathcs.backport.java.util.concurrent.ScheduledThreadPoolExecutor;
+import edu.emory.mathcs.backport.java.util.concurrent.Semaphore;
+
+import org.apache.activeio.Channel;
+import org.apache.activeio.ChannelServer;
+import org.apache.activeio.adapter.AsyncToSyncChannel;
+import org.apache.activeio.adapter.AsyncToSyncChannelServer;
+import org.apache.activeio.packet.ByteArrayPacket;
+import org.apache.activeio.packet.EOSPacket;
+import org.apache.activeio.packet.Packet;
+import org.apache.activeio.packet.sync.SyncChannel;
+import org.apache.activeio.packet.sync.SyncChannelServer;
+import org.apache.activeio.stream.sync.socket.SocketMetadata;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import junit.framework.TestCase;
+
+
+/**
+ * Used to test the {@see org.apache.activeio.net.TcpSynchChannel}
+ *  
+ * @version $Revision$
+ */
+abstract public class SyncChannelTestSupport extends TestCase {
+
+    Log log = LogFactory.getLog(SyncChannelTestSupport.class);
+    private SyncChannelServer server;
+    private SyncChannel clientChannel;
+    private SyncChannel serverChannel;
+    Executor sendExecutor = new ScheduledThreadPoolExecutor(1);
+
+    public void testSmallSendReceive() throws IOException, URISyntaxException, InterruptedException {
+        if( isDisabled() ) {
+            log.info("test disabled: "+getName());
+            return;
+        }
+        Packet outboundPacket = new ByteArrayPacket("Hello World".getBytes());
+        doSendReceive(outboundPacket.duplicate());
+    }
+
+    public void testPeerDisconnect() throws IOException, URISyntaxException, InterruptedException {
+        if( isDisabled() ) {
+            log.info("test disabled: "+getName());
+            return;
+        }
+
+        Packet outboundPacket = new ByteArrayPacket("Hello World".getBytes());
+        doSendReceive(outboundPacket.duplicate());
+        // disconnect the client.
+        clientChannel.dispose();
+
+        // The server should get an EOS packet.
+        Packet packet = serverChannel.read(1000);
+        assertEquals(EOSPacket.EOS_PACKET, packet);
+    }
+
+    public void testManySmallSendReceives() throws IOException, URISyntaxException, InterruptedException {
+        if( isDisabled() ) {
+            log.info("test disabled: "+getName());
+            return;
+        }
+        log.info("Start of testManySmallSendReceives");
+        Packet outboundPacket = new ByteArrayPacket("Hello World".getBytes());
+        long start = System.currentTimeMillis();
+        for( int i=0; i < getTestIterations(); i++ ) {
+            doSendReceive(outboundPacket.duplicate());
+        }
+        long end = System.currentTimeMillis();
+        log.info("done. Duration: "+duration(start,end)+", duration per send: "+unitDuration(start, end, getTestIterations()));
+    }
+
+    private float unitDuration(long start, long end, int testIterations) {
+                return duration(start,end)/testIterations;
+        }
+
+        private float duration(long start, long end) {
+                return (float) (((float)(end-start))/1000.0f);
+        }
+
+        protected int getTestIterations() {
+        return 1000;
+    }
+
+    protected void setUp() throws Exception {
+
+        log.info("Running: "+getName());
+
+        if( isDisabled() ) {
+            return;
+        }
+
+        log.info("Bind to an annonymous tcp port.");
+        server = AsyncToSyncChannelServer.adapt(bindChannel());
+        server.start();
+        log.info("Server Bound at URI: "+server.getBindURI());
+
+        log.info("Client connecting to: "+server.getConnectURI());
+        clientChannel = AsyncToSyncChannel.adapt( openChannel(server.getConnectURI()));
+        clientChannel.start();
+        SocketMetadata socket = (SocketMetadata) clientChannel.getAdapter(SocketMetadata.class);
+        if( socket != null )
+            socket.setTcpNoDelay(true);
+        log.info("Get connection that was accepted on the server side.");
+
+        Channel c = server.accept(1000*5);
+        assertNotNull(c);
+
+        serverChannel = AsyncToSyncChannel.adapt(c);
+        serverChannel.start();
+        socket = (SocketMetadata) serverChannel.getAdapter(SocketMetadata.class);
+        if( socket != null ) {
+            socket.setTcpNoDelay(true);
+            log.info("Server Channel's Remote addreess: "+socket.getRemoteSocketAddress());
+            log.info("Server Channel's Local addreess: "+socket.getLocalSocketAddress());
+        }
+    }
+
+    /**
+     * @param outboundPacket
+     * @throws IOException
+     * @throws URISyntaxException
+     * @throws InterruptedException
+     */
+    private void doSendReceive(final Packet outboundPacket) throws IOException, URISyntaxException, InterruptedException {
+        ByteArrayPacket inboundPacket = new ByteArrayPacket(new byte[outboundPacket.remaining()]);
+        final Semaphore runMutext = new Semaphore(0);
+
+        // Do the send async.
+        sendExecutor.execute( new Runnable() {
+            public void run() {
+                try {
+                    clientChannel.write(outboundPacket);
+                    clientChannel.flush();
+                    runMutext.release();
+                } catch (IOException e) {
+                }
+            }
+        });
+
+        while( inboundPacket.hasRemaining() ) {
+            Packet packet = serverChannel.read(1000*5);
+            assertNotNull(packet);
+            packet.read(inboundPacket);
+        }
+        outboundPacket.clear();
+        inboundPacket.clear();
+        assertEquals(outboundPacket.sliceAsBytes(), inboundPacket.sliceAsBytes());
+
+        runMutext.acquire();
+    }
+
+    protected void tearDown() throws Exception {
+        if( isDisabled() ) {
+            return;
+        }
+        log.info("Closing down the channels.");
+        serverChannel.dispose();
+        clientChannel.dispose();
+        server.dispose();
+    }
+
+    protected boolean isDisabled() {
+        return false;
+    }
+
+    public void assertEquals(byte []b1, byte[] b2 ) {
+        assertEquals(b1.length, b2.length);
+        for (int i = 0; i < b2.length; i++) {
+            assertEquals(b1[i], b2[i]);
+        }
+    }
+
+    abstract protected Channel openChannel(URI connectURI) throws IOException ;
+    abstract protected ChannelServer bindChannel() throws IOException, URISyntaxException;
+
+
+}

Propchange: incubator/activemq/trunk/activeio/activeio-core/src/test/java/org/apache/activeio/packet/sync/SyncChannelTestSupport.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/activeio/activeio-core/src/test/java/org/apache/activeio/packet/sync/datagram/DatagramSyncChannelTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activeio/activeio-core/src/test/java/org/apache/activeio/packet/sync/datagram/DatagramSyncChannelTest.java?rev=379619&r1=379618&r2=379619&view=diff
==============================================================================
--- incubator/activemq/trunk/activeio/activeio-core/src/test/java/org/apache/activeio/packet/sync/datagram/DatagramSyncChannelTest.java (original)
+++ incubator/activemq/trunk/activeio/activeio-core/src/test/java/org/apache/activeio/packet/sync/datagram/DatagramSyncChannelTest.java Tue Feb 21 15:12:56 2006
@@ -1,45 +1,45 @@
-/**
- *
- * Copyright 2005-2006 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.activeio.packet.sync.datagram;
-
-import java.io.IOException;
-import java.net.URI;
-
-import org.apache.activeio.Channel;
-import org.apache.activeio.packet.sync.ConnectionlessSyncChannelTestSupport;
-import org.apache.activeio.packet.sync.datagram.DatagramSocketSyncChannelFactory;
-
-
-/**
- * @version $Revision$
- */
-public class DatagramSyncChannelTest extends ConnectionlessSyncChannelTestSupport {
-
-    DatagramSocketSyncChannelFactory factory = new DatagramSocketSyncChannelFactory();
-
-    protected Channel openClientChannel(URI connectURI) throws IOException {
-        return factory.openSyncChannel(null);
-    }
-
-    protected Channel openServerChannel(URI connectURI) throws IOException {
-        return factory.openSyncChannel(null, connectURI);
-    }
-
-    protected String getAddress() {
-        return "127.0.0.1";
-    }
-}
+/**
+ *
+ * Copyright 2005-2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activeio.packet.sync.datagram;
+
+import java.io.IOException;
+import java.net.URI;
+
+import org.apache.activeio.Channel;
+import org.apache.activeio.packet.sync.ConnectionlessSyncChannelTestSupport;
+import org.apache.activeio.packet.sync.datagram.DatagramSocketSyncChannelFactory;
+
+
+/**
+ * @version $Revision$
+ */
+public class DatagramSyncChannelTest extends ConnectionlessSyncChannelTestSupport {
+
+    DatagramSocketSyncChannelFactory factory = new DatagramSocketSyncChannelFactory();
+
+    protected Channel openClientChannel(URI connectURI) throws IOException {
+        return factory.openSyncChannel(null);
+    }
+
+    protected Channel openServerChannel(URI connectURI) throws IOException {
+        return factory.openSyncChannel(null, connectURI);
+    }
+
+    protected String getAddress() {
+        return "127.0.0.1";
+    }
+}

Propchange: incubator/activemq/trunk/activeio/activeio-core/src/test/java/org/apache/activeio/packet/sync/datagram/DatagramSyncChannelTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/activeio/activeio-core/src/test/java/org/apache/activeio/packet/sync/multicast/MulticastSyncChannelTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activeio/activeio-core/src/test/java/org/apache/activeio/packet/sync/multicast/MulticastSyncChannelTest.java?rev=379619&r1=379618&r2=379619&view=diff
==============================================================================
--- incubator/activemq/trunk/activeio/activeio-core/src/test/java/org/apache/activeio/packet/sync/multicast/MulticastSyncChannelTest.java (original)
+++ incubator/activemq/trunk/activeio/activeio-core/src/test/java/org/apache/activeio/packet/sync/multicast/MulticastSyncChannelTest.java Tue Feb 21 15:12:56 2006
@@ -1,45 +1,45 @@
-/**
- *
- * Copyright 2005-2006 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.activeio.packet.sync.multicast;
-
-import java.io.IOException;
-import java.net.URI;
-
-import org.apache.activeio.Channel;
-import org.apache.activeio.packet.sync.ConnectionlessSyncChannelTestSupport;
-import org.apache.activeio.packet.sync.multicast.MulticastSocketSyncChannelFactory;
-
-
-/**
- * @version $Revision$
- */
-public class MulticastSyncChannelTest extends ConnectionlessSyncChannelTestSupport {
-
-    MulticastSocketSyncChannelFactory factory = new MulticastSocketSyncChannelFactory();
-
-    protected Channel openClientChannel(URI connectURI) throws IOException {
-        return factory.openSyncChannel(connectURI);
-    }
-
-    protected Channel openServerChannel(URI connectURI) throws IOException {
-        return factory.openSyncChannel(connectURI, null);
-    }
-
-    protected String getAddress() {
-        return "224.2.2.2";
-    }
-}
+/**
+ *
+ * Copyright 2005-2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activeio.packet.sync.multicast;
+
+import java.io.IOException;
+import java.net.URI;
+
+import org.apache.activeio.Channel;
+import org.apache.activeio.packet.sync.ConnectionlessSyncChannelTestSupport;
+import org.apache.activeio.packet.sync.multicast.MulticastSocketSyncChannelFactory;
+
+
+/**
+ * @version $Revision$
+ */
+public class MulticastSyncChannelTest extends ConnectionlessSyncChannelTestSupport {
+
+    MulticastSocketSyncChannelFactory factory = new MulticastSocketSyncChannelFactory();
+
+    protected Channel openClientChannel(URI connectURI) throws IOException {
+        return factory.openSyncChannel(connectURI);
+    }
+
+    protected Channel openServerChannel(URI connectURI) throws IOException {
+        return factory.openSyncChannel(connectURI, null);
+    }
+
+    protected String getAddress() {
+        return "224.2.2.2";
+    }
+}

Propchange: incubator/activemq/trunk/activeio/activeio-core/src/test/java/org/apache/activeio/packet/sync/multicast/MulticastSyncChannelTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/activeio/activeio-core/src/test/java/org/apache/activeio/packet/sync/socket/SlowSocketChannelSyncChannelTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activeio/activeio-core/src/test/java/org/apache/activeio/packet/sync/socket/SlowSocketChannelSyncChannelTest.java?rev=379619&r1=379618&r2=379619&view=diff
==============================================================================
--- incubator/activemq/trunk/activeio/activeio-core/src/test/java/org/apache/activeio/packet/sync/socket/SlowSocketChannelSyncChannelTest.java (original)
+++ incubator/activemq/trunk/activeio/activeio-core/src/test/java/org/apache/activeio/packet/sync/socket/SlowSocketChannelSyncChannelTest.java Tue Feb 21 15:12:56 2006
@@ -1,50 +1,50 @@
-/**
- *
- * Copyright 2005-2006 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.activeio.packet.sync.socket;
-
-import java.io.IOException;
-import java.net.URI;
-import java.net.URISyntaxException;
-
-import org.apache.activeio.Channel;
-import org.apache.activeio.ChannelServer;
-import org.apache.activeio.packet.sync.SlowWriteSyncChannelFactory;
-import org.apache.activeio.packet.sync.SyncChannelTestSupport;
-import org.apache.activeio.packet.sync.nio.NIOSyncChannelFactory;
-
-/**
- * @version $Revision$
- */
-public class SlowSocketChannelSyncChannelTest extends SyncChannelTestSupport {
-
-    SlowWriteSyncChannelFactory factory = new SlowWriteSyncChannelFactory(new NIOSyncChannelFactory(true), 1, 100);
-
-    protected Channel openChannel(URI connectURI) throws IOException {
-        return factory.openSyncChannel(connectURI);
-    }
-
-    protected ChannelServer bindChannel() throws IOException, URISyntaxException {
-        return factory.bindSyncChannel(new URI("tcp://localhost:0"));
-    }
-
-    /**
-     * Reduce the number if iterations since we are running slower than normal.
-     */
-    protected int getTestIterations() {
-        return 25;
-    }
-}
+/**
+ *
+ * Copyright 2005-2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activeio.packet.sync.socket;
+
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import org.apache.activeio.Channel;
+import org.apache.activeio.ChannelServer;
+import org.apache.activeio.packet.sync.SlowWriteSyncChannelFactory;
+import org.apache.activeio.packet.sync.SyncChannelTestSupport;
+import org.apache.activeio.packet.sync.nio.NIOSyncChannelFactory;
+
+/**
+ * @version $Revision$
+ */
+public class SlowSocketChannelSyncChannelTest extends SyncChannelTestSupport {
+
+    SlowWriteSyncChannelFactory factory = new SlowWriteSyncChannelFactory(new NIOSyncChannelFactory(true), 1, 100);
+
+    protected Channel openChannel(URI connectURI) throws IOException {
+        return factory.openSyncChannel(connectURI);
+    }
+
+    protected ChannelServer bindChannel() throws IOException, URISyntaxException {
+        return factory.bindSyncChannel(new URI("tcp://localhost:0"));
+    }
+
+    /**
+     * Reduce the number if iterations since we are running slower than normal.
+     */
+    protected int getTestIterations() {
+        return 25;
+    }
+}

Propchange: incubator/activemq/trunk/activeio/activeio-core/src/test/java/org/apache/activeio/packet/sync/socket/SlowSocketChannelSyncChannelTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/activeio/activeio-core/src/test/java/org/apache/activeio/packet/sync/socket/SlowSocketSyncChannelTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activeio/activeio-core/src/test/java/org/apache/activeio/packet/sync/socket/SlowSocketSyncChannelTest.java?rev=379619&r1=379618&r2=379619&view=diff
==============================================================================
--- incubator/activemq/trunk/activeio/activeio-core/src/test/java/org/apache/activeio/packet/sync/socket/SlowSocketSyncChannelTest.java (original)
+++ incubator/activemq/trunk/activeio/activeio-core/src/test/java/org/apache/activeio/packet/sync/socket/SlowSocketSyncChannelTest.java Tue Feb 21 15:12:56 2006
@@ -1,50 +1,50 @@
-/**
- *
- * Copyright 2005-2006 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.activeio.packet.sync.socket;
-
-import java.io.IOException;
-import java.net.URI;
-import java.net.URISyntaxException;
-
-import org.apache.activeio.Channel;
-import org.apache.activeio.ChannelServer;
-import org.apache.activeio.packet.sync.SlowWriteSyncChannelFactory;
-import org.apache.activeio.packet.sync.SyncChannelTestSupport;
-import org.apache.activeio.packet.sync.socket.SocketSyncChannelFactory;
-
-/**
- * @version $Revision$
- */
-public class SlowSocketSyncChannelTest extends SyncChannelTestSupport {
-
-    SlowWriteSyncChannelFactory factory = new SlowWriteSyncChannelFactory(new SocketSyncChannelFactory(), 4, 1);
-
-    protected Channel openChannel(URI connectURI) throws IOException {
-        return factory.openSyncChannel(connectURI);
-    }
-
-    protected ChannelServer bindChannel() throws IOException, URISyntaxException {
-        return factory.bindSyncChannel(new URI("tcp://localhost:0"));
-    }
-
-    /**
-     * Reduce the number if iterations since we are running slower than normal.
-     */
-    protected int getTestIterations() {
-        return 25;
-    }
-}
+/**
+ *
+ * Copyright 2005-2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activeio.packet.sync.socket;
+
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import org.apache.activeio.Channel;
+import org.apache.activeio.ChannelServer;
+import org.apache.activeio.packet.sync.SlowWriteSyncChannelFactory;
+import org.apache.activeio.packet.sync.SyncChannelTestSupport;
+import org.apache.activeio.packet.sync.socket.SocketSyncChannelFactory;
+
+/**
+ * @version $Revision$
+ */
+public class SlowSocketSyncChannelTest extends SyncChannelTestSupport {
+
+    SlowWriteSyncChannelFactory factory = new SlowWriteSyncChannelFactory(new SocketSyncChannelFactory(), 4, 1);
+
+    protected Channel openChannel(URI connectURI) throws IOException {
+        return factory.openSyncChannel(connectURI);
+    }
+
+    protected ChannelServer bindChannel() throws IOException, URISyntaxException {
+        return factory.bindSyncChannel(new URI("tcp://localhost:0"));
+    }
+
+    /**
+     * Reduce the number if iterations since we are running slower than normal.
+     */
+    protected int getTestIterations() {
+        return 25;
+    }
+}

Propchange: incubator/activemq/trunk/activeio/activeio-core/src/test/java/org/apache/activeio/packet/sync/socket/SlowSocketSyncChannelTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/activeio/activeio-core/src/test/java/org/apache/activeio/packet/sync/socket/SocketSyncChannelTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activeio/activeio-core/src/test/java/org/apache/activeio/packet/sync/socket/SocketSyncChannelTest.java?rev=379619&r1=379618&r2=379619&view=diff
==============================================================================
--- incubator/activemq/trunk/activeio/activeio-core/src/test/java/org/apache/activeio/packet/sync/socket/SocketSyncChannelTest.java (original)
+++ incubator/activemq/trunk/activeio/activeio-core/src/test/java/org/apache/activeio/packet/sync/socket/SocketSyncChannelTest.java Tue Feb 21 15:12:56 2006
@@ -1,43 +1,43 @@
-/**
- *
- * Copyright 2005-2006 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.activeio.packet.sync.socket;
-
-import java.io.IOException;
-import java.net.URI;
-import java.net.URISyntaxException;
-
-import org.apache.activeio.Channel;
-import org.apache.activeio.ChannelServer;
-import org.apache.activeio.packet.sync.SyncChannelTestSupport;
-import org.apache.activeio.packet.sync.socket.SocketSyncChannelFactory;
-
-/**
- * @version $Revision$
- */
-public class SocketSyncChannelTest extends SyncChannelTestSupport {
-
-    SocketSyncChannelFactory factory = new SocketSyncChannelFactory();
-    
-    protected Channel openChannel(URI connectURI) throws IOException {
-        return factory.openSyncChannel(connectURI);
-    }
-
-    protected ChannelServer bindChannel() throws IOException, URISyntaxException {
-        return factory.bindSyncChannel(new URI("tcp://localhost:0"));
-    }
-    
-}
+/**
+ *
+ * Copyright 2005-2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activeio.packet.sync.socket;
+
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import org.apache.activeio.Channel;
+import org.apache.activeio.ChannelServer;
+import org.apache.activeio.packet.sync.SyncChannelTestSupport;
+import org.apache.activeio.packet.sync.socket.SocketSyncChannelFactory;
+
+/**
+ * @version $Revision$
+ */
+public class SocketSyncChannelTest extends SyncChannelTestSupport {
+
+    SocketSyncChannelFactory factory = new SocketSyncChannelFactory();
+    
+    protected Channel openChannel(URI connectURI) throws IOException {
+        return factory.openSyncChannel(connectURI);
+    }
+
+    protected ChannelServer bindChannel() throws IOException, URISyntaxException {
+        return factory.bindSyncChannel(new URI("tcp://localhost:0"));
+    }
+    
+}

Propchange: incubator/activemq/trunk/activeio/activeio-core/src/test/java/org/apache/activeio/packet/sync/socket/SocketSyncChannelTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/activeio/activeio-core/src/test/java/org/apache/activeio/packet/sync/ssl/SslSocketSynchChannelTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activeio/activeio-core/src/test/java/org/apache/activeio/packet/sync/ssl/SslSocketSynchChannelTest.java?rev=379619&r1=379618&r2=379619&view=diff
==============================================================================
--- incubator/activemq/trunk/activeio/activeio-core/src/test/java/org/apache/activeio/packet/sync/ssl/SslSocketSynchChannelTest.java (original)
+++ incubator/activemq/trunk/activeio/activeio-core/src/test/java/org/apache/activeio/packet/sync/ssl/SslSocketSynchChannelTest.java Tue Feb 21 15:12:56 2006
@@ -1,53 +1,53 @@
-/**
- *
- * Copyright 2005-2006 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.activeio.packet.sync.ssl;
-
-import java.io.IOException;
-import java.net.URI;
-import java.net.URISyntaxException;
-
-import org.apache.activeio.Channel;
-import org.apache.activeio.ChannelServer;
-import org.apache.activeio.packet.sync.SyncChannelTestSupport;
-import org.apache.activeio.packet.sync.ssl.SslSocketSyncChannelFactory;
-
-/**
- * @version $Revision$
- */
-public class SslSocketSynchChannelTest extends SyncChannelTestSupport {
-
-    static {
-        String basedir = System.getProperty("basedir");
-        System.setProperty("javax.net.ssl.trustStore", basedir+"/src/test/resources/client.keystore");
-        System.setProperty("javax.net.ssl.trustStorePassword", "password");
-        System.setProperty("javax.net.ssl.trustStoreType", "jks");        
-        System.setProperty("javax.net.ssl.keyStore", basedir+"/src/test/resources/server.keystore");
-        System.setProperty("javax.net.ssl.keyStorePassword", "password");
-        System.setProperty("javax.net.ssl.keyStoreType", "jks");        
-        //System.setProperty("javax.net.debug", "ssl,handshake,data,trustmanager");        
-    }
-    
-    SslSocketSyncChannelFactory factory = new SslSocketSyncChannelFactory();
-    
-    protected Channel openChannel(URI connectURI) throws IOException {
-        return factory.openSyncChannel(connectURI);
-    }
-
-    protected ChannelServer bindChannel() throws IOException, URISyntaxException {
-        return factory.bindSyncChannel(new URI("ssl://localhost:0"));
-    }
-}
+/**
+ *
+ * Copyright 2005-2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activeio.packet.sync.ssl;
+
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import org.apache.activeio.Channel;
+import org.apache.activeio.ChannelServer;
+import org.apache.activeio.packet.sync.SyncChannelTestSupport;
+import org.apache.activeio.packet.sync.ssl.SslSocketSyncChannelFactory;
+
+/**
+ * @version $Revision$
+ */
+public class SslSocketSynchChannelTest extends SyncChannelTestSupport {
+
+    static {
+        String basedir = System.getProperty("basedir");
+        System.setProperty("javax.net.ssl.trustStore", basedir+"/src/test/resources/client.keystore");
+        System.setProperty("javax.net.ssl.trustStorePassword", "password");
+        System.setProperty("javax.net.ssl.trustStoreType", "jks");        
+        System.setProperty("javax.net.ssl.keyStore", basedir+"/src/test/resources/server.keystore");
+        System.setProperty("javax.net.ssl.keyStorePassword", "password");
+        System.setProperty("javax.net.ssl.keyStoreType", "jks");        
+        //System.setProperty("javax.net.debug", "ssl,handshake,data,trustmanager");        
+    }
+    
+    SslSocketSyncChannelFactory factory = new SslSocketSyncChannelFactory();
+    
+    protected Channel openChannel(URI connectURI) throws IOException {
+        return factory.openSyncChannel(connectURI);
+    }
+
+    protected ChannelServer bindChannel() throws IOException, URISyntaxException {
+        return factory.bindSyncChannel(new URI("ssl://localhost:0"));
+    }
+}

Propchange: incubator/activemq/trunk/activeio/activeio-core/src/test/java/org/apache/activeio/packet/sync/ssl/SslSocketSynchChannelTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/activemq/trunk/activeio/activeio-core/src/test/java/org/apache/activeio/stats/CountStatisticImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/activemq/trunk/activeio/activeio-core/src/test/java/org/apache/activeio/stats/IndentPrinter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/activemq/trunk/activeio/activeio-core/src/test/java/org/apache/activeio/stats/StatisticImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/activemq/trunk/activeio/activeio-core/src/test/java/org/apache/activeio/stats/TimeStatisticImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/activemq/trunk/activeio/activeio-core/src/test/java/org/apache/activeio/xnet/hba/ServiceAccessControllerTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/activemq/trunk/activeio/activeio-jxta/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/activeio/activeio-jxta/src/main/java/org/apache/activeio/packet/sync/jxta/JxtaSocketSyncChannelFactory.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activeio/activeio-jxta/src/main/java/org/apache/activeio/packet/sync/jxta/JxtaSocketSyncChannelFactory.java?rev=379619&r1=379618&r2=379619&view=diff
==============================================================================
--- incubator/activemq/trunk/activeio/activeio-jxta/src/main/java/org/apache/activeio/packet/sync/jxta/JxtaSocketSyncChannelFactory.java (original)
+++ incubator/activemq/trunk/activeio/activeio-jxta/src/main/java/org/apache/activeio/packet/sync/jxta/JxtaSocketSyncChannelFactory.java Tue Feb 21 15:12:56 2006
@@ -1,90 +1,90 @@
-/**
- *
- * Copyright 2005-2006 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.activeio.packet.sync.jxta;
-
-import java.io.IOException;
-import java.net.InetAddress;
-import java.net.ServerSocket;
-import java.net.Socket;
-import java.net.UnknownHostException;
-
-import javax.net.ServerSocketFactory;
-import javax.net.SocketFactory;
-
-import org.apache.activeio.packet.sync.socket.SocketSyncChannelFactory;
-import org.p2psockets.P2PServerSocket;
-import org.p2psockets.P2PSocket;
-
-/**
- * A SslSynchChannelFactory creates {@see org.apache.activeio.net.TcpSynchChannel}
- * and {@see org.apache.activeio.net.TcpSynchChannelServer} objects that use SSL.
- * 
- * @version $Revision$
- */
-public class JxtaSocketSyncChannelFactory extends SocketSyncChannelFactory {
-
-    static public final class JxtaServerSocketFactory extends ServerSocketFactory {
-
-        private static JxtaServerSocketFactory defaultJxtaServerSocketFactory = new JxtaServerSocketFactory();
-        public static ServerSocketFactory getDefault() {
-            return defaultJxtaServerSocketFactory;
-        }
-
-        private JxtaServerSocketFactory() {}        
-        
-        public ServerSocket createServerSocket(int localPort) throws IOException {           
-            return new P2PServerSocket(localPort);
-        }
-
-        public ServerSocket createServerSocket(int localPort, int backlog) throws IOException {
-            return new P2PServerSocket(localPort, backlog);
-        }
-
-        public ServerSocket createServerSocket(int localPort, int backlog, InetAddress localHost) throws IOException {
-            return new P2PServerSocket(localPort, backlog, localHost);
-        }
-    }
-
-    static public final class JxtaSocketFactory extends SocketFactory {
-
-        private static JxtaSocketFactory defaultJxtaSocketFactory = new JxtaSocketFactory();
-        public static SocketFactory getDefault() {
-            return defaultJxtaSocketFactory;
-        }       
-        private JxtaSocketFactory() {}
-        
-        public Socket createSocket(String remoteHost, int remotePort) throws IOException, UnknownHostException {
-            return new P2PSocket(remoteHost, remotePort);
-        }
-
-        public Socket createSocket(String remoteHost, int remotePort, InetAddress localHost, int localPort) throws IOException, UnknownHostException {
-            return new P2PSocket(remoteHost, remotePort, localHost, localPort);
-        }
-
-        public Socket createSocket(InetAddress remoteHost, int remotePort) throws IOException {
-            return new P2PSocket(remoteHost, remotePort);
-        }
-
-        public Socket createSocket(InetAddress remoteHost, int remotePort, InetAddress localHost, int localPort) throws IOException {
-            return new P2PSocket(remoteHost, remotePort, localHost, localPort);
-        }
-    }
-
-    public JxtaSocketSyncChannelFactory() {
-        super(JxtaSocketFactory.getDefault(), JxtaServerSocketFactory.getDefault());
-    }
-}
+/**
+ *
+ * Copyright 2005-2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activeio.packet.sync.jxta;
+
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.ServerSocket;
+import java.net.Socket;
+import java.net.UnknownHostException;
+
+import javax.net.ServerSocketFactory;
+import javax.net.SocketFactory;
+
+import org.apache.activeio.packet.sync.socket.SocketSyncChannelFactory;
+import org.p2psockets.P2PServerSocket;
+import org.p2psockets.P2PSocket;
+
+/**
+ * A SslSynchChannelFactory creates {@see org.apache.activeio.net.TcpSynchChannel}
+ * and {@see org.apache.activeio.net.TcpSynchChannelServer} objects that use SSL.
+ * 
+ * @version $Revision$
+ */
+public class JxtaSocketSyncChannelFactory extends SocketSyncChannelFactory {
+
+    static public final class JxtaServerSocketFactory extends ServerSocketFactory {
+
+        private static JxtaServerSocketFactory defaultJxtaServerSocketFactory = new JxtaServerSocketFactory();
+        public static ServerSocketFactory getDefault() {
+            return defaultJxtaServerSocketFactory;
+        }
+
+        private JxtaServerSocketFactory() {}        
+        
+        public ServerSocket createServerSocket(int localPort) throws IOException {           
+            return new P2PServerSocket(localPort);
+        }
+
+        public ServerSocket createServerSocket(int localPort, int backlog) throws IOException {
+            return new P2PServerSocket(localPort, backlog);
+        }
+
+        public ServerSocket createServerSocket(int localPort, int backlog, InetAddress localHost) throws IOException {
+            return new P2PServerSocket(localPort, backlog, localHost);
+        }
+    }
+
+    static public final class JxtaSocketFactory extends SocketFactory {
+
+        private static JxtaSocketFactory defaultJxtaSocketFactory = new JxtaSocketFactory();
+        public static SocketFactory getDefault() {
+            return defaultJxtaSocketFactory;
+        }       
+        private JxtaSocketFactory() {}
+        
+        public Socket createSocket(String remoteHost, int remotePort) throws IOException, UnknownHostException {
+            return new P2PSocket(remoteHost, remotePort);
+        }
+
+        public Socket createSocket(String remoteHost, int remotePort, InetAddress localHost, int localPort) throws IOException, UnknownHostException {
+            return new P2PSocket(remoteHost, remotePort, localHost, localPort);
+        }
+
+        public Socket createSocket(InetAddress remoteHost, int remotePort) throws IOException {
+            return new P2PSocket(remoteHost, remotePort);
+        }
+
+        public Socket createSocket(InetAddress remoteHost, int remotePort, InetAddress localHost, int localPort) throws IOException {
+            return new P2PSocket(remoteHost, remotePort, localHost, localPort);
+        }
+    }
+
+    public JxtaSocketSyncChannelFactory() {
+        super(JxtaSocketFactory.getDefault(), JxtaServerSocketFactory.getDefault());
+    }
+}

Propchange: incubator/activemq/trunk/activeio/activeio-jxta/src/main/java/org/apache/activeio/packet/sync/jxta/JxtaSocketSyncChannelFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/activemq/trunk/activeio/activeio-oneport-jetty/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/activeio/activeio-oneport-jetty/src/main/java/org/apache/activeio/oneport/jetty/JettyOnePortSocketListener.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activeio/activeio-oneport-jetty/src/main/java/org/apache/activeio/oneport/jetty/JettyOnePortSocketListener.java?rev=379619&r1=379618&r2=379619&view=diff
==============================================================================
--- incubator/activemq/trunk/activeio/activeio-oneport-jetty/src/main/java/org/apache/activeio/oneport/jetty/JettyOnePortSocketListener.java (original)
+++ incubator/activemq/trunk/activeio/activeio-oneport-jetty/src/main/java/org/apache/activeio/oneport/jetty/JettyOnePortSocketListener.java Tue Feb 21 15:12:56 2006
@@ -1,53 +1,53 @@
-/**
- *
- * Copyright 2005-2006 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.activeio.oneport.jetty;
-
-import java.io.IOException;
-import java.net.ServerSocket;
-
-import org.apache.activeio.adapter.AsyncToSyncChannelServer;
-import org.apache.activeio.adapter.SyncChannelServerToServerSocket;
-import org.apache.activeio.oneport.HttpRecognizer;
-import org.apache.activeio.oneport.OnePortAsyncChannelServer;
-import org.apache.activeio.packet.sync.SyncChannelServer;
-import org.mortbay.http.SocketListener;
-import org.mortbay.util.InetAddrPort;
-
-/**
- *
- */
-public class JettyOnePortSocketListener extends SocketListener {
-
-    private static final long serialVersionUID = 3257567321504561206L;
-    
-    private final OnePortAsyncChannelServer channelServer;
-
-    public JettyOnePortSocketListener(OnePortAsyncChannelServer channelServer) {
-        this.channelServer = channelServer;
-    }
-
-    public JettyOnePortSocketListener(OnePortAsyncChannelServer channelServer, InetAddrPort arg0) {
-        super(arg0);
-        this.channelServer = channelServer;
-    }
-    
-    protected ServerSocket newServerSocket(InetAddrPort addrPort, int backlog) throws IOException {
-       SyncChannelServer syncServer = AsyncToSyncChannelServer.adapt(channelServer.bindAsyncChannel(HttpRecognizer.HTTP_RECOGNIZER));
-       syncServer.start();
-       return new SyncChannelServerToServerSocket(syncServer);
-    }
-}
+/**
+ *
+ * Copyright 2005-2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activeio.oneport.jetty;
+
+import java.io.IOException;
+import java.net.ServerSocket;
+
+import org.apache.activeio.adapter.AsyncToSyncChannelServer;
+import org.apache.activeio.adapter.SyncChannelServerToServerSocket;
+import org.apache.activeio.oneport.HttpRecognizer;
+import org.apache.activeio.oneport.OnePortAsyncChannelServer;
+import org.apache.activeio.packet.sync.SyncChannelServer;
+import org.mortbay.http.SocketListener;
+import org.mortbay.util.InetAddrPort;
+
+/**
+ *
+ */
+public class JettyOnePortSocketListener extends SocketListener {
+
+    private static final long serialVersionUID = 3257567321504561206L;
+    
+    private final OnePortAsyncChannelServer channelServer;
+
+    public JettyOnePortSocketListener(OnePortAsyncChannelServer channelServer) {
+        this.channelServer = channelServer;
+    }
+
+    public JettyOnePortSocketListener(OnePortAsyncChannelServer channelServer, InetAddrPort arg0) {
+        super(arg0);
+        this.channelServer = channelServer;
+    }
+    
+    protected ServerSocket newServerSocket(InetAddrPort addrPort, int backlog) throws IOException {
+       SyncChannelServer syncServer = AsyncToSyncChannelServer.adapt(channelServer.bindAsyncChannel(HttpRecognizer.HTTP_RECOGNIZER));
+       syncServer.start();
+       return new SyncChannelServerToServerSocket(syncServer);
+    }
+}

Propchange: incubator/activemq/trunk/activeio/activeio-oneport-jetty/src/main/java/org/apache/activeio/oneport/jetty/JettyOnePortSocketListener.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/activemq/trunk/activeio/activeio-oneport-jetty/src/test/java/org/apache/activeio/oneport/jetty/JettyOnePortSocketListenerTest.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activeio/activeio-oneport-jetty/src/test/java/org/apache/activeio/oneport/jetty/JettyOnePortSocketListenerTest.java?rev=379619&r1=379618&r2=379619&view=diff
==============================================================================
--- incubator/activemq/trunk/activeio/activeio-oneport-jetty/src/test/java/org/apache/activeio/oneport/jetty/JettyOnePortSocketListenerTest.java (original)
+++ incubator/activemq/trunk/activeio/activeio-oneport-jetty/src/test/java/org/apache/activeio/oneport/jetty/JettyOnePortSocketListenerTest.java Tue Feb 21 15:12:56 2006
@@ -1,65 +1,65 @@
-/**
- *
- * Copyright 2005-2006 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.activeio.oneport.jetty;
-
-import org.apache.activeio.oneport.OnePortAsyncChannelServerTest;
-import org.apache.activeio.oneport.jetty.JettyOnePortSocketListener;
-import org.mortbay.http.HttpContext;
-import org.mortbay.http.HttpServer;
-import org.mortbay.jetty.servlet.ServletHandler;
-
-import edu.emory.mathcs.backport.java.util.concurrent.BlockingQueue;
-
-/**
- * 
- */
-public class JettyOnePortSocketListenerTest extends OnePortAsyncChannelServerTest {
-
-    static public BlockingQueue staticResultSlot;
-
-    private HttpServer jetty;
-
-    protected void startHTTPServer() throws Exception {
-        staticResultSlot = resultSlot;
-
-        // Create the server
-        jetty = new HttpServer();
-
-        // Create a port listener
-        JettyOnePortSocketListener listener = new JettyOnePortSocketListener(server);
-        jetty.addListener(listener);
-
-        // Create a context
-        HttpContext context = new HttpContext();
-        context.setContextPath("/");
-        jetty.addContext(context);
-
-        // Create a servlet container
-        ServletHandler servlets = new ServletHandler();
-        context.addHandler(servlets);
-
-        // Map a servlet onto the container
-        servlets.addServlet("Test", "*", TestServlet.class.getName());
-
-        // Start the http server
-        jetty.start();
-    }
-
-    protected void stopHTTPServer() throws InterruptedException {
-        jetty.stop();
-    }
-}
+/**
+ *
+ * Copyright 2005-2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activeio.oneport.jetty;
+
+import org.apache.activeio.oneport.OnePortAsyncChannelServerTest;
+import org.apache.activeio.oneport.jetty.JettyOnePortSocketListener;
+import org.mortbay.http.HttpContext;
+import org.mortbay.http.HttpServer;
+import org.mortbay.jetty.servlet.ServletHandler;
+
+import edu.emory.mathcs.backport.java.util.concurrent.BlockingQueue;
+
+/**
+ * 
+ */
+public class JettyOnePortSocketListenerTest extends OnePortAsyncChannelServerTest {
+
+    static public BlockingQueue staticResultSlot;
+
+    private HttpServer jetty;
+
+    protected void startHTTPServer() throws Exception {
+        staticResultSlot = resultSlot;
+
+        // Create the server
+        jetty = new HttpServer();
+
+        // Create a port listener
+        JettyOnePortSocketListener listener = new JettyOnePortSocketListener(server);
+        jetty.addListener(listener);
+
+        // Create a context
+        HttpContext context = new HttpContext();
+        context.setContextPath("/");
+        jetty.addContext(context);
+
+        // Create a servlet container
+        ServletHandler servlets = new ServletHandler();
+        context.addHandler(servlets);
+
+        // Map a servlet onto the container
+        servlets.addServlet("Test", "*", TestServlet.class.getName());
+
+        // Start the http server
+        jetty.start();
+    }
+
+    protected void stopHTTPServer() throws InterruptedException {
+        jetty.stop();
+    }
+}

Propchange: incubator/activemq/trunk/activeio/activeio-oneport-jetty/src/test/java/org/apache/activeio/oneport/jetty/JettyOnePortSocketListenerTest.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message