geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r123130 - in geronimo/trunk: etc modules/assembly modules/remoting modules/security modules/security/src/java/org/apache/geronimo/security/network/protocol modules/security/src/java/org/apache/geronimo/security/remoting/jmx modules/security/src/test/org/apache/geronimo/security modules/security/src/test/org/apache/geronimo/security/bridge modules/security/src/test/org/apache/geronimo/security/jaas modules/security/src/test/org/apache/geronimo/security/remoting/jmx sandbox/remoting
Date Wed, 22 Dec 2004 17:56:25 GMT
Author: chirino
Date: Wed Dec 22 09:56:23 2004
New Revision: 123130

URL: http://svn.apache.org/viewcvs?view=rev&rev=123130
Log:
The use of NIO in remoting was causing all kinds of problems since NIO behaves so differently on so many platforms.  Switching security to use activeio to for it's network io needs and placing remoting into the sandbox.
Added:
   geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/network/protocol/SubjectCarryingChannel.java
   geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/InvocationSupport.java
   geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/InvocationType.java
   geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/ObjectInputStreamExt.java
   geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/RequestChannelInterceptor.java
   geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/RequestChannelInterceptorInvoker.java
   geronimo/trunk/sandbox/remoting/
      - copied from r122925, geronimo/trunk/modules/remoting/
Removed:
   geronimo/trunk/modules/remoting/
Modified:
   geronimo/trunk/etc/project.properties
   geronimo/trunk/modules/assembly/project.xml
   geronimo/trunk/modules/security/project.xml
   geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/JaasLoginServiceRemotingClient.java
   geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/JaasLoginServiceRemotingServer.java
   geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/AbstractTest.java
   geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/bridge/TestPrincipal.java
   geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/jaas/ConfigurationEntryTest.java
   geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/jaas/TimeoutTest.java
   geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/remoting/jmx/RemoteLoginTest.java

Modified: geronimo/trunk/etc/project.properties
Url: http://svn.apache.org/viewcvs/geronimo/trunk/etc/project.properties?view=diff&rev=123130&p1=geronimo/trunk/etc/project.properties&r1=123129&p2=geronimo/trunk/etc/project.properties&r2=123130
==============================================================================
--- geronimo/trunk/etc/project.properties	(original)
+++ geronimo/trunk/etc/project.properties	Wed Dec 22 09:56:23 2004
@@ -68,6 +68,7 @@
 geronimo_system_version=1.0-SNAPSHOT
 
 # actual dependencies
+activeio_version=1.0-SNAPSHOT
 activemq_version=1.3-SNAPSHOT
 geronimo_version=1.0-SNAPSHOT
 openejb_version=2.0-SNAPSHOT

Modified: geronimo/trunk/modules/assembly/project.xml
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/assembly/project.xml?view=diff&rev=123130&p1=geronimo/trunk/modules/assembly/project.xml&r1=123129&p2=geronimo/trunk/modules/assembly/project.xml&r2=123130
==============================================================================
--- geronimo/trunk/modules/assembly/project.xml	(original)
+++ geronimo/trunk/modules/assembly/project.xml	Wed Dec 22 09:56:23 2004
@@ -225,6 +225,16 @@
         </dependency>
 
         <dependency>
+            <groupId>activeio</groupId>
+            <artifactId>activeio</artifactId>
+            <version>${activeio_version}</version>
+            <properties>
+                <repository>true</repository>
+            </properties>
+        </dependency>	
+
+	<!--
+        <dependency>
             <groupId>geronimo</groupId>
             <artifactId>geronimo-remoting</artifactId>
             <version>${pom.currentVersion}</version>
@@ -232,6 +242,7 @@
                 <repository>true</repository>
             </properties>
         </dependency>
+	-->
 
         <dependency>
             <groupId>geronimo</groupId>

Modified: geronimo/trunk/modules/security/project.xml
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/security/project.xml?view=diff&rev=123130&p1=geronimo/trunk/modules/security/project.xml&r1=123129&p2=geronimo/trunk/modules/security/project.xml&r2=123130
==============================================================================
--- geronimo/trunk/modules/security/project.xml	(original)
+++ geronimo/trunk/modules/security/project.xml	Wed Dec 22 09:56:23 2004
@@ -59,12 +59,13 @@
             <artifactId>geronimo-kernel</artifactId>
             <version>${pom.currentVersion}</version>
         </dependency>
-
+	<!--
         <dependency>
             <groupId>geronimo</groupId>
             <artifactId>geronimo-remoting</artifactId>
             <version>${pom.currentVersion}</version>
         </dependency>
+	-->
 
         <dependency>
             <groupId>geronimo</groupId>
@@ -97,6 +98,12 @@
             <groupId>concurrent</groupId>
             <artifactId>concurrent</artifactId>
             <version>${concurrent_version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>activeio</groupId>
+            <artifactId>activeio</artifactId>
+            <version>${activeio_version}</version>
         </dependency>
 
         <dependency>

Added: geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/network/protocol/SubjectCarryingChannel.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/network/protocol/SubjectCarryingChannel.java?view=auto&rev=123130
==============================================================================
--- (empty file)
+++ geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/network/protocol/SubjectCarryingChannel.java	Wed Dec 22 09:56:23 2004
@@ -0,0 +1,146 @@
+/**
+ *
+ * Copyright 2004 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.geronimo.security.network.protocol;
+
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.security.AccessController;
+import java.util.Collection;
+
+import javax.security.auth.Subject;
+
+import org.activeio.AsynchChannel;
+import org.activeio.FilterAsynchChannel;
+import org.activeio.Packet;
+import org.activeio.adapter.PacketInputStream;
+import org.activeio.adapter.PacketOutputStream;
+import org.activeio.packet.AppendedPacket;
+import org.activeio.packet.ByteArrayPacket;
+import org.apache.geronimo.security.ContextManager;
+import org.apache.geronimo.security.IdentificationPrincipal;
+import org.apache.geronimo.security.SubjectId;
+
+/**
+ * SubjectCarryingChannel is a FilterAsynchChannel that allows you to send 
+ * the subject associated with the current write operation down to the remote
+ * end of the channel.
+ * 
+ * @version $Rev: 46019 $ $Date: 2004-09-14 02:56:06 -0700 (Tue, 14 Sep 2004) $
+ */
+public class SubjectCarryingChannel extends FilterAsynchChannel {
+
+    static final byte PASSTHROUGH = (byte)0x00;
+    static final byte SET_SUBJECT = (byte)0x01;
+    static final byte CLEAR_SUBJECT = (byte)0x2;
+
+    final private ByteArrayPacket header = new ByteArrayPacket(new byte[1+8+4]);
+
+    private Subject remoteSubject;
+    private Subject localSubject;
+    
+    private final boolean enableLocalSubjectPublishing;
+    private final boolean enableRemoteSubjectConsumption;
+
+    public SubjectCarryingChannel(AsynchChannel next, boolean enableLocalSubjectPublishing, boolean enableRemoteSubjectConsumption) {
+        super(next);
+        this.enableLocalSubjectPublishing = enableLocalSubjectPublishing;
+        this.enableRemoteSubjectConsumption = enableRemoteSubjectConsumption;
+    }
+    
+    public void write(Packet packet) throws IOException {
+        
+        // Don't add anything to the packet stream if subject writing is not enabled.
+        if( !enableLocalSubjectPublishing ) {
+            super.write(packet);
+            return;
+        }
+        
+        Subject subject = Subject.getSubject(AccessController.getContext());
+        if (remoteSubject != subject) {
+            remoteSubject = subject;
+            Collection principals = remoteSubject.getPrincipals(IdentificationPrincipal.class);
+            
+            if (principals.isEmpty()) {
+                super.write(createClearSubjectPackt());
+            } else {                
+                IdentificationPrincipal principal = (IdentificationPrincipal) principals.iterator().next();
+                SubjectId subjectId = principal.getId();                
+                super.write(createSubjectPacket(subjectId.getSubjectId(), subjectId.getHash()));
+            }
+            
+        }
+        super.write(createPassthroughPacket(packet));
+    }
+
+    public void onPacket(Packet packet) {
+        
+        // Don't take anything to the packet stream if subject reading is not enabled.
+        if( !enableRemoteSubjectConsumption ) {
+            super.onPacket(packet);
+            return;
+        }
+        
+        try {
+            switch( packet.read() ) {
+            	case CLEAR_SUBJECT:
+            	    localSubject = null;
+                    return;
+            	case SET_SUBJECT:        	    
+            	    SubjectId subjectId = extractSubjectId(packet);
+            	    localSubject = ContextManager.getRegisteredSubject(subjectId);
+                    return;
+            	case PASSTHROUGH:        	    
+                    super.onPacket(packet);
+            }
+        } catch (IOException e) {
+            super.onPacketError(e);
+        }
+
+        super.onPacket(packet);
+    }
+
+    /**
+     */
+    private SubjectId extractSubjectId(Packet packet) throws IOException {
+        DataInputStream is = new DataInputStream(new PacketInputStream(packet));
+        Long id = new Long(is.readLong());
+        byte hash[]=  new byte[ is.readInt() ];
+	    return new SubjectId(id, hash);
+    }
+
+    private Packet createClearSubjectPackt() {
+        header.clear().write(CLEAR_SUBJECT);
+        return header.flip();
+    }
+
+    private Packet createSubjectPacket(Long subjectId, byte[] hash) throws IOException {
+        header.clear();
+        DataOutputStream os = new DataOutputStream(new PacketOutputStream(header));
+        os.writeByte(SET_SUBJECT);
+        os.writeLong(subjectId.longValue());
+        os.writeInt(hash.length);
+        os.close();
+        return new AppendedPacket(header.flip(), new ByteArrayPacket(hash));
+    }
+
+    private Packet createPassthroughPacket(Packet packet) {
+        header.clear().write(PASSTHROUGH);        
+        return new AppendedPacket(header.flip(),packet);
+    }
+    
+}

Added: geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/InvocationSupport.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/InvocationSupport.java?view=auto&rev=123130
==============================================================================
--- (empty file)
+++ geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/InvocationSupport.java	Wed Dec 22 09:56:23 2004
@@ -0,0 +1,93 @@
+/**
+ *
+ * Copyright 2003-2004 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.geronimo.security.remoting.jmx;
+import java.io.ObjectStreamException;
+import java.io.Serializable;
+import java.net.URI;
+
+import org.apache.geronimo.core.service.Invocation;
+import org.apache.geronimo.core.service.InvocationKey;
+/**
+ * @version $Rev: 46019 $ $Date: 2004-09-14 02:56:06 -0700 (Tue, 14 Sep 2004) $
+ */
+public final class InvocationSupport implements Serializable, InvocationKey {
+
+    private static final long serialVersionUID = 3690191053600796981L;
+
+    // Be careful here.  If you change the ordinals, this class must be changed on evey client.
+    private static int MAX_ORDINAL = 2;
+    private static final InvocationSupport[] values = new InvocationSupport[MAX_ORDINAL + 1];
+    private static final InvocationSupport REMOTE_URI = new InvocationSupport("REMOTE_URI", 0);
+    private static final InvocationSupport INVOCATION_TYPE = new InvocationSupport("INVOCATION_TYPE", 1);
+
+    public static URI getRemoteURI(Invocation invocation) {
+        return (URI) invocation.get(REMOTE_URI);
+    }
+    public static void putRemoteURI(Invocation invocation, URI remoteURI) {
+        invocation.put(REMOTE_URI, remoteURI);
+    }
+    public static InvocationType getInvocationType(Invocation invocation) {
+        return (InvocationType) invocation.get(INVOCATION_TYPE);
+    }
+    public static void putInvocationType(Invocation invocation, InvocationType type) {
+        invocation.put(INVOCATION_TYPE, type);
+    }
+    
+    private final transient String name;
+    private final int ordinal;
+
+    private InvocationSupport(String name, int ordinal) {
+        assert ordinal < MAX_ORDINAL;
+        assert values[ordinal] == null;
+        this.name = name;
+        this.ordinal = ordinal;
+        values[ordinal] = this;
+    }
+
+    public String toString() {
+        return name;
+    }
+
+    Object readResolve() throws ObjectStreamException {
+        return values[ordinal];
+    }
+
+    static public boolean isAncestor(ClassLoader parent, ClassLoader child) {
+        // Root child? ancestor must be root too.
+        if (child == null)
+            return parent == null;
+        // Root parent is the ancestor of all classloaders.
+        if (parent == null)
+            return true;
+
+        while (child != null) {
+            if (child.equals(parent))
+                return true;
+            child = child.getParent();
+        }
+        return false;
+    }
+    
+    /**
+     * @see org.apache.geronimo.core.service.InvocationKey#isTransient()
+     */
+    public boolean isTransient() {
+        return true;
+    }
+
+}

Added: geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/InvocationType.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/InvocationType.java?view=auto&rev=123130
==============================================================================
--- (empty file)
+++ geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/InvocationType.java	Wed Dec 22 09:56:23 2004
@@ -0,0 +1,53 @@
+/**
+ *
+ * Copyright 2003-2004 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.geronimo.security.remoting.jmx;
+import java.io.ObjectStreamException;
+import java.io.Serializable;
+/**
+ * @version $Rev: 46019 $ $Date: 2004-09-14 02:56:06 -0700 (Tue, 14 Sep 2004) $
+ */
+public final class InvocationType implements Serializable {
+
+
+    private static final long serialVersionUID = 4049360807479227955L;
+    
+    // Be careful here.  If you change the ordinals, this class must be changed on evey client.
+    private static int MAX_ORDINAL = 2;
+    private static final InvocationType[] values = new InvocationType[MAX_ORDINAL + 1];
+    public static final InvocationType REQUEST = new InvocationType("REQUEST", 0);
+    public static final InvocationType DATAGRAM = new InvocationType("DATAGRAM", 1);
+
+    private final transient String name;
+    private final int ordinal;
+
+    private InvocationType(String name, int ordinal) {
+        assert ordinal < MAX_ORDINAL;
+        assert values[ordinal] == null;
+        this.name = name;
+        this.ordinal = ordinal;
+        values[ordinal] = this;
+    }
+
+    public String toString() {
+        return name;
+    }
+
+    Object readResolve() throws ObjectStreamException {
+        return values[ordinal];
+    }
+}

Modified: geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/JaasLoginServiceRemotingClient.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/JaasLoginServiceRemotingClient.java?view=diff&rev=123130&p1=geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/JaasLoginServiceRemotingClient.java&r1=123129&p2=geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/JaasLoginServiceRemotingClient.java&r2=123130
==============================================================================
--- geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/JaasLoginServiceRemotingClient.java	(original)
+++ geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/JaasLoginServiceRemotingClient.java	Wed Dec 22 09:56:23 2004
@@ -17,14 +17,11 @@
 
 package org.apache.geronimo.security.remoting.jmx;
 
+import java.io.IOException;
 import java.net.URI;
 import java.net.URISyntaxException;
 
-import org.apache.geronimo.core.service.Interceptor;
 import org.apache.geronimo.proxy.ProxyContainer;
-import org.apache.geronimo.remoting.MarshalingInterceptor;
-import org.apache.geronimo.remoting.jmx.NotificationRemoterInterceptor;
-import org.apache.geronimo.remoting.transport.RemoteTransportInterceptor;
 import org.apache.geronimo.security.jaas.JaasLoginServiceMBean;
 
 
@@ -38,21 +35,23 @@
         URI target;
         try {
             target = new URI("async", null, host, port, "/JMX", null, "geronimo.remoting:target=JaasLoginServiceRemotingServer");
+            return create(target);
         } catch (URISyntaxException e) {
             throw new IllegalArgumentException("Bad host or port.");
+        } catch (IOException e) {
+            throw new RuntimeException("IOException: "+e.getMessage(), e);
         }
-        return create(target);
     }
 
-    static public JaasLoginServiceMBean create(URI target) {
+    static public JaasLoginServiceMBean create(URI target) throws IOException, URISyntaxException {
+        
+        ClassLoader cl = JaasLoginServiceMBean.class.getClassLoader();
+        
         // Setup the client side container..
-        RemoteTransportInterceptor remoteInterceptor = new RemoteTransportInterceptor(target);
-        remoteInterceptor.setRemoteURI(target);
-
-        Interceptor firstInterceptor = new MarshalingInterceptor(remoteInterceptor);
-        firstInterceptor = new NotificationRemoterInterceptor(firstInterceptor);
-
-        ProxyContainer clientContainer = new ProxyContainer(firstInterceptor);
-        return (JaasLoginServiceMBean) clientContainer.createProxy(JaasLoginServiceMBean.class.getClassLoader(), new Class[]{JaasLoginServiceMBean.class});
+        RequestChannelInterceptor remoteInterceptor = new RequestChannelInterceptor(target, cl);
+        ProxyContainer clientContainer = new ProxyContainer(remoteInterceptor);
+        return (JaasLoginServiceMBean) clientContainer.createProxy(cl , new Class[]{JaasLoginServiceMBean.class});
+        
     }
+        
 }

Modified: geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/JaasLoginServiceRemotingServer.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/JaasLoginServiceRemotingServer.java?view=diff&rev=123130&p1=geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/JaasLoginServiceRemotingServer.java&r1=123129&p2=geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/JaasLoginServiceRemotingServer.java&r2=123130
==============================================================================
--- geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/JaasLoginServiceRemotingServer.java	(original)
+++ geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/JaasLoginServiceRemotingServer.java	Wed Dec 22 09:56:23 2004
@@ -17,21 +17,27 @@
 
 package org.apache.geronimo.security.remoting.jmx;
 
-import javax.management.ObjectName;
-
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import org.activeio.AcceptListener;
+import org.activeio.AsynchChannelServer;
+import org.activeio.Channel;
+import org.activeio.RequestChannel;
+import org.activeio.SynchChannel;
+import org.activeio.SynchChannelServer;
+import org.activeio.adapter.AsynchChannelToServerRequestChannel;
+import org.activeio.adapter.SynchToAsynchChannelAdapter;
+import org.activeio.adapter.SynchToAsynchChannelServerAdapter;
+import org.activeio.filter.PacketAggregatingAsynchChannel;
+import org.activeio.net.TcpSynchChannelFactory;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.geronimo.core.service.Interceptor;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.GBeanLifecycle;
-import org.apache.geronimo.kernel.Kernel;
-import org.apache.geronimo.kernel.jmx.JMXUtil;
-import org.apache.geronimo.proxy.ProxyContainer;
 import org.apache.geronimo.proxy.ReflexiveInterceptor;
-import org.apache.geronimo.remoting.DeMarshalingInterceptor;
-import org.apache.geronimo.remoting.router.JMXRouter;
-import org.apache.geronimo.remoting.router.JMXTarget;
 import org.apache.geronimo.security.jaas.JaasLoginServiceMBean;
 
 
@@ -42,69 +48,85 @@
  * 
  * @version $Rev: 56022 $ $Date: 2004-10-30 01:16:18 -0400 (Sat, 30 Oct 2004) $
  */
-public class JaasLoginServiceRemotingServer implements GBeanLifecycle, JMXTarget {
+public class JaasLoginServiceRemotingServer implements GBeanLifecycle {
     private static final Log log = LogFactory.getLog(JaasLoginServiceRemotingServer.class);
-    private final Kernel kernel;
-    private final ObjectName objectName;
-    private ProxyContainer serverContainer;
-    private DeMarshalingInterceptor demarshaller;
-    private JMXRouter router;
+    private AsynchChannelServer server;
     private JaasLoginServiceMBean loginService;
+    private final URI bindURI;
 
-    public JaasLoginServiceRemotingServer(Kernel kernel, String objectName) {
-        this.kernel = kernel;
-        this.objectName = JMXUtil.getObjectName(objectName);
-    }
-
-    public Interceptor getRemotingEndpointInterceptor() {
-        return demarshaller;
-    }
-
-    public JMXRouter getRouter() {
-        return router;
+    public JaasLoginServiceRemotingServer(URI bindURI, JaasLoginServiceMBean loginService) {
+        this.bindURI = bindURI;
+        this.loginService = loginService;
     }
 
-    public void setRouter(JMXRouter router) {
-        this.router = router;
+    public URI getClientConnectURI() {
+        return server.getConnectURI();
     }
-
+    
     public void doStart() throws Exception {
-        router.register(objectName, this);
-
-        // Setup the server side contianer..
-        // todo dain: alan, why is this not a dependency?
-        // todo dain: hard coded object names are very very bery bad
-        loginService = (JaasLoginServiceMBean) kernel.getProxyManager().createProxy(JMXUtil.getObjectName("geronimo.security:type=JaasLoginService"), JaasLoginServiceMBean.class);
-        Interceptor firstInterceptor = new ReflexiveInterceptor(loginService);
-        demarshaller = new DeMarshalingInterceptor(firstInterceptor, getClass().getClassLoader());
-        serverContainer = new ProxyContainer(firstInterceptor);
-
-        log.info("Started login service stub");
+        final ReflexiveInterceptor loginServiceInterceptor = new ReflexiveInterceptor(loginService);
+        
+        server = createAsynchChannelServer();
+        server.setAcceptListener(new AcceptListener() {
+            public void onAccept(Channel channel) {
+                RequestChannel requestChannel=null;
+                try {
+                    requestChannel = createRequestChannel((SynchChannel) channel);     
+                    
+                    RequestChannelInterceptorInvoker invoker = new RequestChannelInterceptorInvoker(loginServiceInterceptor, loginService.getClass().getClassLoader() ); 
+                    requestChannel.setRequestListener(invoker);
+                    requestChannel.start();
+                } catch (IOException e) {
+                    log.info("Failed to accept connection.", e);
+                    if( requestChannel!=null )
+                        requestChannel.dispose();
+                    else
+                        channel.dispose();
+                }                
+            }
+            public void onAcceptError(IOException error) {
+                log.info("Accept Failed: "+error);
+            }
+        });
+        
+        server.start();
+        log.info("Remote login service started on: "+server.getConnectURI()+" clients can connect to: "+server.getConnectURI());
+    }
+    
+    private AsynchChannelServer createAsynchChannelServer() throws IOException, URISyntaxException {
+        TcpSynchChannelFactory factory = new TcpSynchChannelFactory();
+        SynchChannelServer server = factory.bindSynchChannel(bindURI);
+        return new SynchToAsynchChannelServerAdapter(server);        
+    }
+
+    private RequestChannel createRequestChannel(SynchChannel channel) throws IOException {
+        return new AsynchChannelToServerRequestChannel( 
+                new PacketAggregatingAsynchChannel(
+                        new SynchToAsynchChannelAdapter(channel)));
     }
 
     public void doStop() {
-        router.unregister(objectName);
-        kernel.getProxyManager().destroyProxy(loginService);
-        serverContainer = null;
-        demarshaller = null;
-        log.info("Stopped login service stub");
+        server.dispose();
+        server=null;        
+        log.info("Stopped remote login service.");
     }
 
     public void doFail() {
-        serverContainer = null;
-        demarshaller = null;
-        log.info("Failed login service stub");
+        if( server !=null ) {
+            server.dispose();
+	        server=null;        
+        }
+        log.info("Failed remote login service.");
     }
 
     public static final GBeanInfo GBEAN_INFO;
 
     static {
         GBeanInfoBuilder infoFactory = new GBeanInfoBuilder(JaasLoginServiceRemotingServer.class);
-        infoFactory.addAttribute("kernel", Kernel.class, false);
-        infoFactory.addAttribute("objectName", String.class, false);
-        infoFactory.addReference("Router", JMXRouter.class);
-        infoFactory.addOperation("getRemotingEndpointInterceptor");
-        infoFactory.setConstructor(new String[]{"kernel", "objectName"});
+        infoFactory.addAttribute("bindURI", URI.class, true);
+        infoFactory.addAttribute("clientConnectURI", URI.class, false);        
+        infoFactory.addReference("loginService", JaasLoginServiceMBean.class);
+        infoFactory.setConstructor(new String[]{"bindURI", "loginService"});
         GBEAN_INFO = infoFactory.getBeanInfo();
     }
 

Added: geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/ObjectInputStreamExt.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/ObjectInputStreamExt.java?view=auto&rev=123130
==============================================================================
--- (empty file)
+++ geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/ObjectInputStreamExt.java	Wed Dec 22 09:56:23 2004
@@ -0,0 +1,54 @@
+/**
+ *
+ * Copyright 2003-2004 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.geronimo.security.remoting.jmx;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectStreamClass;
+import java.lang.reflect.Proxy;
+
+import org.apache.geronimo.kernel.ClassLoading;
+
+/**
+ * @version $Rev: 46019 $ $Date: 2004-09-14 02:56:06 -0700 (Tue, 14 Sep 2004) $
+ */
+public class ObjectInputStreamExt extends ObjectInputStream {
+
+    private ClassLoader classloader;
+
+    public ObjectInputStreamExt(InputStream in, ClassLoader loader) throws IOException {
+        super(in);
+        this.classloader = loader;
+    }
+
+    protected Class resolveClass(ObjectStreamClass classDesc) throws IOException, ClassNotFoundException {
+        return ClassLoading.loadClass(classDesc.getName(), classloader);
+    }
+
+    protected Class resolveProxyClass(String[] interfaces) throws IOException, ClassNotFoundException {
+        Class[] cinterfaces = new Class[interfaces.length];
+        for (int i = 0; i < interfaces.length; i++)
+            cinterfaces[i] = classloader.loadClass(interfaces[i]);
+
+        try {
+            return Proxy.getProxyClass(classloader, cinterfaces);
+        } catch (IllegalArgumentException e) {
+            throw new ClassNotFoundException(null, e);
+        }
+    }
+}

Added: geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/RequestChannelInterceptor.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/RequestChannelInterceptor.java?view=auto&rev=123130
==============================================================================
--- (empty file)
+++ geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/RequestChannelInterceptor.java	Wed Dec 22 09:56:23 2004
@@ -0,0 +1,120 @@
+/**
+ *
+ * Copyright 2003-2004 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.geronimo.security.remoting.jmx;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectOutputStream;
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import org.activeio.Packet;
+import org.activeio.RequestChannel;
+import org.activeio.Service;
+import org.activeio.SynchChannel;
+import org.activeio.adapter.ASynchToSynchChannelAdapter;
+import org.activeio.adapter.AsynchChannelToClientRequestChannel;
+import org.activeio.adapter.PacketInputStream;
+import org.activeio.adapter.SynchToAsynchChannelAdapter;
+import org.activeio.filter.PacketAggregatingAsynchChannel;
+import org.activeio.net.TcpSynchChannelFactory;
+import org.activeio.packet.ByteArrayPacket;
+import org.apache.geronimo.core.service.Interceptor;
+import org.apache.geronimo.core.service.Invocation;
+import org.apache.geronimo.core.service.InvocationResult;
+
+/**
+ * @version $Rev: 71492 $ $Date: 2004-11-14 21:31:50 -0800 (Sun, 14 Nov 2004) $
+ */
+public class RequestChannelInterceptor implements Interceptor {
+
+    private final ClassLoader cl;
+    private final URI target;
+
+    public RequestChannelInterceptor(URI target, ClassLoader cl) {
+        this.target = target;
+        this.cl = cl;
+    }
+
+    public InvocationResult invoke(Invocation invocation) throws Throwable {
+
+        ClassLoader originalLoader = Thread.currentThread().getContextClassLoader();
+        try {
+
+            RequestChannel channel = createRequestChannel(target);
+            Packet response;
+            try { 
+                channel.start();
+                Packet request = serialize(invocation);
+                response = channel.request(request, Service.WAIT_FOREVER_TIMEOUT);
+            } finally {
+                channel.dispose();                
+            }
+            
+            Object obj;
+            try {            
+                obj =  deserialize(response, cl);
+            } catch ( ClassNotFoundException e ) { 
+                // Weird.
+                Thread.currentThread().setContextClassLoader(RequestChannelInterceptor.class.getClassLoader());
+                response.clear();
+                obj =  deserialize(response, cl);
+            }
+
+            // Are we demarshalling a thrown exception.
+            if (obj instanceof RequestChannelInterceptorInvoker.ThrowableWrapper) {
+                throw ((RequestChannelInterceptorInvoker.ThrowableWrapper) obj).exception;
+            }
+            return (InvocationResult)obj;
+            
+        } finally {
+            Thread.currentThread().setContextClassLoader(originalLoader);
+        }
+    }
+    
+    private static RequestChannel createRequestChannel(URI target) throws IOException, URISyntaxException {
+        TcpSynchChannelFactory factory = new TcpSynchChannelFactory();
+        SynchChannel channel = factory.openSynchChannel(target);
+        return new AsynchChannelToClientRequestChannel(
+                new ASynchToSynchChannelAdapter(
+                        new PacketAggregatingAsynchChannel( 
+                                new SynchToAsynchChannelAdapter(channel))));        
+    }
+
+    /**
+     * @param response
+     * @param cl
+     * @return
+     * @throws IOException
+     * @throws ClassNotFoundException
+     */
+    static public Object deserialize(Packet response, ClassLoader cl) throws IOException, ClassNotFoundException {
+        ObjectInputStreamExt is = new ObjectInputStreamExt(new PacketInputStream(response), cl);
+        Object rc = is.readObject();
+        is.close();
+        return rc;
+    }
+
+    static public Packet serialize(Object object) throws IOException {
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        ObjectOutputStream oos = new ObjectOutputStream(baos);
+        oos.writeObject(object);
+        oos.close();
+        return new ByteArrayPacket(baos.toByteArray());
+    }
+}

Added: geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/RequestChannelInterceptorInvoker.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/RequestChannelInterceptorInvoker.java?view=auto&rev=123130
==============================================================================
--- (empty file)
+++ geronimo/trunk/modules/security/src/java/org/apache/geronimo/security/remoting/jmx/RequestChannelInterceptorInvoker.java	Wed Dec 22 09:56:23 2004
@@ -0,0 +1,99 @@
+/**
+ *
+ * Copyright 2003-2004 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.geronimo.security.remoting.jmx;
+
+import java.io.IOException;
+import java.io.Serializable;
+
+import org.activeio.Packet;
+import org.activeio.RequestListener;
+import org.activeio.packet.EmptyPacket;
+import org.apache.geronimo.core.service.Interceptor;
+import org.apache.geronimo.core.service.Invocation;
+import org.apache.geronimo.core.service.InvocationResult;
+
+/**
+ * @version $Rev: 46019 $ $Date: 2004-09-14 02:56:06 -0700 (Tue, 14 Sep 2004) $
+ */
+public class RequestChannelInterceptorInvoker implements RequestListener {
+
+    private ClassLoader classloader;
+    private Interceptor next;
+
+    public RequestChannelInterceptorInvoker(Interceptor next) {
+        this.next = next;
+    }
+
+    public RequestChannelInterceptorInvoker(Interceptor next, ClassLoader classloader) {
+        this.next = next;
+        this.classloader = classloader;
+    }
+
+    public static class ThrowableWrapper implements Serializable {
+        private static final long serialVersionUID = 3905243428970182455L;
+        ThrowableWrapper(Throwable exception) {
+            this.exception = exception;
+        }
+        public Throwable exception;
+    }
+
+    public ClassLoader getClassloader() {
+        return classloader;
+    }
+
+    public void setClassloader(ClassLoader classloader) {
+        this.classloader = classloader;
+    }
+
+    public Packet onRequest(Packet request) {
+        Thread currentThread = Thread.currentThread();
+        ClassLoader orig = currentThread.getContextClassLoader();
+        try {
+            
+            Invocation marshalledInvocation;
+            
+            try {
+                currentThread.setContextClassLoader(classloader);
+                marshalledInvocation = (Invocation) RequestChannelInterceptor.deserialize(request,classloader);
+            } catch (Throwable e) {
+                // Could not deserialize the invocation...
+                e.printStackTrace();
+                return RequestChannelInterceptor.serialize(new ThrowableWrapper(e));                
+            }
+
+            try {
+                InvocationResult rc = next.invoke(marshalledInvocation);
+                return RequestChannelInterceptor.serialize(rc);                
+            } catch (Throwable e) {
+                return RequestChannelInterceptor.serialize(new ThrowableWrapper(e));                
+            }
+
+            
+        } catch (IOException e) {
+            // TODO: handle this.
+            return EmptyPacket.EMPTY_PACKET;            
+        } finally {
+            currentThread.setContextClassLoader(orig);
+        }
+    }
+
+    public void onRquestError(IOException error) {
+        // TODO: handle this.
+    }
+
+}

Modified: geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/AbstractTest.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/AbstractTest.java?view=diff&rev=123130&p1=geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/AbstractTest.java&r1=123129&p2=geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/AbstractTest.java&r2=123130
==============================================================================
--- geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/AbstractTest.java	(original)
+++ geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/AbstractTest.java	Wed Dec 22 09:56:23 2004
@@ -44,9 +44,6 @@
     protected ObjectName loginService;
     protected ObjectName testLoginModule;
     protected ObjectName testRealm;
-    protected ObjectName subsystemRouter;
-    protected ObjectName asyncTransport;
-    protected ObjectName jmxRouter;
     protected ObjectName serverStub;
 
     protected void setUp() throws Exception {
@@ -80,49 +77,26 @@
         gbean.setAttribute("loginModuleConfiguration", props);
         kernel.loadGBean(testRealm, gbean);
 
-        gbean = new GBeanMBean("org.apache.geronimo.remoting.router.SubsystemRouter");
-        subsystemRouter = new ObjectName("geronimo.remoting:router=SubsystemRouter");
-        kernel.loadGBean(subsystemRouter, gbean);
-
-        gbean = new GBeanMBean("org.apache.geronimo.remoting.transport.TransportLoader");
-        gbean.setAttribute("bindURI", new URI("async://0.0.0.0:4242"));
-        gbean.setReferencePatterns("Router", Collections.singleton(subsystemRouter));
-        asyncTransport = new ObjectName("geronimo.remoting:transport=async");
-        kernel.loadGBean(asyncTransport, gbean);
-
-        gbean = new GBeanMBean("org.apache.geronimo.remoting.router.JMXRouter");
-        gbean.setReferencePatterns("SubsystemRouter", Collections.singleton(subsystemRouter));
-        jmxRouter = new ObjectName("geronimo.remoting:router=JMXRouter");
-        kernel.loadGBean(jmxRouter, gbean);
-
         gbean = new GBeanMBean("org.apache.geronimo.security.remoting.jmx.JaasLoginServiceRemotingServer");
-        gbean.setReferencePatterns("Router", Collections.singleton(jmxRouter));
+        gbean.setAttribute("bindURI", new URI("tcp://0.0.0.0:4242"));
+        gbean.setReferencePattern("loginService", loginService);
         serverStub = new ObjectName("geronimo.remoting:target=JaasLoginServiceRemotingServer");
         kernel.loadGBean(serverStub, gbean);
 
         kernel.startGBean(loginService);
         kernel.startGBean(testLoginModule);
         kernel.startGBean(testRealm);
-        kernel.startGBean(subsystemRouter);
-        kernel.startGBean(asyncTransport);
-        kernel.startGBean(jmxRouter);
         kernel.startGBean(serverStub);
     }
 
     protected void tearDown() throws Exception {
         kernel.stopGBean(serverStub);
-        kernel.stopGBean(jmxRouter);
-        kernel.stopGBean(asyncTransport);
-        kernel.stopGBean(subsystemRouter);
         kernel.stopGBean(testRealm);
         kernel.stopGBean(loginService);
 
         kernel.unloadGBean(loginService);
         kernel.unloadGBean(testRealm);
         kernel.unloadGBean(testLoginModule);
-        kernel.unloadGBean(subsystemRouter);
-        kernel.unloadGBean(asyncTransport);
-        kernel.unloadGBean(jmxRouter);
         kernel.unloadGBean(serverStub);
 
         kernel.shutdown();

Modified: geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/bridge/TestPrincipal.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/bridge/TestPrincipal.java?view=diff&rev=123130&p1=geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/bridge/TestPrincipal.java&r1=123129&p2=geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/bridge/TestPrincipal.java&r2=123130
==============================================================================
--- geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/bridge/TestPrincipal.java	(original)
+++ geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/bridge/TestPrincipal.java	Wed Dec 22 09:56:23 2004
@@ -26,6 +26,8 @@
  */
 public class TestPrincipal implements Principal, Serializable {
 
+    private static final long serialVersionUID = 3546361729958426674L;
+    
     private String name;
 
     public TestPrincipal(String name) {

Modified: geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/jaas/ConfigurationEntryTest.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/jaas/ConfigurationEntryTest.java?view=diff&rev=123130&p1=geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/jaas/ConfigurationEntryTest.java&r1=123129&p2=geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/jaas/ConfigurationEntryTest.java&r2=123130
==============================================================================
--- geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/jaas/ConfigurationEntryTest.java	(original)
+++ geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/jaas/ConfigurationEntryTest.java	Wed Dec 22 09:56:23 2004
@@ -50,9 +50,6 @@
     protected ObjectName clientCE;
     protected ObjectName testCE;
     protected ObjectName testRealm;
-    protected ObjectName subsystemRouter;
-    protected ObjectName asyncTransport;
-    protected ObjectName jmxRouter;
     protected ObjectName serverStub;
 
     public void test() throws Exception {
@@ -187,42 +184,22 @@
         gbean.setReferencePatterns("ServerInfo", Collections.singleton(serverInfo));
         kernel.loadGBean(testRealm, gbean);
 
-        gbean = new GBeanMBean("org.apache.geronimo.remoting.router.SubsystemRouter");
-        subsystemRouter = new ObjectName("geronimo.remoting:router=SubsystemRouter");
-        kernel.loadGBean(subsystemRouter, gbean);
-
-        gbean = new GBeanMBean("org.apache.geronimo.remoting.transport.TransportLoader");
-        gbean.setAttribute("bindURI", new URI("async://0.0.0.0:4242"));
-        gbean.setReferencePatterns("Router", Collections.singleton(subsystemRouter));
-        asyncTransport = new ObjectName("geronimo.remoting:transport=async");
-        kernel.loadGBean(asyncTransport, gbean);
-
-        gbean = new GBeanMBean("org.apache.geronimo.remoting.router.JMXRouter");
-        gbean.setReferencePatterns("SubsystemRouter", Collections.singleton(subsystemRouter));
-        jmxRouter = new ObjectName("geronimo.remoting:router=JMXRouter");
-        kernel.loadGBean(jmxRouter, gbean);
-
         gbean = new GBeanMBean("org.apache.geronimo.security.remoting.jmx.JaasLoginServiceRemotingServer");
-        gbean.setReferencePatterns("Router", Collections.singleton(jmxRouter));
+        gbean.setAttribute("bindURI", new URI("tcp://0.0.0.0:4242"));
+        gbean.setReferencePattern("loginService", loginService);
         serverStub = new ObjectName("geronimo.remoting:target=JaasLoginServiceRemotingServer");
-        kernel.loadGBean(serverStub, gbean);
+        kernel.loadGBean(serverStub, gbean);               
 
         kernel.startGBean(loginConfiguration);
         kernel.startGBean(loginService);
         kernel.startGBean(clientCE);
         kernel.startGBean(testCE);
         kernel.startGBean(testRealm);
-        kernel.startGBean(subsystemRouter);
-        kernel.startGBean(asyncTransport);
-        kernel.startGBean(jmxRouter);
         kernel.startGBean(serverStub);
     }
 
     protected void tearDown() throws Exception {
         kernel.stopGBean(serverStub);
-        kernel.stopGBean(jmxRouter);
-        kernel.stopGBean(asyncTransport);
-        kernel.stopGBean(subsystemRouter);
         kernel.stopGBean(testRealm);
         kernel.stopGBean(testCE);
         kernel.stopGBean(clientCE);
@@ -234,9 +211,6 @@
         kernel.unloadGBean(testCE);
         kernel.unloadGBean(testRealm);
         kernel.unloadGBean(clientCE);
-        kernel.unloadGBean(subsystemRouter);
-        kernel.unloadGBean(asyncTransport);
-        kernel.unloadGBean(jmxRouter);
         kernel.unloadGBean(serverStub);
         kernel.unloadGBean(loginConfiguration);
         kernel.unloadGBean(serverInfo);

Modified: geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/jaas/TimeoutTest.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/jaas/TimeoutTest.java?view=diff&rev=123130&p1=geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/jaas/TimeoutTest.java&r1=123129&p2=geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/jaas/TimeoutTest.java&r2=123130
==============================================================================
--- geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/jaas/TimeoutTest.java	(original)
+++ geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/jaas/TimeoutTest.java	Wed Dec 22 09:56:23 2004
@@ -65,30 +65,14 @@
         gbean.setAttribute("password", "secret");
         kernel.loadGBean(loginService, gbean);
 
-        gbean = new GBeanMBean("org.apache.geronimo.remoting.router.SubsystemRouter");
-        subsystemRouter = new ObjectName("geronimo.remoting:router=SubsystemRouter");
-        kernel.loadGBean(subsystemRouter, gbean);
-
-        gbean = new GBeanMBean("org.apache.geronimo.remoting.transport.TransportLoader");
-        gbean.setAttribute("bindURI", new URI("async://0.0.0.0:4242"));
-        gbean.setReferencePatterns("Router", Collections.singleton(subsystemRouter));
-        asyncTransport = new ObjectName("geronimo.remoting:transport=async");
-        kernel.loadGBean(asyncTransport, gbean);
-
-        gbean = new GBeanMBean("org.apache.geronimo.remoting.router.JMXRouter");
-        gbean.setReferencePatterns("SubsystemRouter", Collections.singleton(subsystemRouter));
-        jmxRouter = new ObjectName("geronimo.remoting:router=JMXRouter");
-        kernel.loadGBean(jmxRouter, gbean);
 
         gbean = new GBeanMBean("org.apache.geronimo.security.remoting.jmx.JaasLoginServiceRemotingServer");
-        gbean.setReferencePatterns("Router", Collections.singleton(jmxRouter));
+        gbean.setAttribute("bindURI", new URI("tcp://0.0.0.0:4242"));
+        gbean.setReferencePattern("loginService", loginService);
         serverStub = new ObjectName("geronimo.remoting:target=JaasLoginServiceRemotingServer");
         kernel.loadGBean(serverStub, gbean);
 
         kernel.startGBean(loginService);
-        kernel.startGBean(subsystemRouter);
-        kernel.startGBean(asyncTransport);
-        kernel.startGBean(jmxRouter);
         kernel.startGBean(serverStub);
 
         gbean = new GBeanMBean(ServerInfo.GBEAN_INFO);
@@ -166,15 +150,9 @@
         kernel.unloadGBean(serverInfo);
 
         kernel.stopGBean(serverStub);
-        kernel.stopGBean(jmxRouter);
-        kernel.stopGBean(asyncTransport);
-        kernel.stopGBean(subsystemRouter);
         kernel.stopGBean(loginService);
 
         kernel.unloadGBean(loginService);
-        kernel.unloadGBean(subsystemRouter);
-        kernel.unloadGBean(asyncTransport);
-        kernel.unloadGBean(jmxRouter);
         kernel.unloadGBean(serverStub);
 
         kernel.shutdown();

Modified: geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/remoting/jmx/RemoteLoginTest.java
Url: http://svn.apache.org/viewcvs/geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/remoting/jmx/RemoteLoginTest.java?view=diff&rev=123130&p1=geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/remoting/jmx/RemoteLoginTest.java&r1=123129&p2=geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/remoting/jmx/RemoteLoginTest.java&r2=123130
==============================================================================
--- geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/remoting/jmx/RemoteLoginTest.java	(original)
+++ geronimo/trunk/modules/security/src/test/org/apache/geronimo/security/remoting/jmx/RemoteLoginTest.java	Wed Dec 22 09:56:23 2004
@@ -49,13 +49,6 @@
     ObjectName loginService;
     protected ObjectName testCE;
     protected ObjectName testRealm;
-    ObjectName subsystemRouter;
-    ObjectName secureSubsystemRouter;
-    ObjectName asyncTransport;
-    ObjectName saslTransport;
-    ObjectName gssapiTransport;
-    ObjectName jmxRouter;
-    ObjectName secureJmxRouter;
     ObjectName serverStub;
     JaasLoginServiceMBean asyncRemoteProxy;
     JaasLoginServiceMBean saslRemoteProxy;
@@ -127,78 +120,30 @@
         gbean.setReferencePatterns("ServerInfo", Collections.singleton(serverInfo));
         kernel.loadGBean(testRealm, gbean);
 
-        gbean = new GBeanMBean("org.apache.geronimo.remoting.router.SubsystemRouter");
-        subsystemRouter = new ObjectName("geronimo.remoting:router=SubsystemRouter");
-        kernel.loadGBean(subsystemRouter, gbean);
-
-        gbean = new GBeanMBean("org.apache.geronimo.remoting.transport.TransportLoader");
-        gbean.setAttribute("bindURI", new URI("async://0.0.0.0:0"));
-        gbean.setReferencePatterns("Router", Collections.singleton(subsystemRouter));
-        asyncTransport = new ObjectName("geronimo.remoting:transport=async");
-        kernel.loadGBean(asyncTransport, gbean);
-
-        gbean = new GBeanMBean("org.apache.geronimo.remoting.router.JMXRouter");
-        gbean.setReferencePatterns("SubsystemRouter", Collections.singleton(subsystemRouter));
-        jmxRouter = new ObjectName("geronimo.remoting:router=JMXRouter");
-        kernel.loadGBean(jmxRouter, gbean);
-
-        gbean = new GBeanMBean("org.apache.geronimo.remoting.router.SubsystemRouter");
-        secureSubsystemRouter = new ObjectName("geronimo.remoting:router=SubsystemRouter,type=secure");
-        kernel.loadGBean(secureSubsystemRouter, gbean);
-
-        gbean = new GBeanMBean("org.apache.geronimo.remoting.transport.TransportLoader");
-        gbean.setAttribute("bindURI", new URI("async://0.0.0.0:4242"));
-        gbean.setReferencePatterns("Router", Collections.singleton(secureSubsystemRouter));
-        saslTransport = new ObjectName("geronimo.remoting:transport=async,subprotocol=sasl");
-        kernel.loadGBean(saslTransport, gbean);
-
-        gbean = new GBeanMBean("org.apache.geronimo.remoting.transport.TransportLoader");
-        gbean.setAttribute("bindURI", new URI("async://0.0.0.0:4243"));
-        gbean.setReferencePatterns("Router", Collections.singleton(secureSubsystemRouter));
-        gssapiTransport = new ObjectName("geronimo.remoting:transport=async,subprotocol=gssapi");
-        kernel.loadGBean(gssapiTransport, gbean);
-
-        gbean = new GBeanMBean("org.apache.geronimo.remoting.router.JMXRouter");
-        gbean.setReferencePatterns("SubsystemRouter", Collections.singleton(secureSubsystemRouter));
-        secureJmxRouter = new ObjectName("geronimo.remoting:router=JMXRouter,type=secure");
-        kernel.loadGBean(secureJmxRouter, gbean);
 
         gbean = new GBeanMBean("org.apache.geronimo.security.remoting.jmx.JaasLoginServiceRemotingServer");
-        gbean.setReferencePatterns("Router", Collections.singleton(secureJmxRouter));
+        gbean.setAttribute("bindURI", new URI("tcp://0.0.0.0:4242"));
+        gbean.setReferencePattern("loginService", loginService);
         serverStub = new ObjectName("geronimo.remoting:target=JaasLoginServiceRemotingServer");
         kernel.loadGBean(serverStub, gbean);
 
         kernel.startGBean(loginService);
         kernel.startGBean(testCE);
         kernel.startGBean(testRealm);
-        kernel.startGBean(subsystemRouter);
-        kernel.startGBean(secureSubsystemRouter);
-        kernel.startGBean(asyncTransport);
-        kernel.startGBean(saslTransport);
-        kernel.startGBean(gssapiTransport);
-        kernel.startGBean(jmxRouter);
-        kernel.startGBean(secureJmxRouter);
         kernel.startGBean(serverStub);
 
-        URI connectURI = (URI) kernel.getAttribute(asyncTransport, "clientConnectURI");
+        URI connectURI = (URI) kernel.getAttribute(serverStub, "clientConnectURI");
         asyncRemoteProxy = JaasLoginServiceRemotingClient.create(connectURI.getHost(), connectURI.getPort());
 
-        connectURI = (URI) kernel.getAttribute(saslTransport, "clientConnectURI");
+        connectURI = (URI) kernel.getAttribute(serverStub, "clientConnectURI");
         saslRemoteProxy = JaasLoginServiceRemotingClient.create(connectURI.getHost(), connectURI.getPort());
 
-        connectURI = (URI) kernel.getAttribute(gssapiTransport, "clientConnectURI");
+        connectURI = (URI) kernel.getAttribute(serverStub, "clientConnectURI");
         gssapiRemoteProxy = JaasLoginServiceRemotingClient.create(connectURI.getHost(), connectURI.getPort());
     }
 
     protected void tearDown() throws Exception {
         kernel.stopGBean(serverStub);
-        kernel.stopGBean(secureJmxRouter);
-        kernel.stopGBean(jmxRouter);
-        kernel.stopGBean(gssapiTransport);
-        kernel.stopGBean(saslTransport);
-        kernel.stopGBean(asyncTransport);
-        kernel.stopGBean(secureSubsystemRouter);
-        kernel.stopGBean(subsystemRouter);
         kernel.stopGBean(testRealm);
         kernel.stopGBean(testCE);
         kernel.stopGBean(loginService);
@@ -207,13 +152,6 @@
         kernel.unloadGBean(loginService);
         kernel.unloadGBean(testCE);
         kernel.unloadGBean(testRealm);
-        kernel.unloadGBean(subsystemRouter);
-        kernel.unloadGBean(secureSubsystemRouter);
-        kernel.unloadGBean(asyncTransport);
-        kernel.unloadGBean(saslTransport);
-        kernel.unloadGBean(gssapiTransport);
-        kernel.unloadGBean(jmxRouter);
-        kernel.unloadGBean(secureJmxRouter);
         kernel.unloadGBean(serverStub);
         kernel.unloadGBean(serverInfo);
 

Mime
View raw message