geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r1400355 - in /geronimo/server/branches/3.0/plugins/corba: geronimo-corba/src/main/java/org/apache/geronimo/corba/ geronimo-corba/src/main/java/org/apache/geronimo/corba/security/config/ geronimo-yoko/src/main/java/org/apache/geronimo/yoko/...
Date Sat, 20 Oct 2012 02:26:44 GMT
Author: gawor
Date: Sat Oct 20 02:26:44 2012
New Revision: 1400355

URL: http://svn.apache.org/viewvc?rev=1400355&view=rev
Log:
GERONIMO-6390: Control the additional COS naming service port

Modified:
    geronimo/server/branches/3.0/plugins/corba/geronimo-corba/src/main/java/org/apache/geronimo/corba/NameService.java
    geronimo/server/branches/3.0/plugins/corba/geronimo-corba/src/main/java/org/apache/geronimo/corba/NameServiceGBean.java
    geronimo/server/branches/3.0/plugins/corba/geronimo-corba/src/main/java/org/apache/geronimo/corba/security/config/ConfigAdapter.java
    geronimo/server/branches/3.0/plugins/corba/geronimo-yoko/src/main/java/org/apache/geronimo/yoko/ORBConfigAdapter.java
    geronimo/server/branches/3.0/plugins/corba/j2ee-corba-yoko/pom.xml

Modified: geronimo/server/branches/3.0/plugins/corba/geronimo-corba/src/main/java/org/apache/geronimo/corba/NameService.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0/plugins/corba/geronimo-corba/src/main/java/org/apache/geronimo/corba/NameService.java?rev=1400355&r1=1400354&r2=1400355&view=diff
==============================================================================
--- geronimo/server/branches/3.0/plugins/corba/geronimo-corba/src/main/java/org/apache/geronimo/corba/NameService.java
(original)
+++ geronimo/server/branches/3.0/plugins/corba/geronimo-corba/src/main/java/org/apache/geronimo/corba/NameService.java
Sat Oct 20 02:26:44 2012
@@ -47,6 +47,8 @@ public class NameService implements GBea
     private Object service;
     // the name service listening port
     private final int port;
+    // the name service port
+    private final int servicePort;
     // the published port name (defaults to "localhost").
     private String host;
     // indicates whether we start and host this server locally.
@@ -56,10 +58,15 @@ public class NameService implements GBea
         service = null;
         config = null;
         port = -1;
+        servicePort = 0;
         host = "localhost";
         localServer = true;
     }
 
+    public NameService(ServerInfo serverInfo, ConfigAdapter config, String host, int port)
throws Exception {
+        this(serverInfo, config, host, port, 0);
+    }
+    
     /**
      * GBean constructor to create a NameService instance.
      *
@@ -73,10 +80,11 @@ public class NameService implements GBea
      *
      * @exception Exception
      */
-    public NameService(ServerInfo serverInfo, ConfigAdapter config, String host, int port)
throws Exception {
+    public NameService(ServerInfo serverInfo, ConfigAdapter config, String host, int port,
int servicePort) throws Exception {
         this.host = host;
         this.port = port;
         this.config = config;
+        this.servicePort = servicePort;
         localServer = true;
         service = null;
         // if not specified, our default host is "localhost".
@@ -161,7 +169,7 @@ public class NameService implements GBea
     public void doStart() throws Exception {
         if (localServer) {
             try {
-                service = config.createNameService(host, port);
+                service = config.createNameService(host, port, servicePort);
                 log.debug("Started transient CORBA name service on port " + port);
             } catch (NoSuchMethodError e) {
                 log.error("Incorrect level of org.omg.CORBA classes found.\nLikely cause
is an incorrect java.endorsed.dirs configuration"); 

Modified: geronimo/server/branches/3.0/plugins/corba/geronimo-corba/src/main/java/org/apache/geronimo/corba/NameServiceGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0/plugins/corba/geronimo-corba/src/main/java/org/apache/geronimo/corba/NameServiceGBean.java?rev=1400355&r1=1400354&r2=1400355&view=diff
==============================================================================
--- geronimo/server/branches/3.0/plugins/corba/geronimo-corba/src/main/java/org/apache/geronimo/corba/NameServiceGBean.java
(original)
+++ geronimo/server/branches/3.0/plugins/corba/geronimo-corba/src/main/java/org/apache/geronimo/corba/NameServiceGBean.java
Sat Oct 20 02:26:44 2012
@@ -39,9 +39,10 @@ public final class NameServiceGBean {
         infoFactory.addReference("ConfigAdapter", ConfigAdapter.class, NameFactory.ORB_CONFIG);
         infoFactory.addAttribute("host", String.class, true);
         infoFactory.addAttribute("port", int.class, true);
+        infoFactory.addAttribute("servicePort", int.class, true);
         infoFactory.addAttribute("address", InetSocketAddress.class, false);
         infoFactory.addAttribute("local", boolean.class, true);
-        infoFactory.setConstructor(new String[]{"ServerInfo", "ConfigAdapter", "host", "port"});
+        infoFactory.setConstructor(new String[]{"ServerInfo", "ConfigAdapter", "host", "port",
"servicePort"});
 
         GBEAN_INFO = infoFactory.getBeanInfo();
     }

Modified: geronimo/server/branches/3.0/plugins/corba/geronimo-corba/src/main/java/org/apache/geronimo/corba/security/config/ConfigAdapter.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0/plugins/corba/geronimo-corba/src/main/java/org/apache/geronimo/corba/security/config/ConfigAdapter.java?rev=1400355&r1=1400354&r2=1400355&view=diff
==============================================================================
--- geronimo/server/branches/3.0/plugins/corba/geronimo-corba/src/main/java/org/apache/geronimo/corba/security/config/ConfigAdapter.java
(original)
+++ geronimo/server/branches/3.0/plugins/corba/geronimo-corba/src/main/java/org/apache/geronimo/corba/security/config/ConfigAdapter.java
Sat Oct 20 02:26:44 2012
@@ -62,13 +62,15 @@ public interface ConfigAdapter {
      * 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.
+     * @param host        The String host name.
+     * @param port        The port number of the listener.
+     * @param servicePort The port number of the service. 
      *
      * @return An opaque object that represents the name service.
      * @exception ConfigException
      */
-    public Object createNameService(String host, int port) throws ConfigException;
+    public Object createNameService(String host, int port, int servicePort) throws ConfigException;
+    
     /**
      * Destroy a name service instance created by a
      * prior call to createNameService().

Modified: geronimo/server/branches/3.0/plugins/corba/geronimo-yoko/src/main/java/org/apache/geronimo/yoko/ORBConfigAdapter.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0/plugins/corba/geronimo-yoko/src/main/java/org/apache/geronimo/yoko/ORBConfigAdapter.java?rev=1400355&r1=1400354&r2=1400355&view=diff
==============================================================================
--- geronimo/server/branches/3.0/plugins/corba/geronimo-yoko/src/main/java/org/apache/geronimo/yoko/ORBConfigAdapter.java
(original)
+++ geronimo/server/branches/3.0/plugins/corba/geronimo-yoko/src/main/java/org/apache/geronimo/yoko/ORBConfigAdapter.java
Sat Oct 20 02:26:44 2012
@@ -16,13 +16,11 @@
   */
 package org.apache.geronimo.yoko;
 
-import java.lang.reflect.Method;
 import java.util.ArrayList;
 import java.util.Enumeration;
 import java.util.List;
 import java.util.Properties;
 
-import javax.rmi.CORBA.UtilDelegate;
 import org.apache.geronimo.corba.CORBABean;
 import org.apache.geronimo.corba.CSSBean;
 import org.apache.geronimo.corba.NameService;
@@ -32,7 +30,6 @@ import org.apache.geronimo.corba.securit
 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.corba.util.UtilDelegateImpl;
 import org.apache.geronimo.gbean.annotation.GBean;
 import org.apache.geronimo.gbean.annotation.ParamSpecial;
 import org.apache.geronimo.gbean.annotation.SpecialAttributeType;
@@ -157,13 +154,14 @@ public class ORBConfigAdapter implements
      * 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.
+     * @param host        The String host name.
+     * @param port        The port number of the listener.
+     * @param servicePort The port number of the service. 
      *
      * @return An opaque object that represents the name service.
      * @exception ConfigException
      */
-    public Object createNameService(String host, int port) throws ConfigException {
+    public Object createNameService(String host, int port, final int servicePort) throws
ConfigException {
         try {
             // create a name service using the supplied host and publish under the name "NameService"
             TransientNameService service = new TransientNameService(host, port, "NameService")
{
@@ -175,7 +173,12 @@ public class ORBConfigAdapter implements
                     props.put("org.omg.CORBA.ORBServerId", "1000000" ) ;
                     props.put("org.omg.CORBA.ORBClass", "org.apache.yoko.orb.CORBA.ORB");
                     props.put("org.omg.CORBA.ORBSingletonClass", "org.apache.yoko.orb.CORBA.ORBSingleton");
-                    props.put("yoko.orb.oa.endpoint", "iiop --bind " + host  + " --host "
+ host + " --port " + port );
+                    props.put("yoko.orb.oa.endpoint", "iiop --bind " + host  + " --host "
+ host + " --port " + port);
+                    String nameServiceEndpoint = "iiop --bind " + host + " --host " + host;
+                    if (servicePort > 0) {
+                        nameServiceEndpoint += " --port " + servicePort;
+                    }
+                    props.put("yoko.orb.poamanager.TNameService.endpoint", nameServiceEndpoint);
 
                     createdOrb = ORB.init((String[])null, props) ;
 

Modified: geronimo/server/branches/3.0/plugins/corba/j2ee-corba-yoko/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0/plugins/corba/j2ee-corba-yoko/pom.xml?rev=1400355&r1=1400354&r2=1400355&view=diff
==============================================================================
--- geronimo/server/branches/3.0/plugins/corba/j2ee-corba-yoko/pom.xml (original)
+++ geronimo/server/branches/3.0/plugins/corba/j2ee-corba-yoko/pom.xml Sat Oct 20 02:26:44
2012
@@ -118,6 +118,7 @@
                                 <gbean name="NameServer">
                                     <attribute name="port">#{COSNamingPort + PortOffset}</attribute>
                                     <attribute name="host">#{ServerHostname}</attribute>
+                                    <attribute name="servicePort">#{COSNamingServicePort
+ PortOffset}</attribute>
                                 </gbean>
                                 <gbean name="Server">
                                     <attribute name="port">#{ORBSSLPort + PortOffset}</attribute>
@@ -129,6 +130,7 @@
                                 </gbean>
                              </config-xml-content>
                             <config-substitution key="COSNamingPort">1050</config-substitution>
+                            <config-substitution key="COSNamingServicePort">1055</config-substitution>
                             <config-substitution key="ORBSSLPort">2001</config-substitution>
                             <config-substitution key="ORBPort">6882</config-substitution>
                         </plugin-artifact>



Mime
View raw message