You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by jd...@apache.org on 2007/09/23 14:02:52 UTC

svn commit: r578566 [4/4] - in /geronimo/sandbox/gshell/trunk/gshell-whisper: ./ src/ src/main/java/org/apache/geronimo/gshell/remote/ src/main/java/org/apache/geronimo/gshell/whisper/ src/main/java/org/apache/geronimo/gshell/whisper/crypto/ src/main/j...

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/BaseCommon.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/BaseCommon.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/BaseCommon.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/BaseTransport.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/BaseTransport.java?rev=578566&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/BaseTransport.java (added)
+++ geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/BaseTransport.java Sun Sep 23 05:02:46 2007
@@ -0,0 +1,189 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.geronimo.gshell.whisper.transport.base;
+
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.SocketAddress;
+import java.net.URI;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicLong;
+
+import org.apache.geronimo.gshell.common.Duration;
+import org.apache.geronimo.gshell.whisper.message.Message;
+import org.apache.geronimo.gshell.whisper.message.MessageHandler;
+import org.apache.geronimo.gshell.whisper.message.MessageVisitor;
+import org.apache.geronimo.gshell.whisper.request.Requestor;
+import org.apache.geronimo.gshell.whisper.session.ThreadPoolModel;
+import org.apache.geronimo.gshell.whisper.stream.SessionInputStream;
+import org.apache.geronimo.gshell.whisper.stream.SessionOutputStream;
+import org.apache.geronimo.gshell.whisper.transport.Transport;
+import org.apache.mina.common.CloseFuture;
+import org.apache.mina.common.ConnectFuture;
+import org.apache.mina.common.IoConnector;
+import org.apache.mina.common.IoSession;
+import org.apache.mina.common.WriteFuture;
+import org.codehaus.plexus.component.annotations.Requirement;
+
+/**
+ * Support for {@link Transport} implementations.
+ *
+ * @version $Rev$ $Date$
+ */
+public abstract class BaseTransport
+    extends BaseCommon
+    implements Transport
+{
+    private static final AtomicLong COUNTER = new AtomicLong(0);
+    
+    protected final URI remoteLocation;
+
+    protected final SocketAddress remoteAddress;
+
+    protected final URI localLocation;
+
+    protected final SocketAddress localAddress;
+
+    protected IoConnector connector;
+
+    protected ThreadPoolModel threadModel;
+
+    protected IoSession session;
+
+    protected boolean connected;
+
+    @Requirement(role=MessageVisitor.class, hint="client")
+    private MessageVisitor v;
+
+    protected BaseTransport(final URI remoteLocation, final SocketAddress remoteAddress, final URI localLocation, final SocketAddress localAddress) throws Exception {
+        assert remoteLocation != null;
+        assert remoteAddress != null;
+
+        this.remoteLocation = remoteLocation;
+        this.remoteAddress = remoteAddress;
+
+        this.localLocation = localLocation;
+        this.localAddress = localAddress;
+    }
+
+    protected abstract IoConnector createConnector() throws Exception;
+
+    protected synchronized void init() throws Exception {
+        // For now we must manually bind the message handler, plexus is unable to provide injection for us
+        setMessageHandler((MessageHandler) getContainer().lookup(MessageHandler.class, "client"));
+
+        // Setup the connector service
+        connector = createConnector();
+
+        // Install the thread model
+        threadModel = new ThreadPoolModel(getClass().getSimpleName() + "-" + COUNTER.getAndIncrement());
+        connector.getDefaultConfig().setThreadModel(threadModel);
+
+        // Configure the connector
+        configure(connector);
+    }
+
+    public synchronized void connect() throws Exception {
+        if (connected) {
+            throw new IllegalStateException("Already connected");
+        }
+
+        init();
+
+        log.info("Connecting to: {}", remoteAddress);
+
+        ConnectFuture cf = connector.connect(remoteAddress, localAddress, getHandler());
+
+        cf.join();
+
+        session = cf.getSession();
+
+        connected = true;
+
+        log.info("Connected");
+    }
+
+    public boolean isConnected() {
+        return connected;
+    }
+
+    public synchronized void close() {
+        try {
+            CloseFuture cf = session.close();
+
+            cf.join();
+
+            threadModel.close();
+        }
+        finally {
+            super.close();
+        }
+    }
+
+    public URI getRemoteLocation() {
+        return remoteLocation;
+    }
+
+    public URI getLocalLocation() {
+        return localLocation;
+    }
+
+    public IoSession getSession() {
+        return session;
+    }
+
+    public InputStream getInputStream() {
+        return SessionInputStream.BINDER.lookup(session);
+    }
+
+    public OutputStream getOutputStream() {
+        return SessionOutputStream.BINDER.lookup(session);
+    }
+
+    public WriteFuture send(final Object msg) throws Exception {
+        assert msg != null;
+
+        return session.write(msg);
+    }
+
+    public Message request(final Message msg) throws Exception {
+        assert msg != null;
+
+        Requestor requestor = new Requestor(this);
+
+        return requestor.request(msg);
+    }
+
+    public Message request(final Message msg, final Duration timeout) throws Exception {
+        assert msg != null;
+
+        Requestor requestor = new Requestor(this);
+
+        return requestor.request(msg, timeout);
+    }
+
+    public Message request(final Message msg, final long timeout, final TimeUnit unit) throws Exception {
+        assert msg != null;
+
+        Requestor requestor = new Requestor(this);
+
+        return requestor.request(msg, timeout, unit);
+    }
+}
\ No newline at end of file

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/BaseTransport.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/BaseTransport.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/BaseTransport.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/BaseTransportFactory.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/BaseTransportFactory.java?rev=578566&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/BaseTransportFactory.java (added)
+++ geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/BaseTransportFactory.java Sun Sep 23 05:02:46 2007
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.geronimo.gshell.whisper.transport.base;
+
+import java.net.URI;
+
+import org.apache.geronimo.gshell.whisper.transport.Transport;
+import org.apache.geronimo.gshell.whisper.transport.TransportFactory;
+import org.apache.geronimo.gshell.whisper.transport.TransportServer;
+import org.codehaus.plexus.PlexusContainer;
+import org.codehaus.plexus.component.annotations.Requirement;
+
+/**
+ * Support for {@link TransportFactory} implementations.
+ *
+ * @version $Rev$ $Date$
+ */
+public abstract class BaseTransportFactory
+    implements TransportFactory
+{
+    @Requirement
+    protected PlexusContainer container;
+
+    //
+    // NOTE: We use autowire() here to get a few components injected.  These are injected via setters.
+    //
+
+    public Transport connect(final URI remote, final URI local) throws Exception {
+        assert remote != null;
+        // local can be null
+
+        Transport transport = createTransport(remote, local);
+
+        container.autowire(transport);
+
+        transport.connect();
+
+        return transport;
+    }
+
+    protected abstract Transport createTransport(final URI remote, final URI local) throws Exception;
+
+    public Transport connect(final URI remote) throws Exception {
+        return connect(remote, null);
+    }
+
+    public TransportServer bind(final URI location) throws Exception {
+        assert location != null;
+
+        TransportServer server = createTransportServer(location);
+
+        container.autowire(server);
+
+        server.bind();
+
+        return server;
+    }
+
+    protected abstract TransportServer createTransportServer(final URI location) throws Exception;
+}
\ No newline at end of file

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/BaseTransportFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/BaseTransportFactory.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/BaseTransportFactory.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/BaseTransportServer.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/BaseTransportServer.java?rev=578566&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/BaseTransportServer.java (added)
+++ geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/BaseTransportServer.java Sun Sep 23 05:02:46 2007
@@ -0,0 +1,109 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.geronimo.gshell.whisper.transport.base;
+
+import java.net.SocketAddress;
+import java.net.URI;
+import java.util.concurrent.atomic.AtomicLong;
+
+import org.apache.geronimo.gshell.whisper.message.MessageHandler;
+import org.apache.geronimo.gshell.whisper.session.ThreadPoolModel;
+import org.apache.geronimo.gshell.whisper.transport.TransportServer;
+import org.apache.mina.common.IoAcceptor;
+
+/**
+ * Support for {@link TransportServer} implementations.
+ *
+ * @version $Rev$ $Date$
+ */
+public abstract class BaseTransportServer
+    extends BaseCommon
+    implements TransportServer
+{
+    private static final AtomicLong COUNTER = new AtomicLong(0);
+
+    protected final URI location;
+
+    protected final SocketAddress address;
+
+    protected IoAcceptor acceptor;
+
+    protected ThreadPoolModel threadModel;
+
+    protected boolean bound;
+
+    protected BaseTransportServer(final URI location, final SocketAddress address) {
+        assert location != null;
+        assert address != null;
+
+        this.location = location;
+        this.address = address;
+    }
+
+    public URI getLocation() {
+        return location;
+    }
+
+    protected abstract IoAcceptor createAcceptor() throws Exception;
+
+    protected synchronized void init() throws Exception {
+        // For now we must manually bind the message handler, plexus is unable to provide injection for us
+        setMessageHandler((MessageHandler) getContainer().lookup(MessageHandler.class, "server"));
+
+        // Setup the acceptor service
+        acceptor = createAcceptor();
+
+        // Install the thread model
+        threadModel = new ThreadPoolModel(getClass().getSimpleName() + "-" + COUNTER.getAndIncrement());
+        acceptor.getDefaultConfig().setThreadModel(threadModel);
+
+        // Configure the acceptor
+        configure(acceptor);
+    }
+
+    public synchronized void bind() throws Exception {
+        if (bound) {
+            throw new IllegalStateException("Already bound");
+        }
+
+        init();
+
+        acceptor.bind(address, getHandler());
+
+        bound = true;
+
+        log.info("Listening on: {}", address);
+    }
+
+    public boolean isBound() {
+        return bound;
+    }
+
+    public synchronized void close() {
+        try {
+            acceptor.unbind(address);
+
+            threadModel.close();
+        }
+        finally {
+            super.close();
+        }
+    }
+}
\ No newline at end of file

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/BaseTransportServer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/BaseTransportServer.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/BaseTransportServer.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/package-info.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/package-info.java?rev=578566&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/package-info.java (added)
+++ geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/package-info.java Sun Sep 23 05:02:46 2007
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+/**
+ * Base support for transport implementations.
+ *
+ * @version $Rev$ $Date$
+ */
+package org.apache.geronimo.gshell.whisper.transport.base;
\ No newline at end of file

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/package-info.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/package-info.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/base/package-info.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/package-info.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/package-info.java?rev=578566&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/package-info.java (added)
+++ geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/package-info.java Sun Sep 23 05:02:46 2007
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+/**
+ * Provides a framework for pluggable client/server message transports.
+ *
+ * @version $Rev$ $Date$
+ */
+package org.apache.geronimo.gshell.whisper.transport;
\ No newline at end of file

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/package-info.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/package-info.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/package-info.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/ssl/SslTransport.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/ssl/SslTransport.java?rev=578566&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/ssl/SslTransport.java (added)
+++ geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/ssl/SslTransport.java Sun Sep 23 05:02:46 2007
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.geronimo.gshell.whisper.transport.ssl;
+
+import java.net.URI;
+
+import org.apache.geronimo.gshell.whisper.ssl.SSLContextFactory;
+import org.apache.geronimo.gshell.whisper.transport.tcp.TcpTransport;
+import org.apache.mina.common.DefaultIoFilterChainBuilder;
+import org.apache.mina.filter.SSLFilter;
+
+/**
+ * Provides TCP+SSL client-side support.
+ *
+ * @version $Rev$ $Date$
+ */
+public class SslTransport
+    extends TcpTransport
+{
+    public SslTransport(final URI remote, final URI local) throws Exception {
+        super(remote, local);
+    }
+
+    @Override
+    protected void configure(final DefaultIoFilterChainBuilder chain) throws Exception {
+        assert chain != null;
+
+        super.configure(chain);
+
+        SSLFilter sslFilter = new SSLFilter(getSslContextFactory().createClientContext());
+        sslFilter.setUseClientMode(true);
+
+        chain.addFirst(SSLFilter.class.getSimpleName(), sslFilter);
+    }
+
+    //
+    // AutoWire Support, Setters exposed to support Plexus autowire()  Getters exposed to handle state checking.
+    //
+
+    private SSLContextFactory sslContextFactory;
+    
+    public void setSslContextFactory(final SSLContextFactory factory) {
+        log.debug("Using SSL Context Factory: {}", factory);
+
+        this.sslContextFactory = factory;
+    }
+
+    protected SSLContextFactory getSslContextFactory() {
+        if (sslContextFactory == null) {
+            throw new IllegalStateException("SSL context factory not bound");
+        }
+
+        return sslContextFactory;
+    }
+}
\ No newline at end of file

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/ssl/SslTransport.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/ssl/SslTransport.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/ssl/SslTransport.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/ssl/SslTransportFactory.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/ssl/SslTransportFactory.java?rev=578566&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/ssl/SslTransportFactory.java (added)
+++ geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/ssl/SslTransportFactory.java Sun Sep 23 05:02:46 2007
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.geronimo.gshell.whisper.transport.ssl;
+
+import java.net.URI;
+
+import org.apache.geronimo.gshell.whisper.transport.Transport;
+import org.apache.geronimo.gshell.whisper.transport.TransportFactory;
+import org.apache.geronimo.gshell.whisper.transport.TransportServer;
+import org.apache.geronimo.gshell.whisper.transport.tcp.TcpTransportFactory;
+import org.codehaus.plexus.component.annotations.Component;
+
+/**
+ * Produces TCP+SSL transport instances.
+ *
+ * @version $Rev$ $Date$
+ */
+@Component(role=TransportFactory.class, hint="ssl")
+public class SslTransportFactory
+    extends TcpTransportFactory
+{
+    @Override
+    protected Transport createTransport(final URI remote, final URI local) throws Exception {
+        return new SslTransport(remote, local);
+    }
+
+    @Override
+    protected TransportServer createTransportServer(final URI location) throws Exception {
+        return new SslTransportServer(location);
+    }
+}
\ No newline at end of file

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/ssl/SslTransportFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/ssl/SslTransportFactory.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/ssl/SslTransportFactory.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/ssl/SslTransportServer.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/ssl/SslTransportServer.java?rev=578566&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/ssl/SslTransportServer.java (added)
+++ geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/ssl/SslTransportServer.java Sun Sep 23 05:02:46 2007
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.geronimo.gshell.whisper.transport.ssl;
+
+import java.net.URI;
+
+import org.apache.geronimo.gshell.whisper.ssl.SSLContextFactory;
+import org.apache.geronimo.gshell.whisper.transport.tcp.TcpTransportServer;
+import org.apache.mina.common.DefaultIoFilterChainBuilder;
+import org.apache.mina.filter.SSLFilter;
+
+/**
+ * Provides TCP+SSL server-side support.
+ *
+ * @version $Rev$ $Date$
+ */
+public class SslTransportServer
+    extends TcpTransportServer
+{
+    public SslTransportServer(final URI location) throws Exception {
+        super(location);
+    }
+
+    @Override
+    protected void configure(final DefaultIoFilterChainBuilder chain) throws Exception {
+        assert chain != null;
+
+        super.configure(chain);
+
+        SSLFilter sslFilter = new SSLFilter(getSslContextFactory().createServerContext());
+
+        chain.addFirst(SSLFilter.class.getSimpleName(), sslFilter);
+    }
+
+    //
+    // AutoWire Support, Setters exposed to support Plexus autowire()  Getters exposed to handle state checking.
+    //
+
+    private SSLContextFactory sslContextFactory;
+
+    public void setSslContextFactory(final SSLContextFactory factory) {
+        log.debug("Using SSL Context Factory: {}", factory);
+
+        this.sslContextFactory = factory;
+    }
+
+    protected SSLContextFactory getSslContextFactory() {
+        if (sslContextFactory == null) {
+            throw new IllegalStateException("SSL context factory not bound");
+        }
+
+        return sslContextFactory;
+    }
+}
\ No newline at end of file

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/ssl/SslTransportServer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/ssl/SslTransportServer.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/ssl/SslTransportServer.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/ssl/package-info.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/ssl/package-info.java?rev=578566&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/ssl/package-info.java (added)
+++ geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/ssl/package-info.java Sun Sep 23 05:02:46 2007
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+/**
+ * Support for connections over TCP+SSL.
+ *
+ * @version $Rev$ $Date$
+ */
+package org.apache.geronimo.gshell.whisper.transport.ssl;
\ No newline at end of file

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/ssl/package-info.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/ssl/package-info.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/ssl/package-info.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/tcp/TcpTransport.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/tcp/TcpTransport.java?rev=578566&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/tcp/TcpTransport.java (added)
+++ geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/tcp/TcpTransport.java Sun Sep 23 05:02:46 2007
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.geronimo.gshell.whisper.transport.tcp;
+
+import java.net.URI;
+import java.util.concurrent.Executors;
+
+import org.apache.geronimo.gshell.whisper.transport.base.BaseTransport;
+import org.apache.mina.common.IoConnector;
+import org.apache.mina.transport.socket.nio.SocketConnector;
+import org.apache.mina.transport.socket.nio.SocketConnectorConfig;
+
+/**
+ * Provides TCP client-side support.
+ *
+ * @version $Rev$ $Date$
+ */
+public class TcpTransport
+    extends BaseTransport
+{
+    public TcpTransport(final URI remote, final URI local) throws Exception {
+        super(remote, TcpTransportFactory.address(remote), local, TcpTransportFactory.address(local));
+    }
+
+    @Override
+    protected IoConnector createConnector() throws Exception {
+        SocketConnector connector = new SocketConnector(Runtime.getRuntime().availableProcessors() + 1, Executors.newCachedThreadPool());
+
+        SocketConnectorConfig config = connector.getDefaultConfig();
+
+        config.getSessionConfig().setKeepAlive(true);
+
+        return connector;
+    }
+}
\ No newline at end of file

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/tcp/TcpTransport.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/tcp/TcpTransport.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/tcp/TcpTransport.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/tcp/TcpTransportFactory.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/tcp/TcpTransportFactory.java?rev=578566&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/tcp/TcpTransportFactory.java (added)
+++ geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/tcp/TcpTransportFactory.java Sun Sep 23 05:02:46 2007
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.geronimo.gshell.whisper.transport.tcp;
+
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import java.net.URI;
+import java.net.UnknownHostException;
+
+import org.apache.geronimo.gshell.whisper.transport.Transport;
+import org.apache.geronimo.gshell.whisper.transport.TransportFactory;
+import org.apache.geronimo.gshell.whisper.transport.TransportServer;
+import org.apache.geronimo.gshell.whisper.transport.base.BaseTransportFactory;
+import org.codehaus.plexus.component.annotations.Component;
+
+/**
+ * Produces TCP transport instances.
+ *
+ * @version $Rev$ $Date$
+ */
+@Component(role=TransportFactory.class, hint="tcp")
+public class TcpTransportFactory
+    extends BaseTransportFactory
+{
+    @Override
+    protected Transport createTransport(final URI remote, final URI local) throws Exception {
+        return new TcpTransport(remote, local);
+    }
+
+    @Override
+    protected TransportServer createTransportServer(final URI location) throws Exception {
+        return new TcpTransportServer(location);
+    }
+
+    static InetSocketAddress address(final URI location) throws UnknownHostException {
+        InetSocketAddress addr = null;
+
+        if (location != null) {
+            addr = new InetSocketAddress(InetAddress.getByName(location.getHost()), location.getPort());
+        }
+
+        return addr;
+    }
+}
\ No newline at end of file

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/tcp/TcpTransportFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/tcp/TcpTransportFactory.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/tcp/TcpTransportFactory.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/tcp/TcpTransportServer.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/tcp/TcpTransportServer.java?rev=578566&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/tcp/TcpTransportServer.java (added)
+++ geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/tcp/TcpTransportServer.java Sun Sep 23 05:02:46 2007
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.geronimo.gshell.whisper.transport.tcp;
+
+import java.net.URI;
+import java.util.concurrent.Executors;
+
+import org.apache.geronimo.gshell.whisper.transport.base.BaseTransportServer;
+import org.apache.mina.common.IoAcceptor;
+import org.apache.mina.transport.socket.nio.SocketAcceptor;
+import org.apache.mina.transport.socket.nio.SocketAcceptorConfig;
+
+/**
+ * Provides TCP server-side support.
+ *
+ * @version $Rev$ $Date$
+ */
+public class TcpTransportServer
+    extends BaseTransportServer
+{
+    public TcpTransportServer(final URI location) throws Exception {
+        super(location, TcpTransportFactory.address(location));
+    }
+
+    @Override
+    protected IoAcceptor createAcceptor() throws Exception {
+        SocketAcceptor acceptor = new SocketAcceptor(Runtime.getRuntime().availableProcessors() + 1, Executors.newCachedThreadPool());
+
+        SocketAcceptorConfig config = acceptor.getDefaultConfig();
+
+        config.getSessionConfig().setKeepAlive(true);
+
+        return acceptor;
+    }
+}
\ No newline at end of file

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/tcp/TcpTransportServer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/tcp/TcpTransportServer.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/tcp/TcpTransportServer.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/tcp/package-info.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/tcp/package-info.java?rev=578566&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/tcp/package-info.java (added)
+++ geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/tcp/package-info.java Sun Sep 23 05:02:46 2007
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+/**
+ * Support for connections over TCP.
+ *
+ * @version $Rev$ $Date$
+ */
+package org.apache.geronimo.gshell.whisper.transport.tcp;
\ No newline at end of file

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/tcp/package-info.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/tcp/package-info.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/tcp/package-info.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/vm/VmTransport.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/vm/VmTransport.java?rev=578566&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/vm/VmTransport.java (added)
+++ geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/vm/VmTransport.java Sun Sep 23 05:02:46 2007
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.geronimo.gshell.whisper.transport.vm;
+
+import java.net.URI;
+
+import org.apache.geronimo.gshell.whisper.transport.base.BaseTransport;
+import org.apache.mina.common.IoConnector;
+import org.apache.mina.transport.vmpipe.VmPipeConnector;
+
+/**
+ * Provides in-VM client-side support.
+ *
+ * @version $Rev$ $Date$
+ */
+public class VmTransport
+    extends BaseTransport
+{
+    public VmTransport(final URI remote, final URI local) throws Exception {
+        super(remote, VmTransportFactory.address(remote), local, VmTransportFactory.address(local));
+    }
+
+    @Override
+    protected IoConnector createConnector() throws Exception {
+        return new VmPipeConnector();
+    }
+}
\ No newline at end of file

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/vm/VmTransport.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/vm/VmTransport.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/vm/VmTransport.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/vm/VmTransportFactory.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/vm/VmTransportFactory.java?rev=578566&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/vm/VmTransportFactory.java (added)
+++ geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/vm/VmTransportFactory.java Sun Sep 23 05:02:46 2007
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.geronimo.gshell.whisper.transport.vm;
+
+import java.net.URI;
+
+import org.apache.geronimo.gshell.whisper.transport.Transport;
+import org.apache.geronimo.gshell.whisper.transport.TransportFactory;
+import org.apache.geronimo.gshell.whisper.transport.TransportServer;
+import org.apache.geronimo.gshell.whisper.transport.base.BaseTransportFactory;
+import org.apache.mina.transport.vmpipe.VmPipeAddress;
+import org.codehaus.plexus.component.annotations.Component;
+
+/**
+ * Produces in-VM transport instances.
+ *
+ * @version $Rev$ $Date$
+ */
+@Component(role=TransportFactory.class, hint="vm")
+public class VmTransportFactory
+    extends BaseTransportFactory
+{
+    @Override
+    protected Transport createTransport(final URI remote, final URI local) throws Exception {
+        return new VmTransport(remote, local);
+    }
+
+    @Override
+    protected TransportServer createTransportServer(final URI location) throws Exception {
+        return new VmTransportServer(location);
+    }
+
+    static VmPipeAddress address(final URI location) {
+        VmPipeAddress addr = null;
+
+        if (location != null) {
+            addr = new VmPipeAddress(location.getPort());
+        }
+
+        return addr;
+    }
+}
\ No newline at end of file

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/vm/VmTransportFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/vm/VmTransportFactory.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/vm/VmTransportFactory.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/vm/VmTransportServer.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/vm/VmTransportServer.java?rev=578566&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/vm/VmTransportServer.java (added)
+++ geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/vm/VmTransportServer.java Sun Sep 23 05:02:46 2007
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.geronimo.gshell.whisper.transport.vm;
+
+import java.net.URI;
+
+import org.apache.geronimo.gshell.whisper.transport.base.BaseTransportServer;
+import org.apache.mina.common.IoAcceptor;
+import org.apache.mina.transport.vmpipe.VmPipeAcceptor;
+
+/**
+ * Provides in-VM server-side support.
+ *
+ * @version $Rev$ $Date$
+ */
+public class VmTransportServer
+    extends BaseTransportServer
+{
+    public VmTransportServer(final URI location) throws Exception {
+        super(location, VmTransportFactory.address(location));
+    }
+
+    @Override
+    protected IoAcceptor createAcceptor() throws Exception {
+        return new VmPipeAcceptor();
+    }
+}
\ No newline at end of file

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/vm/VmTransportServer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/vm/VmTransportServer.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/vm/VmTransportServer.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/vm/package-info.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/vm/package-info.java?rev=578566&view=auto
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/vm/package-info.java (added)
+++ geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/vm/package-info.java Sun Sep 23 05:02:46 2007
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+
+/**
+ * Support for in-VM connections.
+ *
+ * @version $Rev$ $Date$
+ */
+package org.apache.geronimo.gshell.whisper.transport.vm;
\ No newline at end of file

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/vm/package-info.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/vm/package-info.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/vm/package-info.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/resources/org/apache/geronimo/gshell/whisper/ssl/bogus.cert
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/resources/org/apache/geronimo/gshell/whisper/ssl/bogus.cert?rev=578566&view=auto
==============================================================================
Binary file - no diff available.

Propchange: geronimo/sandbox/gshell/trunk/gshell-whisper/src/main/resources/org/apache/geronimo/gshell/whisper/ssl/bogus.cert
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream