You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by co...@apache.org on 2002/02/06 18:32:19 UTC

cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/jk/core Channel.java

costin      02/02/06 09:32:19

  Modified:    jk/java/org/apache/jk/core Channel.java
  Log:
  Channel is just a handler ( the first in the chain ).
  
  Note that at this moment the invoke command hardcodes the 'next' handler,
  but that can be overriden ( it's just a default ).
  
  The handler named 'dispatch' will be called ( if exists ), or 'request'.
  A third handler 'container' is the default next for 'request'.
  Again, similar ( but simpler ) with axis ( the idea of chains and
  message paths )
  
  XXX should we call it Transport ?
  
  Revision  Changes    Path
  1.4       +19 -19    jakarta-tomcat-connectors/jk/java/org/apache/jk/core/Channel.java
  
  Index: Channel.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/jk/core/Channel.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Channel.java	26 Jan 2002 07:21:02 -0000	1.3
  +++ Channel.java	6 Feb 2002 17:32:19 -0000	1.4
  @@ -81,28 +81,15 @@
    * @author Kevin Seguin
    * @author Costin Manolache
    */
  -public abstract class Channel {
  -    protected WorkerEnv we;
  -    protected Worker worker;
  +public abstract class Channel extends JkHandler {
   
  -    public void setWorkerEnv( WorkerEnv we ) {
  -        this.we=we;
  -    }
  -    
  -    public void setWorker(Worker worker) {
  -        this.worker=worker;
  -    }
  -
  -    public void init() throws IOException {
  -    }
  -            
       /** This method is used to receive messages. It shouldn't
        *  be exposed, as most processing is driven by sending
        *   messages and dispatching on incoming messages. The
        *   only current use is the aberant post packet after
        *   the first request, which doesn't fit anything.
        */
  -    public abstract int receive( Msg msg, Endpoint ep )
  +    public abstract int receive( Msg msg, MsgContext ep )
           throws IOException;
   
       /**
  @@ -111,10 +98,23 @@
        * @param msg A packet with accumulated data to send to the server --
        * this method will write out the length in the header.  
        */
  -    public abstract int send( Msg msg, Endpoint ep )
  +    public abstract int send( Msg msg, MsgContext ep )
           throws IOException;
   
  -
  -    
  -
  +    public int invoke( Msg msg, MsgContext mc ) throws IOException {
  +        if( next==null ) {
  +            if( nextName!=null ) 
  +                setNext( wEnv.getHandler( nextName ) );
  +            if( next==null )
  +                next=wEnv.getHandler( "dispatch" );
  +            if( next==null )
  +                next=wEnv.getHandler( "request" );
  +            log("Setting default next " + next.getClass().getName());
  +        }
  +
  +        if(logL >0 )
  +            log("Calling next " + next.getName() + " " +
  +                next.getClass().getName());
  +        return next.invoke(msg, mc );
  +    }
   }
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>