donaldp     2003/06/05 19:55:34

  Modified:    src/java/org/apache/avalon/phoenix/components/manager
                        MX4JSystemManager.java
  Log:
  The patch lets you pick the port that the RMI registry MX4J starts is on
  when using the RMI adaptor. If you don't pick one it defaults to 1099. To
  specify the port add <rmi-registry-port>1098</rmi-registry-port> in the
  SystemManager section of kernel.xml.
  
  Submitted by: "TULK, Daniel, FM" <[EMAIL PROTECTED]>
  
  Revision  Changes    Path
  1.34      +14 -3     
avalon-phoenix/src/java/org/apache/avalon/phoenix/components/manager/MX4JSystemManager.java
  
  Index: MX4JSystemManager.java
  ===================================================================
  RCS file: 
/home/cvs/avalon-phoenix/src/java/org/apache/avalon/phoenix/components/manager/MX4JSystemManager.java,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- MX4JSystemManager.java    4 Jun 2003 22:10:43 -0000       1.33
  +++ MX4JSystemManager.java    6 Jun 2003 02:55:34 -0000       1.34
  @@ -89,12 +89,15 @@
       private static final String DEFAULT_NAMING_FACTORY =
           "com.sun.jndi.rmi.profile.RegistryContextFactory";
       private static final String DEFAULT_HTTPADAPTER_HOST = "localhost";
  -    private static final int DEFAULT_HTTPADAPTER_PORT =
  -        Integer.getInteger( "phoenix.adapter.http", 8082 ).intValue();
  +     private static final int DEFAULT_HTTPADAPTER_PORT =
  +             Integer.getInteger( "phoenix.adapter.http", 8082 ).intValue();
  +     private static final int DEFAULT_RMIREGISTRY_PORT =
  +             Integer.getInteger( "phoenix.rmiregistry.port", 1099 ).intValue();
   
       private String m_host;
       private int m_port;
       private boolean m_rmi;
  +    private int m_rmi_registry_port;
       private File m_homeDir;
       private String m_stylesheetDir;
       private String m_namingFactory;
  @@ -125,6 +128,7 @@
           getLogger().debug( "MX4J HTTP listener port: " + m_port );
   
           m_rmi = configuration.getChild( "enable-rmi-adaptor" ).getValueAsBoolean( 
false );
  +        m_rmi_registry_port = 
configuration.getChild("rmi-registry-port").getValueAsInteger(DEFAULT_RMIREGISTRY_PORT);
           m_http = configuration.getChild( "enable-http-adaptor" ).getValueAsBoolean( 
false );
   
           m_namingFactory =
  @@ -241,7 +245,12 @@
       {
           // Create and start the naming service
           final ObjectName naming = new ObjectName( "Naming:type=rmiregistry" );
  -        server.createMBean( "mx4j.tools.naming.NamingService", naming, null );
  +        server.createMBean(  "mx4j.tools.naming.NamingService", 
  +                                             naming,
  +                                             null, 
  +                                             new Object[] {new 
Integer(m_rmi_registry_port)}, 
  +                                             new String[] {"int"}
  +                                             );
           server.invoke( naming, "start", null, null );
   
           // Create the JRMP adaptor
  @@ -256,6 +265,8 @@
   
           mbean.putJNDIProperty( javax.naming.Context.INITIAL_CONTEXT_FACTORY,
                                  m_namingFactory );
  +             mbean.putJNDIProperty(javax.naming.Context.PROVIDER_URL, 
"rmi://localhost:" + m_rmi_registry_port);
  +
           // Register the JRMP adaptor in JNDI and start it
           mbean.start();
       }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to