Return-Path: Delivered-To: apmail-geronimo-scm-archive@www.apache.org Received: (qmail 48237 invoked from network); 14 Feb 2007 00:34:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Feb 2007 00:34:44 -0000 Received: (qmail 10007 invoked by uid 500); 14 Feb 2007 00:34:51 -0000 Delivered-To: apmail-geronimo-scm-archive@geronimo.apache.org Received: (qmail 9962 invoked by uid 500); 14 Feb 2007 00:34:51 -0000 Mailing-List: contact scm-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list scm@geronimo.apache.org Received: (qmail 9951 invoked by uid 99); 14 Feb 2007 00:34:51 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Feb 2007 16:34:51 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Feb 2007 16:34:43 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id 1775D1A981A; Tue, 13 Feb 2007 16:34:23 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r507336 - in /geronimo/server/trunk/modules/geronimo-yoko: pom.xml src/main/java/org/apache/geronimo/yoko/ORBConfigAdapter.java Date: Wed, 14 Feb 2007 00:34:22 -0000 To: scm@geronimo.apache.org From: djencks@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070214003423.1775D1A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: djencks Date: Tue Feb 13 16:34:22 2007 New Revision: 507336 URL: http://svn.apache.org/viewvc?view=rev&rev=507336 Log: GERONIMO-2382 work harder to get our UtilDelegateImpl registered. Also a little code cleanup Modified: geronimo/server/trunk/modules/geronimo-yoko/pom.xml geronimo/server/trunk/modules/geronimo-yoko/src/main/java/org/apache/geronimo/yoko/ORBConfigAdapter.java Modified: geronimo/server/trunk/modules/geronimo-yoko/pom.xml URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-yoko/pom.xml?view=diff&rev=507336&r1=507335&r2=507336 ============================================================================== --- geronimo/server/trunk/modules/geronimo-yoko/pom.xml (original) +++ geronimo/server/trunk/modules/geronimo-yoko/pom.xml Tue Feb 13 16:34:22 2007 @@ -144,8 +144,8 @@ maven-compiler-plugin - 1.4 - 1.4 + 1.5 + 1.5 ${project.build.directory}/endorsed Modified: geronimo/server/trunk/modules/geronimo-yoko/src/main/java/org/apache/geronimo/yoko/ORBConfigAdapter.java URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-yoko/src/main/java/org/apache/geronimo/yoko/ORBConfigAdapter.java?view=diff&rev=507336&r1=507335&r2=507336 ============================================================================== --- geronimo/server/trunk/modules/geronimo-yoko/src/main/java/org/apache/geronimo/yoko/ORBConfigAdapter.java (original) +++ geronimo/server/trunk/modules/geronimo-yoko/src/main/java/org/apache/geronimo/yoko/ORBConfigAdapter.java Tue Feb 13 16:34:22 2007 @@ -16,19 +16,15 @@ */ package org.apache.geronimo.yoko; +import java.lang.reflect.Method; import java.util.ArrayList; import java.util.Enumeration; import java.util.HashMap; -import java.util.Iterator; import java.util.List; import java.util.Properties; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.apache.geronimo.gbean.GBeanLifecycle; -import org.apache.geronimo.security.deploy.DefaultDomainPrincipal; -import org.apache.geronimo.security.deploy.DefaultPrincipal; -import org.apache.geronimo.security.deploy.DefaultRealmPrincipal; import org.apache.geronimo.corba.CORBABean; import org.apache.geronimo.corba.CSSBean; import org.apache.geronimo.corba.NameService; @@ -38,9 +34,13 @@ import org.apache.geronimo.corba.security.config.tss.TSSConfig; import org.apache.geronimo.corba.security.config.tss.TSSSSLTransportConfig; import org.apache.geronimo.corba.security.config.tss.TSSTransportMechConfig; +import org.apache.geronimo.gbean.GBeanLifecycle; +import org.apache.geronimo.security.deploy.DefaultDomainPrincipal; +import org.apache.geronimo.security.deploy.DefaultPrincipal; +import org.apache.geronimo.security.deploy.DefaultRealmPrincipal; import org.apache.yoko.orb.CosNaming.tnaming.TransientNameService; import org.apache.yoko.orb.CosNaming.tnaming.TransientServiceException; -import org.apache.yoko.orb.OB.ZERO_PORT_POLICY_ID; +import org.apache.yoko.orb.OB.ZERO_PORT_POLICY_ID; import org.omg.CORBA.Any; import org.omg.CORBA.ORB; import org.omg.CORBA.Policy; @@ -88,7 +88,10 @@ // ok, now we have a potential classloading problem because of where our util delegates are located. // by forcing these classes to load now using our class loader, we can ensure things are properly initialized - this.getClass().getClassLoader().loadClass("javax.rmi.PortableRemoteObject"); + Class clazz = this.getClass().getClassLoader().loadClass("javax.rmi.PortableRemoteObject"); + Method m = clazz.getMethod("narrow", Object.class, Class.class); + m.invoke(null, new Object(), Object.class); + log.debug("Started Yoko ORBConfigAdapter"); } @@ -112,7 +115,7 @@ * @exception ConfigException */ public ORB createServerORB(CORBABean server) throws ConfigException { - ORB orb = createORB(server.getURI(), (ORBConfiguration)server, translateToArgs(server), translateToProps(server)); + ORB orb = createORB(server.getURI(), server, translateToArgs(server), translateToProps(server)); // check the tss config for a transport mech definition. If we have one, then // the port information will be passed in that config, and the port in the IIOP profile @@ -147,7 +150,7 @@ * @exception ConfigException */ public ORB createClientORB(CSSBean client) throws ConfigException { - return createORB(client.getURI(), (ORBConfiguration)client, translateToArgs(client), translateToProps(client)); + return createORB(client.getURI(), client, translateToArgs(client), translateToProps(client)); } /** @@ -159,7 +162,7 @@ * @exception ConfigException */ public ORB createNameServiceClientORB(CSSBean client) throws ConfigException { - return createORB(client.getURI(), (ORBConfiguration)client, translateToArgs(client), translateToNameServiceProps(client)); + return createORB(client.getURI(), client, translateToArgs(client), translateToNameServiceProps(client)); } /** @@ -248,10 +251,10 @@ * * @return A String{} array containing the initialization * arguments. - * @exception ConfigException + * @exception ConfigException if configuration cannot be interpreted */ private String[] translateToArgs(CORBABean server) throws ConfigException { - ArrayList list = new ArrayList(); + ArrayList list = new ArrayList(); TSSConfig config = server.getTssConfig(); @@ -283,12 +286,12 @@ } if (log.isDebugEnabled()) { - for (Iterator iter = list.iterator(); iter.hasNext();) { - log.debug(iter.next()); + for (String configArg : list) { + log.debug(configArg); } } - return (String[]) list.toArray(new String[list.size()]); + return list.toArray(new String[list.size()]); } private Properties translateToProps(CORBABean server) throws ConfigException { @@ -336,21 +339,21 @@ * @param client The CSSBean holding the configuration. * * @return A String array to be passed to ORB.init(). - * @exception ConfigException + * @exception ConfigException if configuration cannot be interpreted */ private String[] translateToArgs(CSSBean client) throws ConfigException { - ArrayList list = new ArrayList(); + ArrayList list = new ArrayList(); // enable the connection plugin enableSocketFactory(client.getURI(), list); if (log.isDebugEnabled()) { - for (Iterator iter = list.iterator(); iter.hasNext();) { - log.debug(iter.next()); + for (String configArg : list) { + log.debug(configArg); } } - return (String[]) list.toArray(new String[list.size()]); + return list.toArray(new String[list.size()]); } /** @@ -360,9 +363,9 @@ * * @param uri The URI name of the configuration GBean (either a * CSSBean or a CORBABean). - * @param args + * @param args configuration arguments to add to */ - private void enableSocketFactory(String uri, List args) { + private void enableSocketFactory(String uri, List args) { args.add("-IIOPconnectionHelper"); args.add("org.apache.geronimo.yoko.SocketFactory"); args.add("-IIOPconnectionHelperArgs"); @@ -378,7 +381,7 @@ * @param client The CSSBean holding the configuration. * * @return A property bundle that can be passed to ORB.init(); - * @exception ConfigException + * @exception ConfigException if configuration cannot be interpreted */ private Properties translateToProps(CSSBean client) throws ConfigException { Properties result = new Properties(); @@ -408,7 +411,7 @@ * @param client The CSSBean holding the configuration. * * @return A property bundle that can be passed to ORB.init(); - * @exception ConfigException + * @exception ConfigException if configuration cannot be interpreted */ private Properties translateToNameServiceProps(CSSBean client) throws ConfigException { Properties result = new Properties();