proyal      2002/08/02 06:55:49

  Modified:    src/java/org/apache/avalon/phoenix/components/manager
                        MX4JSystemManager.java
  Log:
  Set naming factory which is needed for RMI Adaptor
  
  Revision  Changes    Path
  1.16      +10 -0     
jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/manager/MX4JSystemManager.java
  
  Index: MX4JSystemManager.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/manager/MX4JSystemManager.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- MX4JSystemManager.java    1 Aug 2002 04:31:08 -0000       1.15
  +++ MX4JSystemManager.java    2 Aug 2002 13:55:49 -0000       1.16
  @@ -32,12 +32,15 @@
       extends AbstractJMXManager
       implements Contextualizable, Configurable
   {
  +    private static final String DEFAULT_NAMING_FACTORY =
  +        "com.sun.jndi.rmi.registry.RegistryContextFactory";
       private static final int DEFAULT_HTTPADAPTER_PORT =
           Integer.getInteger( "phoenix.adapter.http", 8082 ).intValue();
       private int m_port;
       private boolean m_rmi;
       private File m_homeDir;
       private String m_stylesheetDir;
  +    private String m_namingFactory;
   
       public void contextualize( Context context )
           throws ContextException
  @@ -50,7 +53,12 @@
       {
           m_port = configuration.getChild( "manager-adaptor-port" ).
               getValueAsInteger( DEFAULT_HTTPADAPTER_PORT );
  +
           m_rmi = configuration.getChild( "enable-rmi-adaptor" ).getValueAsBoolean( 
false );
  +
  +        m_namingFactory =
  +            configuration.getChild( "rmi-naming-factory" ).getValue( 
DEFAULT_NAMING_FACTORY );
  +
           final String stylesheets =
               configuration.getChild( "stylesheets-dir" ).getValue( null );
           if( null != stylesheets )
  @@ -106,6 +114,8 @@
   
       private void startRMIAdaptor( MBeanServer server ) throws Exception
       {
  +        System.setProperty( "java.naming.factory.initial", m_namingFactory );
  +
           // Create and start the naming service
           ObjectName naming = new ObjectName( "Naming:type=rmiregistry" );
           server.createMBean( "mx4j.tools.naming.NamingService", naming, null );
  
  
  

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

Reply via email to