openejb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r452600 [2/3] - in /incubator/openejb/trunk/openejb2: ./ modules/ modules/openejb-builder/src/test/java/org/apache/openejb/corba/security/config/tss/ modules/openejb-core/src/main/java/org/apache/openejb/corba/ modules/openejb-core/src/main...
Date Tue, 03 Oct 2006 19:29:45 GMT
Added: incubator/openejb/trunk/openejb2/modules/openejb-sunorb/pom.xml
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb2/modules/openejb-sunorb/pom.xml?view=auto&rev=452600
==============================================================================
--- incubator/openejb/trunk/openejb2/modules/openejb-sunorb/pom.xml (added)
+++ incubator/openejb/trunk/openejb2/modules/openejb-sunorb/pom.xml Tue Oct  3 12:29:42 2006
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!-- $Revision$ $Date$ -->
+
+<project>
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.openejb</groupId>
+        <artifactId>modules</artifactId>
+        <version>2.2-incubating-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <name>OpenEJB CORBA:: Sun ORB</name>
+    <artifactId>openejb-sunorb</artifactId>
+    <description>OpenEJB Sun ORB adapter</description>
+    <url>http://www.openejb.org</url>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.openejb</groupId>
+            <artifactId>openejb-core</artifactId>
+            <version>${pom.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-util</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-core</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-management</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-kernel</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-security</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-system</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-common</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging-api</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+        </dependency>
+    </dependencies>         b
+
+    <build>
+        <resources>
+            <resource>
+                <directory>src/resources2</directory>
+            </resource>
+        </resources>
+        <plugins>
+            <plugin>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>1.4</source>
+                    <target>1.4</target>
+                </configuration>
+            </plugin>
+	    <plugin>
+              <groupId>org.apache.maven.plugins</groupId>
+              <artifactId>maven-surefire-plugin</artifactId>
+	    </plugin>
+        </plugins>
+    </build>
+</project>

Propchange: incubator/openejb/trunk/openejb2/modules/openejb-sunorb/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/openejb/trunk/openejb2/modules/openejb-sunorb/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: incubator/openejb/trunk/openejb2/modules/openejb-sunorb/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/IORSSLInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/IORSSLInterceptor.java?view=auto&rev=452600
==============================================================================
--- incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/IORSSLInterceptor.java (added)
+++ incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/IORSSLInterceptor.java Tue Oct  3 12:29:42 2006
@@ -0,0 +1,55 @@
+/**
+  * 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.openejb.sunorb;
+
+import com.sun.corba.se.interceptor.IORInfoExt;
+import com.sun.corba.se.interceptor.UnknownType;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.omg.CORBA.LocalObject;
+import org.omg.PortableInterceptor.IORInfo;
+import org.omg.PortableInterceptor.IORInterceptor;
+
+
+/**
+ * @version $Revision$ $Date$
+ */
+final class IORSSLInterceptor extends LocalObject implements IORInterceptor {
+
+    private final Log log = LogFactory.getLog(IORSSLInterceptor.class);
+
+    public void establish_components(IORInfo info) {
+
+        try {
+            IORInfoExt ext = (IORInfoExt) info;
+
+            int port = ext.getServerPort(OpenEJBSocketFactory.IIOP_SSL);
+
+//            info.add_ior_component(policy.getConfig().generateIOR(Util.getORB(), Util.getCodec()), TAG_INTERNET_IOP.value);
+        } catch (UnknownType unknownType) {
+            log.error("Unknown type", unknownType);
+        }
+    }
+
+    public void destroy() {
+    }
+
+    public String name() {
+        return "org.apache.openejb.corba.ssl.IORSSLInterceptor";
+    }
+
+}

Propchange: incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/IORSSLInterceptor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/IORSSLInterceptor.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/IORSSLInterceptor.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/MinorCodes.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/MinorCodes.java?view=auto&rev=452600
==============================================================================
--- incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/MinorCodes.java (added)
+++ incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/MinorCodes.java Tue Oct  3 12:29:42 2006
@@ -0,0 +1,30 @@
+/**
+  * 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.openejb.sunorb;
+
+import com.sun.corba.se.internal.orbutil.ORBConstants;
+
+/**
+ * @version $Revision$ $Date$
+ */
+public interface MinorCodes {
+
+    /**
+     * COMM_FAILURE minor codes
+     */
+    public static final int UNSUPPORTED_ENDPOINT_TYPE = ORBConstants.GENERAL_BASE + 1;
+}

Propchange: incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/MinorCodes.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/MinorCodes.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/MinorCodes.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/OpenEJBEndPointImpl.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/OpenEJBEndPointImpl.java?view=auto&rev=452600
==============================================================================
--- incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/OpenEJBEndPointImpl.java (added)
+++ incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/OpenEJBEndPointImpl.java Tue Oct  3 12:29:42 2006
@@ -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.openejb.sunorb;
+
+import com.sun.corba.se.connection.EndPointInfo;
+import com.sun.corba.se.internal.iiop.EndPointImpl;
+
+import org.omg.CSIIOP.EstablishTrustInClient;
+import org.omg.CSIIOP.EstablishTrustInTarget;
+
+/**
+ * An extended endpoint information object used
+ * by the OpenEJBSocketFactory object to pass extended information
+ * between the various stages.
+ */
+public class OpenEJBEndPointImpl extends EndPointImpl {
+    // supports information for an SSL connection
+    private int supports;
+    // requires flags information for an SSL connection
+    private int requires;
+    // the supported and requires booleans derived from the flag settings.
+    private boolean authSupported = false;
+    private boolean authRequired = false;
+
+    public OpenEJBEndPointImpl(String type, int port, String host, int supports, int requires) {
+        super(type, port, host);
+        this.requires = requires;
+        this.supports = supports;
+
+        if ((supports & EstablishTrustInClient.value) != 0) {
+            authSupported = true;
+
+            if ((requires & EstablishTrustInClient.value) != 0) {
+                authRequired = true;
+            }
+        }
+
+        if ((supports & EstablishTrustInTarget.value) != 0) {
+            authSupported = true;
+
+            if ((requires & EstablishTrustInTarget.value) != 0) {
+                authSupported = true;
+            }
+        }
+    }
+
+
+    public int getRequires() {
+        return requires;
+    }
+
+    public int getSupports() {
+        return supports;
+    }
+
+    public boolean clientAuthSupported() {
+        return authSupported;
+    }
+
+    public boolean clientAuthRequired() {
+        return authRequired;
+    }
+}

Propchange: incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/OpenEJBEndPointImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/OpenEJBEndPointImpl.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/OpenEJBEndPointImpl.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/OpenEJBORB.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/OpenEJBORB.java?view=auto&rev=452600
==============================================================================
--- incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/OpenEJBORB.java (added)
+++ incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/OpenEJBORB.java Tue Oct  3 12:29:42 2006
@@ -0,0 +1,42 @@
+/**
+  * 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.openejb.sunorb;
+
+import com.sun.corba.se.internal.Interceptors.PIORB;
+import com.sun.corba.se.internal.POA.POAImpl;
+import com.sun.corba.se.internal.POA.POAManagerImpl;
+import com.sun.corba.se.internal.POA.Policies;
+import com.sun.corba.se.internal.orbutil.ORBConstants;
+
+
+/**
+ * This class is used to assist in the interception of IOR creation.
+ *
+ * @version $Revision$ $Date$
+ * @see OpenEJBPOA
+ */
+public class OpenEJBORB extends PIORB {
+
+    protected POAImpl makeRootPOA() {
+
+        POAManagerImpl poaManager = new POAManagerImpl(this);
+        POAImpl result = new OpenEJBPOA(ORBConstants.ROOT_POA_NAME, poaManager, Policies.rootPOAPolicies, null, null, this);
+
+        return result;
+    }
+
+}

Propchange: incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/OpenEJBORB.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/OpenEJBORB.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/OpenEJBORB.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/OpenEJBPOA.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/OpenEJBPOA.java?view=auto&rev=452600
==============================================================================
--- incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/OpenEJBPOA.java (added)
+++ incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/OpenEJBPOA.java Tue Oct  3 12:29:42 2006
@@ -0,0 +1,116 @@
+/**
+  * 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.openejb.sunorb;
+
+import com.sun.corba.se.internal.POA.POAImpl;
+import com.sun.corba.se.internal.POA.POAManagerImpl;
+import com.sun.corba.se.internal.POA.POAORB;
+import com.sun.corba.se.internal.POA.Policies;
+import com.sun.corba.se.internal.corba.CORBAObjectImpl;
+import com.sun.corba.se.internal.core.ClientSubcontract;
+import com.sun.corba.se.internal.core.IOR;
+import com.sun.corba.se.internal.core.StandardIIOPProfileTemplate;
+import com.sun.corba.se.internal.ior.IIOPAddressImpl;
+import com.sun.corba.se.internal.ior.IORTemplate;
+import com.sun.corba.se.internal.ior.ObjectId;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.omg.CORBA.portable.Delegate;
+import org.omg.CORBA.portable.ObjectImpl;
+import org.omg.PortableServer.AdapterActivator;
+
+import org.apache.openejb.corba.security.ServerPolicy;
+import org.apache.openejb.corba.security.ServerPolicyFactory;
+
+
+/**
+ * This class basically intercepts the creation of IORs and checks to see if
+ * CSIv2 transport security has been defined.  If it has, then the port of the
+ * profile must be zero, indicating that only the transport defined in the
+ * CSIv2 component should be used.
+ *
+ * @version $Revision$ $Date$
+ */
+public class OpenEJBPOA extends POAImpl {
+
+    private final static Log log = LogFactory.getLog(OpenEJBPOA.class);
+
+    public OpenEJBPOA(String name, POAManagerImpl manager, Policies policies, POAImpl parent, AdapterActivator activator, POAORB orb) {
+        super(name, manager, policies, parent, activator, orb);
+
+        if (log.isDebugEnabled()) log.debug("<init>");
+    }
+
+    public POAImpl makePOA(String name, POAManagerImpl manager, Policies policies, POAImpl parent, AdapterActivator activator, POAORB orb) {
+        if (log.isDebugEnabled()) log.debug("makePOA()");
+
+        return new OpenEJBPOA(name, manager, policies, parent, activator, orb);
+    }
+
+    protected org.omg.CORBA.Object makeObjectReference(String repId, byte[] id, IORTemplate iortemp, int scid) {
+
+        if (log.isDebugEnabled()) log.debug("makeObjectReference()");
+
+        IORTemplate template = null;
+
+        ServerPolicy policy = (ServerPolicy) get_effective_policy(ServerPolicyFactory.POLICY_TYPE);
+        if (policy != null
+            && policy.getConfig() != null
+            && policy.getConfig().getTransport_mech().getRequires() > 0)
+        {
+            if (log.isDebugEnabled()) log.debug("Found security policy");
+
+            template = new IORTemplate();
+
+            for (int i = 0; i < iortemp.size(); i++) {
+                Object obj = iortemp.get(i);
+
+                if (obj instanceof StandardIIOPProfileTemplate) {
+                    StandardIIOPProfileTemplate stdTemp = (StandardIIOPProfileTemplate) obj;
+                    IIOPAddressImpl primaryAddress = (IIOPAddressImpl) stdTemp.getPrimaryAddress();
+
+                    StandardIIOPProfileTemplate newTemp = new StandardIIOPProfileTemplate(new IIOPAddressImpl(primaryAddress.getHost(), 0),
+                                                                                          stdTemp.getMajorVersion(), stdTemp.getMinorVersion(),
+                                                                                          stdTemp.getObjectKeyTemplate(),
+                                                                                          null,
+                                                                                          orb);
+                    newTemp.clear();
+                    newTemp.addAll(stdTemp);
+
+                    if (stdTemp.isImmutable()) newTemp.makeImmutable();
+
+                    obj = newTemp;
+                }
+
+                template.add(obj);
+            }
+        } else {
+            template = iortemp;
+        }
+
+        IOR ior = new IOR(orb, repId, template, new ObjectId(id));
+
+        ClientSubcontract csub = orb.getSubcontractRegistry().getClientSubcontract(scid);
+        csub.setOrb(orb);
+        csub.unmarshal(ior);
+
+        ObjectImpl o = new CORBAObjectImpl();
+        o._set_delegate((Delegate) csub);
+
+        return o;
+    }
+}

Propchange: incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/OpenEJBPOA.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/OpenEJBPOA.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/OpenEJBPOA.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/OpenEJBSocketFactory.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/OpenEJBSocketFactory.java?view=auto&rev=452600
==============================================================================
--- incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/OpenEJBSocketFactory.java (added)
+++ incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/OpenEJBSocketFactory.java Tue Oct  3 12:29:42 2006
@@ -0,0 +1,347 @@
+/**
+  * 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.openejb.sunorb;
+
+import java.io.IOException;
+import java.net.ServerSocket;
+import java.net.Socket;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+import javax.net.ssl.SSLServerSocket;
+import javax.net.ssl.SSLServerSocketFactory;
+import javax.net.ssl.SSLSocket;
+import javax.net.ssl.SSLSocketFactory;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.omg.CORBA.COMM_FAILURE;
+import org.omg.CORBA.CompletionStatus;
+import org.omg.CORBA.ORB;
+import org.omg.CSIIOP.EstablishTrustInClient;
+import org.omg.CSIIOP.Confidentiality;
+import org.omg.CSIIOP.EstablishTrustInTarget;
+import org.omg.CSIIOP.NoProtection;
+import org.omg.CSIIOP.TAG_CSI_SEC_MECH_LIST;
+import org.omg.IOP.TaggedComponent;
+import org.apache.openejb.corba.ORBConfiguration;
+import org.apache.openejb.corba.security.config.ConfigUtil;
+import org.apache.openejb.corba.security.config.tss.TSSCompoundSecMechListConfig;
+import org.apache.openejb.corba.security.config.css.CSSCompoundSecMechConfig;
+import org.apache.openejb.corba.security.config.css.CSSCompoundSecMechListConfig;
+import org.apache.openejb.corba.security.config.css.CSSConfig;
+import org.apache.openejb.corba.security.config.tss.TSSConfig;
+import org.apache.openejb.corba.security.config.ssl.SSLConfig;
+import org.apache.openejb.corba.security.config.ssl.SSLCipherSuiteDatabase;
+import org.apache.openejb.corba.security.config.tss.TSSSSLTransportConfig;
+import org.apache.openejb.corba.security.config.tss.TSSTransportMechConfig;
+import org.apache.openejb.corba.util.Util;
+
+import com.sun.corba.se.connection.EndPointInfo;
+import com.sun.corba.se.connection.GetEndPointInfoAgainException;
+import com.sun.corba.se.connection.ORBSocketFactory;
+import com.sun.corba.se.internal.core.IOR;
+import com.sun.corba.se.internal.iiop.EndPointImpl;
+import com.sun.corba.se.internal.ior.IIOPAddress;
+import com.sun.corba.se.internal.ior.IIOPProfileTemplate;
+
+
+/**
+ * @version $Revision$ $Date$
+ */
+public class OpenEJBSocketFactory implements ORBSocketFactory {
+
+    private final static Log log = LogFactory.getLog(OpenEJBSocketFactory.class);
+
+    public final static String IIOP_SSL = "IIOP_SSL";
+
+    // The initialized SSLSocketFactory obtained from the Geronimo KeystoreManager.
+    private SSLSocketFactory socketFactory = null;
+    // The initialized SSLServerSocketFactory obtained from the Geronimo KeystoreManager.
+    private SSLServerSocketFactory serverSocketFactory = null;
+    // the CorabBean or CSSBean instance this ORB is attached to.
+    private ORBConfiguration config = null;
+    // The initialized SSLConfig we use to retrieve the SSL socket factories.
+    private SSLConfig sslConfig = null;
+    // The set of cypher suites we use with the SSL connection.
+    private String[] cipherSuites;
+    // indicates whether client authentication is supported by this transport.
+    private boolean clientAuthSupported;
+    // indicates whether client authentication is required by this transport.
+    private boolean clientAuthRequired;
+    // supports and requires values used to retrieve the cipher suites.
+    int supports = NoProtection.value;
+    int requires = NoProtection.value;
+
+    public OpenEJBSocketFactory() {
+
+        if (log.isDebugEnabled()) log.debug("<init>");
+    }
+
+    /**
+     * Create a server socket of the indicated type and port.
+     *
+     * @param type   The string type name for the socket.  This will be either IIOP_CLEAR_TEXT
+     *               or IIOP_SSL.
+     * @param port   The required port number for the server socket.
+     *
+     * @return A created and configured socket of the desired type.
+     * @exception IOException
+     */
+    public ServerSocket createServerSocket(String type, int port) throws IOException {
+
+        if (type.equals(ORBSocketFactory.IIOP_CLEAR_TEXT)) {
+            if (log.isDebugEnabled()) log.debug("Created plain server socket on port " + port);
+
+            return new ServerSocket(port);
+        } else if (type.equals(IIOP_SSL)) {
+            SSLServerSocket serverSocket = (SSLServerSocket)getServerSocketFactory().createServerSocket(port);
+
+            serverSocket.setEnabledCipherSuites(cipherSuites);
+            serverSocket.setWantClientAuth(clientAuthSupported);
+            serverSocket.setNeedClientAuth(clientAuthRequired);
+            serverSocket.setSoTimeout(60 * 1000);
+
+            if (log.isDebugEnabled()) {
+                log.debug("Created SSL server socket on port " + port);
+                log.debug("    client authentication " + (clientAuthSupported ? "SUPPORTED" : "UNSUPPORTED"));
+                log.debug("    client authentication " + (clientAuthRequired ? "REQUIRED" : "OPTIONAL"));
+                log.debug("    cipher suites:");
+
+                for (int i = 0; i < cipherSuites.length; i++) {
+                    log.debug("    " + cipherSuites[i]);
+                }
+            }
+
+            return serverSocket;
+        }
+        throw new COMM_FAILURE("SocketFactory cannot handle: " + type, MinorCodes.UNSUPPORTED_ENDPOINT_TYPE, CompletionStatus.COMPLETED_NO);
+    }
+
+    /**
+     * Create a client socket to connect to a given end point.
+     *
+     * @param endPointInfo
+     *               The EndPointInfo object that defines the characteristics of
+     *               the target (type of socket, host, and port).
+     *
+     * @return A created and configured socket of the desired type.
+     * @exception IOException
+     * @exception GetEndPointInfoAgainException
+     */
+    public Socket createSocket(EndPointInfo endPointInfo) throws IOException, GetEndPointInfoAgainException {
+
+        String type = endPointInfo.getType();
+
+        if (type.equals(ORBSocketFactory.IIOP_CLEAR_TEXT)) {
+            if (log.isDebugEnabled()) log.debug("Created plain socket to " + endPointInfo.getHost() + ":" + endPointInfo.getPort());
+
+            return new Socket(endPointInfo.getHost(), endPointInfo.getPort());
+        } else if (type.equals(IIOP_SSL)) {
+            SSLSocket socket = null;
+            SSLSocketFactory factory = getSocketFactory();
+            try {
+                socket = (SSLSocket) factory.createSocket(endPointInfo.getHost(), endPointInfo.getPort());
+            } catch (IOException e) {
+                log.debug("could not create socket:", e);
+                throw e;
+            }
+
+            socket.setSoTimeout(60 * 1000);
+
+            OpenEJBEndPointImpl e = (OpenEJBEndPointImpl)endPointInfo;
+
+            String[] iorSuites = SSLCipherSuiteDatabase.getCipherSuites(e.getRequires(), e.getSupports(), serverSocketFactory.getSupportedCipherSuites());
+            socket.setEnabledCipherSuites(iorSuites);
+            socket.setWantClientAuth(e.clientAuthSupported());
+            socket.setNeedClientAuth(e.clientAuthRequired());
+
+            if (log.isDebugEnabled()) {
+                log.debug("Created SSL socket to " + endPointInfo.getHost() + ":" + endPointInfo.getPort());
+                log.debug("    client authentication " + (e.clientAuthSupported() ? "SUPPORTED" : "UNSUPPORTED"));
+                log.debug("    client authentication " + (e.clientAuthRequired() ? "REQUIRED" : "OPTIONAL"));
+                log.debug("    cipher suites:");
+
+                for (int i = 0; i < iorSuites.length; i++) {
+                    log.debug("    " + iorSuites[i]);
+                }
+            }
+            return socket;
+        }
+        throw new COMM_FAILURE("SocketFactory cannot handle: " + type, MinorCodes.UNSUPPORTED_ENDPOINT_TYPE, CompletionStatus.COMPLETED_NO);
+    }
+
+    /**
+     * Determine the end point information for a particular socket
+     * connection.  This examines the IOR profile information to
+     * see if the IOR profile is configured for TSS security mechanisms.
+     *
+     * @param orb    The orb this request is running on.
+     * @param ior    The ior of the target connection.
+     * @param endPointInfo
+     *               Existing endpoint information for this connection.
+     *
+     * @return An endpoint Info object configured with the appropriate socket
+     *         type and target information.
+     */
+    public EndPointInfo getEndPointInfo(ORB orb, IOR ior, EndPointInfo endPointInfo) {
+
+        IIOPProfileTemplate temp = ior.getProfile().getTemplate();
+        IIOPAddress primary = temp.getPrimaryAddress();
+
+        TaggedComponent[] iopComponents = ior.getProfile().getIOPComponents(orb, TAG_CSI_SEC_MECH_LIST.value);
+        for (int i = 0; i < iopComponents.length; i++) {
+            try {
+                TSSCompoundSecMechListConfig config = TSSCompoundSecMechListConfig.decodeIOR(Util.getCodec(), iopComponents[i]);
+                for (int j = 0; j < config.size(); j++) {
+                    TSSTransportMechConfig transport_mech = config.mechAt(j).getTransport_mech();
+                    if (transport_mech instanceof TSSSSLTransportConfig) {
+                        TSSSSLTransportConfig transportConfig = (TSSSSLTransportConfig) transport_mech;
+                        int supports = transportConfig.getSupports();
+                        int requires = transportConfig.getRequires();
+
+                        if (log.isDebugEnabled()) {
+
+                            log.debug("IOR from target " + transportConfig.getHostname().toLowerCase() + ":" + transportConfig.getPort());
+                            log.debug("   SUPPORTS: " + ConfigUtil.flags(supports));
+                            log.debug("   REQUIRES: " + ConfigUtil.flags(requires));
+                        }
+
+                        // if ne protection is the order of the day, break out and create a plain text version.
+                        if ((NoProtection.value & transportConfig.getRequires()) == NoProtection.value) {
+                            break;
+                        }
+                        return new OpenEJBEndPointImpl(IIOP_SSL,
+                                                transportConfig.getPort(),
+                                                transportConfig.getHostname().toLowerCase(), supports, requires);
+
+                    }
+                }
+            } catch (Exception e) {
+                // do nothing
+            }
+        }
+
+        if (log.isDebugEnabled()) log.debug("Created plain endpoint to " + primary.getHost() + ":" + primary.getPort());
+
+        return new EndPointImpl(ORBSocketFactory.IIOP_CLEAR_TEXT,
+                                primary.getPort(),
+                                primary.getHost().toLowerCase());
+    }
+
+    /**
+     * On-demand creation of an SSL socket factory, using the provided
+     * Geronimo SSLConfig information.
+     *
+     * @return The SSLSocketFactory this connection should be using to create
+     *         secure connections.
+     */
+    private SSLSocketFactory getSocketFactory() throws IOException {
+        // first use?
+        if (socketFactory == null) {
+            if (sslConfig == null) {
+                socketFactory = (SSLSocketFactory) SSLSocketFactory.getDefault();
+            }
+            else {
+                try {
+                    socketFactory = (SSLSocketFactory)sslConfig.createSSLFactory(Thread.currentThread().getContextClassLoader());
+                } catch (Exception e) {
+                    throw new IOException("Unable to create client SSL socket factory: " + e.getMessage());
+                }
+            }
+            if (cipherSuites == null) {
+                cipherSuites = SSLCipherSuiteDatabase.getCipherSuites(requires, supports, socketFactory.getSupportedCipherSuites());
+            }
+        }
+        return socketFactory;
+    }
+
+    /**
+     * On-demand creation of an SSL server socket factory, using the provided
+     * Geronimo SSLConfig information.
+     *
+     * @return The SSLServerSocketFactory this connection should be using to create
+     *         secure connections.
+     */
+    private SSLServerSocketFactory getServerSocketFactory() throws IOException {
+        // first use?
+        if (serverSocketFactory == null) {
+            if (sslConfig == null) {
+                serverSocketFactory = (SSLServerSocketFactory) SSLServerSocketFactory.getDefault();
+            }
+            else {
+                try {
+                    serverSocketFactory = (SSLServerSocketFactory)sslConfig.createSSLServerFactory(Thread.currentThread().getContextClassLoader());
+                } catch (Exception e) {
+                    throw new IOException("Unable to create server SSL socket factory: " + e.getMessage());
+                }
+            }
+            if (cipherSuites == null) {
+                cipherSuites = SSLCipherSuiteDatabase.getCipherSuites(requires, supports, serverSocketFactory.getSupportedCipherSuites());
+            }
+        }
+        return serverSocketFactory;
+    }
+
+
+    /**
+     * Set the CSSConfig item that should be used by this connection.
+     *
+     * @param config The Bean configured CSSConfig.
+     */
+    public void setConfig(ORBConfiguration config) {
+        this.config = config;
+
+        clientAuthSupported = false;
+        clientAuthRequired = false;
+
+        // retrieve the SSL factory manager
+        sslConfig = config.getSslConfig();
+
+        TSSConfig tssConfig = config.getTssConfig();
+        TSSTransportMechConfig transportMech = tssConfig.getTransport_mech();
+        if (transportMech != null) {
+            if (transportMech instanceof TSSSSLTransportConfig) {
+                TSSSSLTransportConfig transportConfig = (TSSSSLTransportConfig) transportMech;
+                supports = transportConfig.getSupports();
+                requires = transportConfig.getRequires();
+            }
+        }
+
+        // now set the server parameters based on the profile
+        if ((supports & EstablishTrustInClient.value) != 0) {
+            clientAuthSupported = true;
+
+            if ((requires & EstablishTrustInClient.value) != 0) {
+                clientAuthRequired = true;
+            }
+        }
+
+        if ((supports & EstablishTrustInTarget.value) != 0) {
+            clientAuthSupported = true;
+
+            if ((requires & EstablishTrustInTarget.value) != 0) {
+                clientAuthRequired = true;
+            }
+        }
+
+        if (log.isDebugEnabled()) {
+            log.debug("   SUPPORTS: " + ConfigUtil.flags(supports));
+            log.debug("   REQUIRES: " + ConfigUtil.flags(requires));
+        }
+    }
+}

Propchange: incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/OpenEJBSocketFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/OpenEJBSocketFactory.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/OpenEJBSocketFactory.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/ServiceContextInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/ServiceContextInterceptor.java?view=auto&rev=452600
==============================================================================
--- incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/ServiceContextInterceptor.java (added)
+++ incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/ServiceContextInterceptor.java Tue Oct  3 12:29:42 2006
@@ -0,0 +1,87 @@
+/**
+  * 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.openejb.sunorb;
+
+import java.net.Socket;
+import javax.net.ssl.SSLSession;
+import javax.net.ssl.SSLSocket;
+
+import com.sun.corba.se.interceptor.RequestInfoExt;
+import com.sun.corba.se.connection.Connection;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.omg.CORBA.LocalObject;
+import org.omg.PortableInterceptor.ServerRequestInfo;
+import org.omg.PortableInterceptor.ServerRequestInterceptor;
+
+import org.apache.openejb.corba.security.SSLSessionManager;
+
+
+/**
+ * @version $Revision$ $Date$
+ */
+final class ServiceContextInterceptor extends LocalObject implements ServerRequestInterceptor {
+
+    private final Log log = LogFactory.getLog(ServiceContextInterceptor.class);
+
+    public ServiceContextInterceptor() {
+        if (log.isDebugEnabled()) log.debug("<init>");
+    }
+
+    public void receive_request(ServerRequestInfo ri) {
+    }
+
+    public void receive_request_service_contexts(ServerRequestInfo ri) {
+
+        if (log.isDebugEnabled()) log.debug("Looking for SSL Session");
+
+        RequestInfoExt riExt = (RequestInfoExt) ri;
+        Connection connection = riExt.connection();
+        if (connection != null) {
+            Socket socket = connection.getSocket();
+            if (socket instanceof SSLSocket) {
+                if (log.isDebugEnabled()) log.debug("Found SSL Session");
+                SSLSocket sslSocket = (SSLSocket) socket;
+
+                SSLSessionManager.setSSLSession(ri.request_id(), sslSocket.getSession());
+            }
+        }
+    }
+
+    public void send_exception(ServerRequestInfo ri) {
+        SSLSession old = SSLSessionManager.clearSSLSession(ri.request_id());
+        if (log.isDebugEnabled() && old != null) log.debug("Removing SSL Session for send_exception");
+    }
+
+    public void send_other(ServerRequestInfo ri) {
+        SSLSession old = SSLSessionManager.clearSSLSession(ri.request_id());
+        if (log.isDebugEnabled() && old != null) log.debug("Removing SSL Session for send_reply");
+    }
+
+    public void send_reply(ServerRequestInfo ri) {
+        SSLSession old = SSLSessionManager.clearSSLSession(ri.request_id());
+        if (log.isDebugEnabled() && old != null) log.debug("Removing SSL Session for send_reply");
+    }
+
+    public void destroy() {
+        if (log.isDebugEnabled()) log.debug("Destroy");
+    }
+
+    public String name() {
+        return "org.apache.openejb.sunorb.ServiceContextInterceptor";
+    }
+}

Propchange: incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/ServiceContextInterceptor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/ServiceContextInterceptor.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/ServiceContextInterceptor.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/SunORBConfigAdapter.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/SunORBConfigAdapter.java?view=auto&rev=452600
==============================================================================
--- incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/SunORBConfigAdapter.java (added)
+++ incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/SunORBConfigAdapter.java Tue Oct  3 12:29:42 2006
@@ -0,0 +1,377 @@
+/**
+  * 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.openejb.sunorb;
+
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Properties;
+import java.net.InetSocketAddress;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+
+import com.sun.corba.se.internal.core.EndPoint;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.omg.CORBA.ORB;
+import org.omg.CSIIOP.EstablishTrustInClient;
+import org.omg.Security.Confidentiality;
+import org.omg.Security.EstablishTrustInTarget;
+import org.omg.Security.NoProtection;
+
+import org.apache.geronimo.security.deploy.DefaultDomainPrincipal;
+import org.apache.geronimo.security.deploy.DefaultPrincipal;
+import org.apache.geronimo.security.deploy.DefaultRealmPrincipal;
+
+import org.apache.openejb.corba.CORBABean;
+import org.apache.openejb.corba.CSSBean;
+import org.apache.openejb.corba.NameService;
+import org.apache.openejb.corba.security.config.ConfigAdapter;
+import org.apache.openejb.corba.security.config.ConfigException;
+import org.apache.openejb.corba.security.config.css.CSSCompoundSecMechConfig;
+import org.apache.openejb.corba.security.config.css.CSSCompoundSecMechListConfig;
+import org.apache.openejb.corba.security.config.css.CSSConfig;
+import org.apache.openejb.corba.security.config.tss.TSSConfig;
+import org.apache.openejb.corba.security.config.ssl.SSLConfig;
+import org.apache.openejb.corba.security.config.tss.TSSSSLTransportConfig;
+import org.apache.openejb.corba.security.config.tss.TSSTransportMechConfig;
+
+
+/**
+ * @version $Revision$ $Date$
+ */
+public class SunORBConfigAdapter implements ConfigAdapter {
+
+    private final Log log = LogFactory.getLog(SunORBConfigAdapter.class);
+
+    // location for creating any ORB required files (such as the activation database)
+    private String dbDir;
+
+    public SunORBConfigAdapter(String dbDir) {
+        this.dbDir = dbDir;
+    }
+
+
+    /**
+     * Start the config adapter GBean.  This is basically
+     * an opportunity to set any system properties
+     * required to make the ORB hook ups.  In particular,
+     * this makes the ORB hookups for the RMI over IIOP
+     * support.
+     *
+     * @exception Exception
+     */
+    public void doStart() throws Exception {
+        // define the default ORB for ORB.init();
+        System.setProperty("org.omg.CORBA.ORBSingletonClass", "com.sun.corba.se.internal.corba.ORBSingleton");
+        System.setProperty("org.omg.CORBA.ORBClass", "org.apache.openejb.sunorb.OpenEJBORB");
+
+        // redirect the RMI implementation to use the Sun ORB.
+        System.setProperty("javax.rmi.CORBA.PortableRemoteObjectClass", "com.sun.corba.se.internal.javax.rmi.PortableRemoteObject ");
+        System.setProperty("javax.rmi.CORBA.StubClass", "com.sun.corba.se.internal.javax.rmi.CORBA.StubDelegateImpl");
+
+        // this hooks the util class and allows us to override certain functions
+        System.setProperty("javax.rmi.CORBA.UtilClass", "org.apache.openejb.corba.util.UtilDelegateImpl");
+        // this tells the openejb UtilDelegateImpl which implementation to delegate non-overridden
+        // operations to.
+        System.setProperty("org.apache.openejb.corba.UtilDelegateClass", "com.sun.corba.se.internal.POA.ShutdownUtilDelegate");
+        log.debug("Started  SunORBConfigAdapter");
+    }
+
+    public void doStop() throws Exception {
+        log.debug("Stopped SunORBConfigAdapter");
+    }
+
+    public void doFail() {
+        log.warn("Failed SunORBConfigAdapter");
+    }
+
+
+    /**
+     * Create an ORB for a CORBABean server context.
+     *
+     * @param server The CORBABean that owns this ORB's configuration.
+     *
+     * @return An ORB instance configured for the CORBABean.
+     * @exception ConfigException
+     */
+    public ORB createServerORB(CORBABean server)  throws ConfigException {
+        ORB orb = ORB.init(translateToArgs(server), translateToProps(server));
+        postProcess(server, orb);
+        return orb;
+    }
+
+
+    /**
+     * Create an ORB for a CSSBean client context.
+     *
+     * @param client The configured CSSBean used for access.
+     *
+     * @return An ORB instance configured for this client access.
+     * @exception ConfigException
+     */
+    public ORB createClientORB(CSSBean client)  throws ConfigException {
+        ORB orb = ORB.init(new String[0], translateToProps(client));
+        postProcess(client, orb);
+        return orb;
+    }
+
+
+    /**
+     * Create a transient name service instance using the
+     * specified host name and port.
+     *
+     * @param host   The String host name.
+     * @param port   The port number of the listener.
+     *
+     * @return An opaque object that represents the name service.
+     * @exception ConfigException
+     */
+    public Object createNameService(String host, int port) throws ConfigException {
+        Properties properties = new Properties();
+
+        // This must be a system property, the Sun BootStrapActivation class only looks at the
+        // system properties for this value
+        System.setProperty("com.sun.CORBA.activation.DbDir", "C:\\temp");
+
+        // the transient name service is automatically started by the Sun NSORB
+        properties.put("org.omg.CORBA.ORBClass", "com.sun.corba.se.internal.CosNaming.NSORB");
+        // useful for debugging.
+//      properties.put("com.sun.CORBA.ORBDebug", "transport,subcontract,poa,orbd,naming,serviceContext,giop,transientObjectManager");
+
+        String portString = Integer.toString(port);
+
+        // causes the Sun orb to immedately activate and start the activation services
+        properties.put("com.sun.CORBA.POA.ORBPersistentServerPort", portString);
+
+        // this port must match the above entry so the orb can find its own name server
+        properties.put("org.omg.CORBA.ORBInitialPort", portString);
+
+        // create the orb
+        return ORB.init(new String[0], properties);
+    }
+
+
+    /**
+     * Destroy a name service instance created by a
+     * prior call to createNameService().
+     *
+     * @param ns     The opaque name service object returned from a
+     *               prior call to createNameService().
+     */
+    public void destroyNameService(Object ns) {
+        ((ORB)ns).destroy();
+    }
+
+    /**
+     * Translate the ORB configuration values to options that need to be
+     * specfied as invocation arguments.
+     *
+     * @param server The CORBABean used to configure this server instance.
+     *
+     * @return A list containing the reconfigured set of string args.
+     * @exception ConfigException
+     */
+    private String[] translateToArgs(CORBABean server) throws ConfigException {
+        ArrayList list = new ArrayList();
+
+        // the TSS config holds the security information.
+        TSSConfig config = server.getTssConfig();
+
+        DefaultPrincipal principal = config.getDefaultPrincipal();
+        if (principal != null) {
+            if (principal instanceof DefaultRealmPrincipal) {
+                DefaultRealmPrincipal realmPrincipal = (DefaultRealmPrincipal) principal;
+                list.add("default-realm-principal::" + realmPrincipal.getRealm() + ":" + realmPrincipal.getDomain() + ":"
+                         + realmPrincipal.getPrincipal().getClassName() + ":" + realmPrincipal.getPrincipal().getPrincipalName());
+            } else if (principal instanceof DefaultDomainPrincipal) {
+                DefaultDomainPrincipal domainPrincipal = (DefaultDomainPrincipal) principal;
+                list.add("default-domain-principal::" + domainPrincipal.getDomain() + ":"
+                         + domainPrincipal.getPrincipal().getClassName() + ":" + domainPrincipal.getPrincipal().getPrincipalName());
+            } else {
+                list.add("default-principal::" + principal.getPrincipal().getClassName() + ":" + principal.getPrincipal().getPrincipalName());
+            }
+        }
+
+        NameService nameService = server.getNameService();
+
+        // if we have a name service to enable as an initial ref, add it to the init processing.
+        if (nameService != null) {
+            list.add("-ORBInitRef");
+            list.add("NameService=" + nameService.getURI());
+        }
+
+        // set the initial listener port
+        list.add("-ORBPort");
+        list.add(Integer.toString(server.getPort()));
+
+        if (log.isDebugEnabled()) {
+            for (Iterator iter = list.iterator(); iter.hasNext();) {
+                log.debug(iter.next());
+            }
+        }
+
+        return (String[]) list.toArray(new String[list.size()]);
+    }
+
+    /**
+     * Translate a CORBABean configuration into a set of ORB-specific properties
+     * required to launch the ORB configured for this property set.
+     *
+     * @param server The CORBABean object this ORB instance will be
+     *               created for.
+     *
+     * @return The new property bundled configured to launch the ORB.
+     * @exception ConfigException
+     */
+    private Properties translateToProps(CORBABean server) throws ConfigException {
+        Properties result = new Properties();
+
+        result.put("org.omg.CORBA.ORBClass", "org.apache.openejb.sunorb.OpenEJBORB");
+        result.put("com.sun.CORBA.connection.ORBSocketFactoryClass", "org.apache.openejb.sunorb.OpenEJBSocketFactory");
+        result.put("org.omg.PortableInterceptor.ORBInitializerClass.org.apache.openejb.corba.transaction.TransactionInitializer", "");
+        result.put("org.omg.PortableInterceptor.ORBInitializerClass.org.apache.openejb.corba.security.SecurityInitializer", "");
+        result.put("org.omg.PortableInterceptor.ORBInitializerClass.org.apache.openejb.sunorb.SunORBInitializer", "");
+        result.put("com.sun.CORBA.ORBAllowLocalOptimization", "");
+
+        // add the host name
+        result.put("com.sun.CORBA.ORBServerHost", server.getHost());
+
+        if (log.isDebugEnabled()) {
+            log.debug("translateToProps(TSSConfig)");
+            for (Enumeration iter = result.keys(); iter.hasMoreElements();) {
+                String key = (String) iter.nextElement();
+                log.debug(key + " = " + result.getProperty(key));
+            }
+        }
+        return result;
+    }
+
+    /**
+     * Perform ORB-specific postProcessing on an ORB created using
+     * a CORBABean.
+     *
+     * This post processing is performed to override the default listening
+     * end points so that only SSL ports are opened if the TSS config is
+     * configured to use SSL
+     *
+     * @param config The TSSConfig used to launch the ORB initially.
+     * @param ssl    The SSL config required for creating of SSL sockets.
+     * @param orb    The ORB instance the following configurations apply to.
+     *
+     * @exception ConfigException
+     */
+    private void postProcess(CORBABean server, ORB orb) throws ConfigException {
+        OpenEJBORB o = (OpenEJBORB) orb;
+
+        InetAddress host = null;
+
+        try {
+            host = InetAddress.getByName(server.getHost());
+        } catch (UnknownHostException e) {
+            throw new ConfigException("Unable to resolve host name " + server.getHost());
+        }
+
+        // make sure the we stuff the socket factory implementation with the config info before creating
+        // the first socket.
+        OpenEJBSocketFactory factory = (OpenEJBSocketFactory)o.getSocketFactory();
+        factory.setConfig(server);
+
+        TSSConfig config = server.getTssConfig();
+
+        if (config != null) {
+            TSSTransportMechConfig transportMech = config.getTransport_mech();
+            if (transportMech != null) {
+                if (transportMech instanceof TSSSSLTransportConfig) {
+                    TSSSSLTransportConfig sslConfig = (TSSSSLTransportConfig) transportMech;
+                    try {
+                        // force the initial listener end point to be an SSL connection.
+                        o.getServerGIOP().getEndpoint(OpenEJBSocketFactory.IIOP_SSL, server.getPort(), host);
+                        return;
+                    } catch (Throwable e) {
+                        log.error(e);
+                        throw new ConfigException(e);
+                    }
+                }
+            }
+        }
+        try {
+            // force the initial listener to be a plain socket if transport-level security is not indicated.
+            o.getServerGIOP().getEndpoint(EndPoint.IIOP_CLEAR_TEXT, server.getPort(), host);
+        } catch (Throwable e) {
+            log.error(e);
+            throw new ConfigException(e);
+        }
+    }
+
+
+    /**
+     * Translate a CSSConfig into a ORB-specific property bundle used
+     * to initialize the ORB.
+     *
+     * @param config The source CSSConfig.
+     * @param props  The initial property bundle set.
+     *
+     * @return A Property bundle with all of the required ORB parameters.
+     * @exception ConfigException
+     */
+    private Properties translateToProps(CSSBean client) throws ConfigException {
+        Properties result = new Properties();
+
+        result.put("org.omg.CORBA.ORBClass", "org.apache.openejb.sunorb.OpenEJBORB");
+        result.put("com.sun.CORBA.connection.ORBSocketFactoryClass", "org.apache.openejb.sunorb.OpenEJBSocketFactory");
+        result.put("org.omg.PortableInterceptor.ORBInitializerClass.org.apache.openejb.corba.transaction.TransactionInitializer", "");
+        result.put("org.omg.PortableInterceptor.ORBInitializerClass.org.apache.openejb.corba.security.SecurityInitializer", "");
+        result.put("org.omg.PortableInterceptor.ORBInitializerClass.org.apache.openejb.sunorb.SunORBInitializer", "");
+
+        if (log.isDebugEnabled()) {
+            log.debug("translateToProps(CSSConfig)");
+            for (Enumeration iter = result.keys(); iter.hasMoreElements();) {
+                String key = (String) iter.nextElement();
+                log.debug(key + " = " + result.getProperty(key));
+            }
+        }
+        return result;
+    }
+
+    /**
+     * Perform ORB-specific postProcessing on an ORB created using
+     * A CSSConfig.
+     *
+     * @param config The CSSConfig used to launch the ORB initially.
+     * @param ssl    The SSL config required for creating of SSL sockets.
+     * @param orb    The ORB instance the following configurations apply to.
+     *
+     * @exception ConfigException
+     */
+    private void postProcess(CSSBean client, ORB orb) throws ConfigException {
+        // all we need here is stuffing the configuration information into the socket factory before it
+        // gets used for anything.
+        OpenEJBSocketFactory factory = (OpenEJBSocketFactory)((OpenEJBORB)orb).getSocketFactory();
+        factory.setConfig(client);
+    }
+
+    /**
+     * Retrieve the directory used for ORB configuration files.
+     *
+     * @return The configured directory.
+     */
+    public String getDbDir() {
+        return dbDir;
+    }
+}

Propchange: incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/SunORBConfigAdapter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/SunORBConfigAdapter.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/SunORBConfigAdapter.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/SunORBConfigAdapterGBean.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/SunORBConfigAdapterGBean.java?view=auto&rev=452600
==============================================================================
--- incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/SunORBConfigAdapterGBean.java (added)
+++ incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/SunORBConfigAdapterGBean.java Tue Oct  3 12:29:42 2006
@@ -0,0 +1,46 @@
+/**
+  * 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.openejb.sunorb;
+
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+
+/**
+ * @version $Revision$ $Date$
+ */
+public final class SunORBConfigAdapterGBean extends org.apache.openejb.corba.security.config.ConfigAdapterGBean {
+
+    public static final GBeanInfo GBEAN_INFO;
+
+    public SunORBConfigAdapterGBean() {
+    }
+
+    static {
+        GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(SunORBConfigAdapterGBean.class, "ORB Configuration Adapater", SunORBConfigAdapter.class, NameFactory.ORB_CONFIG);
+        infoFactory.addAttribute("dbDir", String.class, true);
+        infoFactory.setConstructor(new String[] {"dbDir"} );
+        infoFactory.addInterface(org.apache.openejb.corba.security.config.ConfigAdapter.class);
+
+        GBEAN_INFO = infoFactory.getBeanInfo();
+    }
+
+    public static GBeanInfo getGBeanInfo() {
+        return GBEAN_INFO;
+    }
+}
+

Propchange: incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/SunORBConfigAdapterGBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/SunORBConfigAdapterGBean.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/SunORBConfigAdapterGBean.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/SunORBInitializer.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/SunORBInitializer.java?view=auto&rev=452600
==============================================================================
--- incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/SunORBInitializer.java (added)
+++ incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/SunORBInitializer.java Tue Oct  3 12:29:42 2006
@@ -0,0 +1,85 @@
+/**
+  * 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.openejb.sunorb;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.omg.CORBA.LocalObject;
+import org.omg.PortableInterceptor.ORBInitInfo;
+import org.omg.PortableInterceptor.ORBInitInfoPackage.DuplicateName;
+import org.omg.PortableInterceptor.ORBInitializer;
+
+
+/**
+ * @version $Revision$ $Date$
+ */
+public class SunORBInitializer extends LocalObject implements ORBInitializer {
+
+    private final Log log = LogFactory.getLog(SunORBInitializer.class);
+
+    public SunORBInitializer() {
+        if (log.isDebugEnabled()) log.debug("SunORBInitializer.<init>");
+    }
+
+    /**
+     * Called during ORB initialization.  If it is expected that initial
+     * services registered by an interceptor will be used by other
+     * interceptors, then those initial services shall be registered at
+     * this point via calls to
+     * <code>ORBInitInfo.register_initial_reference</code>.
+     *
+     * @param info provides initialization attributes and operations by
+     *             which Interceptors can be registered.
+     */
+    public void pre_init(ORBInitInfo info) {
+    }
+
+    /**
+     * Called during ORB initialization. If a service must resolve initial
+     * references as part of its initialization, it can assume that all
+     * initial references will be available at this point.
+     * <p/>
+     * Calling the <code>post_init</code> operations is not the final
+     * task of ORB initialization. The final task, following the
+     * <code>post_init</code> calls, is attaching the lists of registered
+     * interceptors to the ORB. Therefore, the ORB does not contain the
+     * interceptors during calls to <code>post_init</code>. If an
+     * ORB-mediated call is made from within <code>post_init</code>, no
+     * request interceptors will be invoked on that call.
+     * Likewise, if an operation is performed which causes an IOR to be
+     * created, no IOR interceptors will be invoked.
+     *
+     * @param info provides initialization attributes and
+     *             operations by which Interceptors can be registered.
+     */
+    public void post_init(ORBInitInfo info) {
+
+        try {
+            if (log.isDebugEnabled()) log.debug("Registering IOR interceptor");
+
+            try {
+                info.add_ior_interceptor(new IORSSLInterceptor());
+                info.add_server_request_interceptor(new ServiceContextInterceptor());
+            } catch (DuplicateName dn) {
+                log.error("Error registering interceptor", dn);
+            }
+        } catch (RuntimeException re) {
+            log.error("Error registering interceptor", re);
+            throw re;
+        }
+    }
+}

Propchange: incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/SunORBInitializer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/SunORBInitializer.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/main/java/org/apache/openejb/sunorb/SunORBInitializer.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/test/java/org/apache/openejb/sunorb/SunNameServiceTest.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/test/java/org/apache/openejb/sunorb/SunNameServiceTest.java?view=auto&rev=452600
==============================================================================
--- incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/test/java/org/apache/openejb/sunorb/SunNameServiceTest.java (added)
+++ incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/test/java/org/apache/openejb/sunorb/SunNameServiceTest.java Tue Oct  3 12:29:42 2006
@@ -0,0 +1,114 @@
+/**
+  * 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.openejb.sunorb;
+
+import java.util.Properties;
+import java.io.File;
+
+import org.apache.openejb.corba.NameService;
+
+import com.sun.corba.se.internal.orbutil.ORBConstants;
+import junit.framework.TestCase;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.geronimo.system.serverinfo.ServerInfo;
+import org.apache.geronimo.system.serverinfo.BasicServerInfo;
+import org.omg.CORBA.ORB;
+import org.omg.CosNaming.NameComponent;
+import org.omg.CosNaming.NamingContextExt;
+import org.omg.CosNaming.NamingContextExtHelper;
+
+/**
+ * @version $Revision$ $Date$
+ */
+public class SunNameServiceTest extends TestCase {
+    private static final Log log = LogFactory.getLog(SunNameServiceTest.class);
+    private ORB orb;
+    private NameService sunNameService;
+    private static final String DB_DIR = "cosnaming.db";
+    private File cosNamingDbDir;
+
+    protected void setUp() throws Exception {
+        // before we do anything make sure the sun orb is present
+        try {
+            getClass().getClassLoader().loadClass("com.sun.corba.se.internal.CosNaming.NSORB");
+        } catch (ClassNotFoundException e) {
+            log.info("Sun orb is not present in this vm, so this test can't run");
+            return;
+        }
+
+        String tmpDir = System.getProperty("java.io.tmpdir");
+        cosNamingDbDir = new File(tmpDir, DB_DIR);
+        ServerInfo serverInfo = new BasicServerInfo(tmpDir);
+
+        SunORBConfigAdapter adapter = new SunORBConfigAdapter(cosNamingDbDir.toString());
+        // make sure all system properties are initialized.
+        adapter.doStart();
+        sunNameService = new NameService(serverInfo, adapter, "localhost", 8050);
+        sunNameService.doStart();
+
+        // create the ORB
+        Properties properties = new Properties();
+        properties.put("org.omg.CORBA.ORBInitialPort", "8050");
+        orb = ORB.init(new String[0], properties);
+    }
+
+    protected void tearDown() throws Exception {
+        if (sunNameService == null) {
+            return;
+        }
+        orb.destroy();
+        sunNameService.doStop();
+        recursiveDelete(cosNamingDbDir);
+    }
+
+    public void testOrb() throws Exception {
+        if (sunNameService == null) {
+            return;
+        }
+
+        NamingContextExt ctx = NamingContextExtHelper.narrow(orb.resolve_initial_references(ORBConstants.PERSISTENT_NAME_SERVICE_NAME));
+        NamingContextExt rootNamingContext = ctx;
+        NameComponent name[] = ctx.to_name("foo/bar/baz");
+        for (int i = 0; i < name.length; i++) {
+            NameComponent nameComponent = name[i];
+            ctx = NamingContextExtHelper.narrow(ctx.bind_new_context(new NameComponent[] {nameComponent}));
+        }
+        ctx.rebind(ctx.to_name("plan"), rootNamingContext);
+    }
+
+    private static void recursiveDelete(File root) {
+        if (root == null) {
+            return;
+        }
+
+        if (root.isDirectory()) {
+            File[] files = root.listFiles();
+            if (files != null) {
+                for (int i = 0; i < files.length; i++) {
+                    File file = files[i];
+                    if (file.isDirectory()) {
+                        recursiveDelete(file);
+                    } else {
+                        file.delete();
+                    }
+                }
+            }
+        }
+        root.delete();
+    }
+}

Propchange: incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/test/java/org/apache/openejb/sunorb/SunNameServiceTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/test/java/org/apache/openejb/sunorb/SunNameServiceTest.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: incubator/openejb/trunk/openejb2/modules/openejb-sunorb/src/test/java/org/apache/openejb/sunorb/SunNameServiceTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/openejb/trunk/openejb2/modules/openejb-yoko/pom.xml
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb2/modules/openejb-yoko/pom.xml?view=auto&rev=452600
==============================================================================
--- incubator/openejb/trunk/openejb2/modules/openejb-yoko/pom.xml (added)
+++ incubator/openejb/trunk/openejb2/modules/openejb-yoko/pom.xml Tue Oct  3 12:29:42 2006
@@ -0,0 +1,145 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!-- $Revision$ $Date$ -->
+
+<project>
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.openejb</groupId>
+        <artifactId>modules</artifactId>
+        <version>2.2-incubating-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <name>OpenEJB CORBA:: Yoko</name>
+    <artifactId>openejb-yoko</artifactId>
+    <description>OpenEJB Yoko ORB adapter</description>
+    <url>http://www.openejb.org</url>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.openejb</groupId>
+            <artifactId>openejb-core</artifactId>
+            <version>${pom.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.openejb</groupId>
+            <artifactId>openejb-builder</artifactId>
+            <version>${pom.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-util</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-core</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-management</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-kernel</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-security</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-system</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-common</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging-api</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.yoko</groupId>
+            <artifactId>yoko-core</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.yoko</groupId>
+            <artifactId>yoko-spec-corba</artifactId>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <resources>
+            <resource>
+                <directory>src/resources2</directory>
+            </resource>
+        </resources>
+        <plugins>
+            <plugin>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>1.4</source>
+                    <target>1.4</target>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <configuration>
+                    <systemProperties>
+                      <property>
+                        <name>java.endorsed.dirs</name>
+                        <value>${basedir}/target/endorsed</value>
+                      </property>
+                    </systemProperties>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>dependency-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                      <phase>generate-sources</phase>
+                      <goals>
+                        <goal>copy</goal>
+                      </goals>
+                      <configuration>
+                        <artifactItems>
+                          <artifactItem>
+                            <groupId>org.apache.yoko</groupId>
+                            <artifactId>yoko-spec-corba</artifactId>
+                            <type>jar</type>
+                            <outputDirectory>${project.build.directory}/endorsed</outputDirectory>
+                          </artifactItem>
+                          <artifactItem>
+                            <groupId>org.apache.yoko</groupId>
+                            <artifactId>yoko-core</artifactId>
+                            <type>jar</type>
+                            <outputDirectory>${project.build.directory}/endorsed</outputDirectory>
+                          </artifactItem>
+                        </artifactItems>
+                      </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>

Propchange: incubator/openejb/trunk/openejb2/modules/openejb-yoko/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/openejb/trunk/openejb2/modules/openejb-yoko/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: incubator/openejb/trunk/openejb2/modules/openejb-yoko/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml



Mime
View raw message