User: starksm 
  Date: 01/05/30 08:54:41

  Modified:    src/main/org/jboss/naming Tag: Branch_2_2 NamingService.java
  Log:
  Added support for setting the RMI client and server socket factories that
  are used by the jnp provider.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.6.2.2   +30 -13    jboss/src/main/org/jboss/naming/NamingService.java
  
  Index: NamingService.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/naming/NamingService.java,v
  retrieving revision 1.6.2.1
  retrieving revision 1.6.2.2
  diff -u -r1.6.2.1 -r1.6.2.2
  --- NamingService.java        2001/05/24 16:15:51     1.6.2.1
  +++ NamingService.java        2001/05/30 15:54:41     1.6.2.2
  @@ -14,13 +14,11 @@
   import org.jboss.logging.Log;
   import org.jboss.util.ServiceMBeanSupport;
   
  -/**
  - *   <description> 
  +/** A JBoss service that starts the jnp JNDI server.
    *      
  - *   @see <related>
    *   @author Rickard �berg ([EMAIL PROTECTED])
    *   @author [EMAIL PROTECTED]
  - *   @version $Revision: 1.6.2.1 $
  + *   @version $Revision: 1.6.2.2 $
    */
   public class NamingService
      extends ServiceMBeanSupport
  @@ -59,7 +57,27 @@
      {
         return naming.getRmiPort();
      }
  -   
  +
  +    public String getClientSocketFactory()
  +    {
  +        return naming.getClientSocketFactory();
  +    }
  +    public void setClientSocketFactory(String factoryClassName)
  +        throws ClassNotFoundException, InstantiationException, 
IllegalAccessException
  +    {
  +        naming.setClientSocketFactory(factoryClassName);
  +    }
  +
  +    public String getServerSocketFactory()
  +    {
  +        return naming.getServerSocketFactory();
  +    }
  +    public void setServerSocketFactory(String factoryClassName)
  +        throws ClassNotFoundException, InstantiationException, 
IllegalAccessException
  +    {
  +        naming.setServerSocketFactory(factoryClassName);
  +    }
  +
      public ObjectName getObjectName(MBeanServer server, ObjectName name)
         throws javax.management.MalformedObjectNameException
      {
  @@ -70,7 +88,7 @@
      {
         return "Naming";
      }
  -   
  +
      public void initService()
         throws Exception
      {
  @@ -78,21 +96,20 @@
         // RO: this is necessary because some components (=Tomcat servlets) use a 
         // buggy classloader that disallows finding the resource properly
         
System.getProperties().load(Thread.currentThread().getContextClassLoader().getResourceAsStream("jndi.properties"));
  -   
  -      // Create "java:comp/env"
  -      RefAddr refAddr = new StringRefAddr("nns", "ENC");
  -      Reference envRef = new Reference("javax.naming.Context", refAddr, 
ENCFactory.class.getName(), null);
  -      Context ctx = (Context)new InitialContext().lookup("java:");
  -      ctx.rebind("comp", envRef);
      }
      
      public void startService()
         throws Exception
      {
         naming.start();
  +      // Create "java:comp/env"
  +      RefAddr refAddr = new StringRefAddr("nns", "ENC");
  +      Reference envRef = new Reference("javax.naming.Context", refAddr, 
ENCFactory.class.getName(), null);
  +      Context ctx = (Context)new InitialContext().lookup("java:");
  +      ctx.rebind("comp", envRef);
         log.log("Naming started on port "+naming.getPort());
      }
  -      
  +
      public void stopService()
      {
         naming.stop();
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to