costin      02/04/30 10:44:50

  Modified:    jk/java/org/apache/jk/common Shm.java
  Log:
  Use the WRITE_SLOT command.
  
  Again, the idea is that the scoreboard is divided in 'slots', each slot
  has a name ( identifying the 'owner' ).
  
  We'll use the scoreboard for configuration ( at first ), with a
  java bean ( used either individually or at tomcat startup ) writing
  information in the scoreboard about a tomcat instance.
  
  The lb worker will read the 'serial' number in the scoreboard header
  and update it's instance table based on the content.
  
  The synchronization is not implemented yet - if 2 tomcats
  are registered at the exact same time we may get unexpected results
  ( a bit unlikely, will be fixed after we 'bridge' the APR locks ).
  
  Revision  Changes    Path
  1.7       +8 -5      jakarta-tomcat-connectors/jk/java/org/apache/jk/common/Shm.java
  
  Index: Shm.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/common/Shm.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Shm.java  25 Apr 2002 22:44:23 -0000      1.6
  +++ Shm.java  30 Apr 2002 17:44:50 -0000      1.7
  @@ -85,7 +85,7 @@
   
       // Will be dynamic ( getMethodId() ) after things are stable 
       static final int SHM_SET_ATTRIBUTE=0;
  -    static final int SHM_REGISTER_TOMCAT=2;
  +    static final int SHM_WRITE_SLOT=2;
       static final int SHM_ATTACH=3;
       static final int SHM_DETACH=4;
       
  @@ -142,8 +142,13 @@
           
           this.invoke( msg, mCtx );
       }
  +
  +    public void registerTomcat(String host, int port) throws IOException {
  +        String slotName="TOMCAT:" + host + ":" + port;
  +        writeSlot( slotName );
  +    }
       
  -    public void registerTomcat(String host, int port)
  +    public void writeSlot(String slotName)
           throws IOException
       {
           if( apr==null ) return;
  @@ -151,10 +156,8 @@
           Msg msg=(Msg)mCtx.getMsg(0);
           msg.reset();
           C2BConverter c2b=(C2BConverter)mCtx.getNote(C2B_NOTE);
  -
  -        String slotName="TOMCAT:" + host + ":" + port;
           
  -        msg.appendByte( SHM_REGISTER_TOMCAT );
  +        msg.appendByte( SHM_WRITE_SLOT );
           appendString( msg, slotName, c2b );
   
           this.invoke( msg, mCtx );
  
  
  

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

Reply via email to