geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r601529 - in /geronimo/gshell/trunk: gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/crypto/ gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/ gshell-remote/gshell-...
Date Wed, 05 Dec 2007 21:13:08 GMT
Author: gnodet
Date: Wed Dec  5 13:13:06 2007
New Revision: 601529

URL: http://svn.apache.org/viewvc?rev=601529&view=rev
Log:
GSHELL-60: whisper and remote heavily rely on plexus

Added:
    geronimo/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/DefaultTransportFactoryLocator.java
  (contents, props changed)
      - copied, changed from r601342, geronimo/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/TransportFactoryLocator.java
    geronimo/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/LookupException.java
    geronimo/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/TransportFactoryLocator.java
Modified:
    geronimo/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/crypto/CryptoContext.java
    geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/DefaultRemoteShell.java
    geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/RshServer.java
    geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ConnectHandler.java
    geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/LoginHandler.java
    geronimo/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/ssl/SslTransport.java
    geronimo/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/ssl/SslTransportServer.java
    geronimo/gshell/trunk/gshell-whisper/src/test/java/org/apache/geronimo/gshell/whisper/transport/TransportFactoryLocatorTest.java
    geronimo/gshell/trunk/gshell-whisper/src/test/java/org/apache/geronimo/gshell/whisper/transport/vm/VmTransportTest.java

Modified: geronimo/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/crypto/CryptoContext.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/crypto/CryptoContext.java?rev=601529&r1=601528&r2=601529&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/crypto/CryptoContext.java
(original)
+++ geronimo/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/crypto/CryptoContext.java
Wed Dec  5 13:13:06 2007
@@ -61,6 +61,12 @@
         keyPair = keyGen.genKeyPair();
     }
 
+    public CryptoContext(final String transformation, final String provider) throws Exception
{
+        this();
+        this.transformation = transformation;
+        this.provider = provider;
+    }
+
     public PublicKey getPublicKey() {
         return keyPair.getPublic();
     }

Modified: geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/DefaultRemoteShell.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/DefaultRemoteShell.java?rev=601529&r1=601528&r2=601529&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/DefaultRemoteShell.java
(original)
+++ geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/DefaultRemoteShell.java
Wed Dec  5 13:13:06 2007
@@ -49,6 +49,15 @@
     private Environment env;
 
     private boolean opened = true;
+
+    public DefaultRemoteShell() {
+    }
+
+    public DefaultRemoteShell(final ShellInfo shellInfo, final CommandExecutor executor,
final Environment env) {
+        this.shellInfo = shellInfo;
+        this.executor = executor;
+        this.env = env;
+    }
     
     private void ensureOpened() {
         if (!opened) {

Modified: geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/RshServer.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/RshServer.java?rev=601529&r1=601528&r2=601529&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/RshServer.java
(original)
+++ geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/RshServer.java
Wed Dec  5 13:13:06 2007
@@ -60,6 +60,16 @@
     @Requirement(role=ServerMessageHandler.class)
     private List<ServerMessageHandler> handlers;
 
+    public RshServer() {
+    }
+
+    public RshServer(final TimeoutManager timeoutManager, final TransportFactoryLocator locator,
final List<ServerMessageHandler> handlers) {
+        this.timeoutManager = timeoutManager;
+        this.locator = locator;
+        this.handlers = handlers;
+        
+    }
+
     public void bind(final URI location) throws Exception {
         TransportFactory factory = locator.locate(location);
 

Modified: geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ConnectHandler.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ConnectHandler.java?rev=601529&r1=601528&r2=601529&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ConnectHandler.java
(original)
+++ geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/ConnectHandler.java
Wed Dec  5 13:13:06 2007
@@ -46,6 +46,12 @@
         super(ConnectMessage.class);
     }
 
+    public ConnectHandler(final CryptoContext crypto, final TimeoutManager timeoutManager)
{
+        this();
+        this.crypto = crypto;
+        this.timeoutManager = timeoutManager;
+    }
+
     public void handle(final Session session, final ServerSessionContext context, final ConnectMessage
message) throws Exception {
         // Try to cancel the timeout task
         if (!timeoutManager.cancelTimeout(session)) {

Modified: geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/LoginHandler.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/LoginHandler.java?rev=601529&r1=601528&r2=601529&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/LoginHandler.java
(original)
+++ geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/LoginHandler.java
Wed Dec  5 13:13:06 2007
@@ -51,6 +51,11 @@
         super(LoginMessage.class);
     }
 
+    public LoginHandler(final TimeoutManager timeoutManager) {
+        this();
+        this.timeoutManager = timeoutManager;
+    }
+
     public void initialize() throws InitializationException {
         new JaasConfigurationHelper("server.login.conf").initialize();
     }

Copied: geronimo/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/DefaultTransportFactoryLocator.java
(from r601342, geronimo/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/TransportFactoryLocator.java)
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/DefaultTransportFactoryLocator.java?p2=geronimo/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/DefaultTransportFactoryLocator.java&p1=geronimo/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/TransportFactoryLocator.java&r1=601342&r2=601529&rev=601529&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/TransportFactoryLocator.java
(original)
+++ geronimo/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/DefaultTransportFactoryLocator.java
Wed Dec  5 13:13:06 2007
@@ -31,9 +31,9 @@
  *
  * @version $Rev$ $Date$
  */
-@Component(role=TransportFactoryLocator.class)
-public class TransportFactoryLocator<T extends TransportFactory>
-{
+@Component(role = TransportFactoryLocator.class)
+public class DefaultTransportFactoryLocator<T extends TransportFactory> implements
TransportFactoryLocator<T> {
+
     @Requirement
     private PlexusContainer container;
 
@@ -45,7 +45,7 @@
         this.container = container;
     }
 
-    public T locate(final URI location) throws InvalidLocationException, ComponentLookupException
{
+    public T locate(final URI location) throws InvalidLocationException, LookupException
{
         assert location != null;
 
         String scheme = location.getScheme();
@@ -55,7 +55,11 @@
         }
 
         // noinspection unchecked
-        return (T) container.lookup(TransportFactory.class, scheme);
+        try {
+            return (T) container.lookup(TransportFactory.class, scheme);
+        } catch (ComponentLookupException e) {
+            throw new LookupException(scheme, e);
+        }
     }
 
 }

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

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

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

Added: geronimo/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/LookupException.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/LookupException.java?rev=601529&view=auto
==============================================================================
--- geronimo/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/LookupException.java
(added)
+++ geronimo/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/LookupException.java
Wed Dec  5 13:13:06 2007
@@ -0,0 +1,36 @@
+/*
+ * 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;
+
+/**
+ * Exception thrown when the TranportFactoryLocator can not find the given transport
+ *
+ * @version $Rev: 579828 $ $Date: 2007-09-27 00:15:42 +0200 (Thu, 27 Sep 2007) $
+ */
+public class LookupException extends TransportException {
+
+    public LookupException(final String name) {
+        super("Unabled to lookup: " + name, null);
+    }
+
+    public LookupException(final String name, Throwable cause) {
+        super("Unabled to lookup: " + name, cause);
+    }
+}

Added: geronimo/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/TransportFactoryLocator.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/TransportFactoryLocator.java?rev=601529&view=auto
==============================================================================
--- geronimo/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/TransportFactoryLocator.java
(added)
+++ geronimo/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/TransportFactoryLocator.java
Wed Dec  5 13:13:06 2007
@@ -0,0 +1,33 @@
+/*
+ * 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;
+
+import java.net.URI;
+
+/**
+ * Helper to locate a {@link TransportFactory} instance.
+ *
+ * @version $Rev$ $Date$
+ */
+public interface TransportFactoryLocator<T extends TransportFactory> {
+
+    T locate(URI location) throws TransportException;
+
+}

Modified: geronimo/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/ssl/SslTransport.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/ssl/SslTransport.java?rev=601529&r1=601528&r2=601529&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/ssl/SslTransport.java
(original)
+++ geronimo/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/ssl/SslTransport.java
Wed Dec  5 13:13:06 2007
@@ -43,6 +43,11 @@
         super(new SslAddressFactory());
     }
 
+    public SslTransport(final SSLContextFactory contextFactory) {
+        this();
+        this.contextFactory = contextFactory;
+    }
+
     @Override
     protected void configure(final DefaultIoFilterChainBuilder chain) throws Exception {
         assert chain != null;

Modified: geronimo/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/ssl/SslTransportServer.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/ssl/SslTransportServer.java?rev=601529&r1=601528&r2=601529&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/ssl/SslTransportServer.java
(original)
+++ geronimo/gshell/trunk/gshell-whisper/src/main/java/org/apache/geronimo/gshell/whisper/transport/ssl/SslTransportServer.java
Wed Dec  5 13:13:06 2007
@@ -43,6 +43,11 @@
         super(new SslAddressFactory());
     }
 
+    public SslTransportServer(final SSLContextFactory contextFactory) {
+        this();
+        this.contextFactory = contextFactory;
+    }
+
     @Override
     protected void configure(final DefaultIoFilterChainBuilder chain) throws Exception {
         assert chain != null;

Modified: geronimo/gshell/trunk/gshell-whisper/src/test/java/org/apache/geronimo/gshell/whisper/transport/TransportFactoryLocatorTest.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-whisper/src/test/java/org/apache/geronimo/gshell/whisper/transport/TransportFactoryLocatorTest.java?rev=601529&r1=601528&r2=601529&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-whisper/src/test/java/org/apache/geronimo/gshell/whisper/transport/TransportFactoryLocatorTest.java
(original)
+++ geronimo/gshell/trunk/gshell-whisper/src/test/java/org/apache/geronimo/gshell/whisper/transport/TransportFactoryLocatorTest.java
Wed Dec  5 13:13:06 2007
@@ -25,7 +25,6 @@
 import org.apache.geronimo.gshell.whisper.transport.tcp.TcpTransportFactory;
 import org.apache.geronimo.gshell.whisper.transport.vm.VmTransportFactory;
 import org.codehaus.plexus.PlexusTestCase;
-import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
 
 /**
  * Tests for the {@link TransportFactoryLocator} class.
@@ -81,7 +80,7 @@
             locator.locate(uri);
             fail();
         }
-        catch (ComponentLookupException expected) {}
+        catch (LookupException expected) {}
     }
 
     public void testLocate_badLocation() throws Exception {

Modified: geronimo/gshell/trunk/gshell-whisper/src/test/java/org/apache/geronimo/gshell/whisper/transport/vm/VmTransportTest.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-whisper/src/test/java/org/apache/geronimo/gshell/whisper/transport/vm/VmTransportTest.java?rev=601529&r1=601528&r2=601529&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-whisper/src/test/java/org/apache/geronimo/gshell/whisper/transport/vm/VmTransportTest.java
(original)
+++ geronimo/gshell/trunk/gshell-whisper/src/test/java/org/apache/geronimo/gshell/whisper/transport/vm/VmTransportTest.java
Wed Dec  5 13:13:06 2007
@@ -22,12 +22,12 @@
 import java.net.URI;
 
 import org.apache.geronimo.gshell.whisper.transport.InvalidLocationException;
+import org.apache.geronimo.gshell.whisper.transport.LookupException;
 import org.apache.geronimo.gshell.whisper.transport.TransportFactory;
 import org.apache.geronimo.gshell.whisper.transport.TransportFactoryLocator;
 import org.apache.geronimo.gshell.whisper.transport.ssl.SslTransportFactory;
 import org.apache.geronimo.gshell.whisper.transport.tcp.TcpTransportFactory;
 import org.codehaus.plexus.PlexusTestCase;
-import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
 
 /**
  * Tests for the {@link VmTransport} class.
@@ -84,7 +84,7 @@
             locator.locate(uri);
             fail();
         }
-        catch (ComponentLookupException expected) {}
+        catch (LookupException expected) {}
     }
 
     public void testLocate_badLocation() throws Exception {



Mime
View raw message