User: chirino 
  Date: 02/03/08 22:11:47

  Modified:    src/main/org/jboss/mq/il/uil UILClientILService.java
                        UILServerIL.java UILServerILFactory.java
                        UILServerILService.java
                        UILServerILServiceMBean.java
  Log:
  Added a EnableTcpNoDelay option to the UIL and OIL mbeans.
  
  Revision  Changes    Path
  1.6       +2 -2      jbossmq/src/main/org/jboss/mq/il/uil/UILClientILService.java
  
  Index: UILClientILService.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jbossmq/src/main/org/jboss/mq/il/uil/UILClientILService.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- UILClientILService.java   14 Dec 2001 00:22:30 -0000      1.5
  +++ UILClientILService.java   9 Mar 2002 06:11:47 -0000       1.6
  @@ -29,7 +29,7 @@
    *
    * @author    Norbert Lataille ([EMAIL PROTECTED])
    * @author    Hiram Chirino ([EMAIL PROTECTED])
  - * @version   $Revision: 1.5 $
  + * @version   $Revision: 1.6 $
    * @created   August 16, 2001
    */
   public class UILClientILService implements Runnable, org.jboss.mq.il.ClientILService
  @@ -48,7 +48,7 @@
      //A link on my connection
      private Connection connection;
      //Should this service be running ?
  -   private boolean running;
  +   private boolean running;   
   
      /**
       * getClientIL method comment.
  
  
  
  1.8       +10 -2     jbossmq/src/main/org/jboss/mq/il/uil/UILServerIL.java
  
  Index: UILServerIL.java
  ===================================================================
  RCS file: /cvsroot/jboss/jbossmq/src/main/org/jboss/mq/il/uil/UILServerIL.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- UILServerIL.java  6 Mar 2002 17:27:50 -0000       1.7
  +++ UILServerIL.java  9 Mar 2002 06:11:47 -0000       1.8
  @@ -37,7 +37,7 @@
    * @author    Hiram Chirino ([EMAIL PROTECTED])
    * @author    Norbert Lataille ([EMAIL PROTECTED])
    * @author    <a href="[EMAIL PROTECTED]">Peter Antman</a>
  - * @version   $Revision: 1.7 $
  + * @version   $Revision: 1.8 $
    * @created   August 16, 2001
    */
   public class UILServerIL implements java.io.Serializable, Cloneable, 
org.jboss.mq.il.ServerIL
  @@ -90,6 +90,12 @@
       * Description of the Field
       */
      protected int port;
  +   
  +   /**
  +    * If the TcpNoDelay option should be used on the socket.
  +    */
  +   private boolean enableTcpNoDelay=false;   
  +   
   
      /**
       * Constructor for the UILServerIL object
  @@ -97,10 +103,11 @@
       * @param a     Description of Parameter
       * @param port  Description of Parameter
       */
  -   public UILServerIL(InetAddress a, int port)
  +   public UILServerIL(InetAddress a, int port, boolean enableTcpNoDelay)
      {
         this.addr = a;
         this.port = port;
  +      this.enableTcpNoDelay = enableTcpNoDelay;
      }
   
      /**
  @@ -507,6 +514,7 @@
             throws Exception
      {
         socket = new Socket(addr, port);
  +      socket.setTcpNoDelay(enableTcpNoDelay);
         mSocket = new SocketMultiplexor(socket);
         out = new ObjectOutputStream(new 
BufferedOutputStream(mSocket.getOutputStream(1)));
         out.flush();
  
  
  
  1.2       +10 -3     jbossmq/src/main/org/jboss/mq/il/uil/UILServerILFactory.java
  
  Index: UILServerILFactory.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jbossmq/src/main/org/jboss/mq/il/uil/UILServerILFactory.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- UILServerILFactory.java   21 Oct 2001 05:38:13 -0000      1.1
  +++ UILServerILFactory.java   9 Mar 2002 06:11:47 -0000       1.2
  @@ -16,7 +16,7 @@
    * Factory class to produce UILServerIL objects.
    *
    * @author    <a href="mailto:[EMAIL PROTECTED]";>Hiram Chirino</a>
  - * @version   $Revision: 1.1 $
  + * @version   $Revision: 1.2 $
    */
   public class UILServerILFactory implements ServerILFactory {
   
  @@ -24,7 +24,8 @@
      final public static String CLIENT_IL_SERVICE = 
UILClientILService.class.getName();  
      final public static String UIL_ADDRESS_KEY = "UIL_ADDRESS_KEY";
      final public static String UIL_PORT_KEY = "UIL_PORT_KEY";
  -
  +   final public static String UIL_TCPNODELAY_KEY = "UIL_TCPNODELAY_KEY";
  +   
      private ServerIL serverIL;
   
      /**
  @@ -41,8 +42,14 @@
         if (t == null)
            throw new javax.jms.JMSException("A required connection property was not 
set: " + UIL_PORT_KEY);
         int port = Integer.parseInt(t);
  +      
  +      boolean enableTcpNoDelay=false;
  +      t = props.getProperty(UIL_TCPNODELAY_KEY);
  +      if (t != null) 
  +         enableTcpNoDelay = t.equals("yes");
  +      
   
  -      serverIL = new UILServerIL(address, port);
  +      serverIL = new UILServerIL(address, port, enableTcpNoDelay);
   
      }
   
  
  
  
  1.19      +39 -5     jbossmq/src/main/org/jboss/mq/il/uil/UILServerILService.java
  
  Index: UILServerILService.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jbossmq/src/main/org/jboss/mq/il/uil/UILServerILService.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- UILServerILService.java   6 Mar 2002 17:27:50 -0000       1.18
  +++ UILServerILService.java   9 Mar 2002 06:11:47 -0000       1.19
  @@ -47,7 +47,7 @@
    *
    * @author    Hiram Chirino ([EMAIL PROTECTED])
    * @author    <a href="[EMAIL PROTECTED]">Peter Antman</a>
  - * @version   $Revision: 1.18 $
  + * @version   $Revision: 1.19 $
    */
   public class UILServerILService extends org.jboss.mq.il.ServerILJMXService 
implements Runnable, UILServerILServiceMBean
   {
  @@ -94,9 +94,20 @@
      Thread worker;
      
      /**
  +    * If the TcpNoDelay option should be used on the socket.
  +    */
  +   private boolean enableTcpNoDelay=false;   
  +   
  +   /**
       * Number of OIL Worker threads started.
       */
      private int threadNumber = 0;
  +   
  +   /**
  +    * The connection properties passed to the client to connect to this IL
  +    */
  +   private Properties connectionProperties;
  +   
      /**
       * Used to construct the GenericConnectionFactory (bindJNDIReferences()
       * builds it) Sets up the connection properties need by a client to use this
  @@ -106,9 +117,7 @@
       */
      public java.util.Properties getClientConnectionProperties()
      {
  -      Properties rc = super.getClientConnectionProperties();
  -      rc.setProperty(ServerILFactory.CLIENT_IL_SERVICE_KEY, 
"org.jboss.mq.il.uil.UILClientILService");
  -      return rc;
  +      return connectionProperties;
      }
   
      /**
  @@ -166,6 +175,7 @@
            }
   
            socket.setSoTimeout(0);
  +         socket.setTcpNoDelay(enableTcpNoDelay);
            new Thread(this, "UIL Worker-"+threadNumber++).start();
   
            mSocket = new SocketMultiplexor(socket);
  @@ -404,7 +414,14 @@
         */
         if( socketAddress.toString().equals("0.0.0.0/0.0.0.0") )
            socketAddress = InetAddress.getLocalHost();
  -      serverIL = new UILServerIL(socketAddress, serverSocket.getLocalPort());
  +      serverIL = new UILServerIL(socketAddress, serverSocket.getLocalPort(), 
enableTcpNoDelay);
  +
  +      // Initialize the connection poperties using the base class.
  +      connectionProperties = super.getClientConnectionProperties();
  +      connectionProperties.setProperty(UILServerILFactory.CLIENT_IL_SERVICE_KEY, 
"org.jboss.mq.il.uil.UILClientILService");
  +      connectionProperties.setProperty(UILServerILFactory.UIL_PORT_KEY, 
""+serverSocket.getLocalPort());
  +      connectionProperties.setProperty(UILServerILFactory.UIL_ADDRESS_KEY, 
""+socketAddress.getHostAddress());
  +      connectionProperties.setProperty(UILServerILFactory.UIL_TCPNODELAY_KEY, 
enableTcpNoDelay?"yes":"no");
   
         bindJNDIReferences();
   
  @@ -458,6 +475,23 @@
            bindAddress = null;
         else
            bindAddress = InetAddress.getByName(host);
  +   }
  +   /**
  +    * Gets the enableTcpNoDelay.
  +    * @return Returns a boolean
  +    */
  +   public boolean getEnableTcpNoDelay()
  +   {
  +      return enableTcpNoDelay;
  +   }
  +
  +   /**
  +    * Sets the enableTcpNoDelay.
  +    * @param enableTcpNoDelay The enableTcpNoDelay to set
  +    */
  +   public void setEnableTcpNoDelay(boolean enableTcpNoDelay)
  +   {
  +      this.enableTcpNoDelay = enableTcpNoDelay;
      }
   
   }
  
  
  
  1.5       +11 -0     
jbossmq/src/main/org/jboss/mq/il/uil/UILServerILServiceMBean.java
  
  Index: UILServerILServiceMBean.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jbossmq/src/main/org/jboss/mq/il/uil/UILServerILServiceMBean.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- UILServerILServiceMBean.java      30 Sep 2001 00:53:16 -0000      1.4
  +++ UILServerILServiceMBean.java      9 Mar 2002 06:11:47 -0000       1.5
  @@ -25,4 +25,15 @@
      public String getBindAddress();
      /** Set the interface address the UIL server bind its listening port on */
      public void setBindAddress(String host) throws UnknownHostException;
  +   
  +   /**
  +    * Gets the disableTPCNODELAY.
  +    * @return Returns a boolean
  +    */
  +   public boolean getEnableTcpNoDelay();
  +   /**
  +    * Sets the disableTPCNODELAY.
  +    * @param disableTPCNODELAY The disableTPCNODELAY to set
  +    */
  +   public void setEnableTcpNoDelay(boolean disableTPCNODELAY);   
   }
  
  
  

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

Reply via email to