geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject cvs commit: incubator-geronimo/modules/network/src/test/org/apache/geronimo/network/protocol/control ControlProtocolTest.java
Date Wed, 17 Mar 2004 03:12:00 GMT
adc         2004/03/16 19:12:00

  Modified:    modules/network/src/java/org/apache/geronimo/network
                        SelectorManager.java
               modules/network/src/java/org/apache/geronimo/network/protocol
                        AbstractProtocol.java AcceptableProtocolStack.java
                        BufferProtocol.java ChecksumProtocol.java
                        ChunkingProtocol.java CountingProtocol.java
                        DatagramProtocol.java DoNothingProtocol.java
                        GSSAPIClientProtocol.java GSSAPIServerProtocol.java
                        LossyProtocol.java MulticastProtocol.java
                        Protocol.java ProtocolFactory.java
                        ProtocolStack.java SASLClientProtocol.java
                        SASLServerProtocol.java SSLSocketProtocol.java
                        ServerSocketAcceptor.java SigningProtocol.java
                        SocketProtocol.java TokenRingProtocol.java
               modules/network/src/java/org/apache/geronimo/network/protocol/control
                        ControlClientProtocol.java
                        ControlClientProtocolKitchen.java
                        ControlClientProtocolStack.java
                        ControlServerProtocol.java
                        ControlServerProtocolStack.java
               modules/network/src/java/org/apache/geronimo/network/protocol/totem/multiplering
                        MultiTotemRingProtocol.java
               modules/network/src/java/org/apache/geronimo/network/protocol/totem/replication
                        TotemReplicationProtocol.java
               modules/network/src/java/org/apache/geronimo/network/protocol/totem/singlering
                        SingleTotemRingProtocol.java
               modules/network/src/test/org/apache/geronimo/network/protocol
                        DatagramProtocolTest.java GSSAPIProtocolTest.java
                        ProtocolStackTest.java
                        SocketProtocolStressTest.java
                        SocketProtocolTest.java TestProtocol.java
               modules/network/src/test/org/apache/geronimo/network/protocol/control
                        ControlProtocolTest.java
  Log:
  Removed likeness to GBean
  
  Revision  Changes    Path
  1.3       +5 -1      incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/SelectorManager.java
  
  Index: SelectorManager.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/SelectorManager.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SelectorManager.java	10 Mar 2004 09:59:12 -0000	1.2
  +++ SelectorManager.java	17 Mar 2004 03:11:59 -0000	1.3
  @@ -216,6 +216,10 @@
       static {
           GBeanInfoFactory infoFactory = new GBeanInfoFactory(SelectorManager.class.getName());
   
  +        infoFactory.addAttribute("Timeout", true);
  +        infoFactory.addAttribute("ThreadPool", true);
  +        infoFactory.addAttribute("ThreadName", true);
  +        infoFactory.addOperation("getSelector");
           infoFactory.addOperation("getStartCounter");
   
           GBEAN_INFO = infoFactory.getBeanInfo();
  
  
  
  1.3       +5 -5      incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/AbstractProtocol.java
  
  Index: AbstractProtocol.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/AbstractProtocol.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AbstractProtocol.java	10 Mar 2004 09:59:13 -0000	1.2
  +++ AbstractProtocol.java	17 Mar 2004 03:11:59 -0000	1.3
  @@ -25,19 +25,19 @@
       private Protocol up;
       private Protocol down;
   
  -    public Protocol getUp() {
  +    public Protocol getUpProtocol() {
           return up;
       }
   
  -    public void setUp(Protocol up) {
  +    public void setUpProtocol(Protocol up) {
           this.up = up;
       }
   
  -    public Protocol getDown() {
  +    public Protocol getDownProtocol() {
           return down;
       }
   
  -    public void setDown(Protocol down) {
  +    public void setDownProtocol(Protocol down) {
           this.down = down;
       }
   
  
  
  
  1.3       +24 -21    incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/AcceptableProtocolStack.java
  
  Index: AcceptableProtocolStack.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/AcceptableProtocolStack.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AcceptableProtocolStack.java	10 Mar 2004 09:59:13 -0000	1.2
  +++ AcceptableProtocolStack.java	17 Mar 2004 03:11:59 -0000	1.3
  @@ -41,9 +41,9 @@
           } else {
               top = (Protocol) object;
               Protocol down = (Protocol) super.peek();
  -            top.setUp(down.getUp());
  -            top.setDown(down);
  -            down.setUp(top);
  +            top.setUpProtocol(down.getUpProtocol());
  +            top.setDownProtocol(down);
  +            down.setUpProtocol(top);
           }
           return super.push(object);
       }
  @@ -58,33 +58,33 @@
           Protocol result = (Protocol) super.pop();
   
           top = (Protocol) super.peek();
  -        top.setUp(result.getUp());
  +        top.setUpProtocol(result.getUpProtocol());
   
  -        result.setUp(null);
  -        result.setDown(null);
  +        result.setUpProtocol(null);
  +        result.setDownProtocol(null);
   
           return result;
       }
   
  -    public Protocol getUp() {
  -        return top.getUp();
  +    public Protocol getUpProtocol() {
  +        return top.getUpProtocol();
       }
   
  -    public void setUp(Protocol up) {
  -        top.setUp(up);
  +    public void setUpProtocol(Protocol up) {
  +        top.setUpProtocol(up);
       }
   
  -    public Protocol getDown() {
  -        return bottom.getDown();
  +    public Protocol getDownProtocol() {
  +        return bottom.getDownProtocol();
       }
   
  -    public void setDown(Protocol down) {
  -        bottom.setDown(down);
  +    public void setDownProtocol(Protocol down) {
  +        bottom.setDownProtocol(down);
       }
   
       public void clearLinks() {
  -        top.setUp(null);
  -        bottom.setDown(null);
  +        top.setUpProtocol(null);
  +        bottom.setDownProtocol(null);
       }
   
       public Protocol cloneProtocol() throws CloneNotSupportedException {
  @@ -99,20 +99,23 @@
           return stack;
       }
   
  -    public void doStart() throws ProtocolException {
  +    public void setup() throws ProtocolException {
           log.trace("Starting");
           for (int i = 0; i < this.size(); i++) {
               Protocol protocol = (Protocol) this.get(i);
  -            protocol.doStart();
  +            protocol.setup();
           }
       }
   
  -    public void doStop() throws ProtocolException {
  +    public void drain() throws ProtocolException {
           log.trace("Stopping");
           for (int i = this.size() - 1; 0 <= i; i--) {
               Protocol protocol = (Protocol) this.get(i);
  -            protocol.doStop();
  +            protocol.drain();
           }
  +    }
  +
  +    public void teardown() throws ProtocolException {
       }
   
       public void sendUp(UpPacket packet) throws ProtocolException {
  
  
  
  1.3       +8 -5      incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/BufferProtocol.java
  
  Index: BufferProtocol.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/BufferProtocol.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- BufferProtocol.java	10 Mar 2004 09:59:13 -0000	1.2
  +++ BufferProtocol.java	17 Mar 2004 03:11:59 -0000	1.3
  @@ -52,7 +52,7 @@
           this.threadPool = threadPool;
       }
   
  -    public void doStart() throws ProtocolException {
  +    public void setup() throws ProtocolException {
           log.trace("Starting");
           running = true;
           try {
  @@ -61,7 +61,7 @@
                       try {
                           while (running) {
                               UpPacket packet = (UpPacket) upQueue.poll(500);
  -                            if (packet != null) getUp().sendUp(packet);
  +                            if (packet != null) getUpProtocol().sendUp(packet);
                           }
                       } catch (InterruptedException e) {
                       } catch (ProtocolException e) {
  @@ -75,7 +75,7 @@
                       try {
                           while (running) {
                               DownPacket packet = (DownPacket) downQueue.poll(500);
  -                            if (packet != null) getDown().sendDown(packet);
  +                            if (packet != null) getDownProtocol().sendDown(packet);
                           }
                       } catch (InterruptedException e) {
                       } catch (ProtocolException e) {
  @@ -89,9 +89,12 @@
           }
       }
   
  -    public void doStop() throws ProtocolException {
  +    public void drain() throws ProtocolException {
           log.trace("Stopping");
           running = false;
  +    }
  +
  +    public void teardown() throws ProtocolException {
       }
   
       public void sendUp(UpPacket packet) throws ProtocolException {
  
  
  
  1.3       +6 -3      incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/ChecksumProtocol.java
  
  Index: ChecksumProtocol.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/ChecksumProtocol.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ChecksumProtocol.java	10 Mar 2004 09:59:13 -0000	1.2
  +++ ChecksumProtocol.java	17 Mar 2004 03:11:59 -0000	1.3
  @@ -22,10 +22,13 @@
    */
   public class ChecksumProtocol extends AbstractProtocol {
   
  -    public void doStart() throws ProtocolException {
  +    public void setup() throws ProtocolException {
       }
   
  -    public void doStop() throws ProtocolException {
  +    public void drain() throws ProtocolException {
  +    }
  +
  +    public void teardown() throws ProtocolException {
       }
   
       public void sendUp(UpPacket packet) throws ProtocolException {
  
  
  
  1.3       +6 -3      incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/ChunkingProtocol.java
  
  Index: ChunkingProtocol.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/ChunkingProtocol.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ChunkingProtocol.java	10 Mar 2004 09:59:13 -0000	1.2
  +++ ChunkingProtocol.java	17 Mar 2004 03:11:59 -0000	1.3
  @@ -22,10 +22,13 @@
    */
   public class ChunkingProtocol extends AbstractProtocol {
   
  -    public void doStart() throws ProtocolException {
  +    public void setup() throws ProtocolException {
       }
   
  -    public void doStop() throws ProtocolException {
  +    public void drain() throws ProtocolException {
  +    }
  +
  +    public void teardown() throws ProtocolException {
       }
   
       public void sendUp(UpPacket packet) throws ProtocolException {
  
  
  
  1.3       +8 -5      incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/CountingProtocol.java
  
  Index: CountingProtocol.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/CountingProtocol.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- CountingProtocol.java	10 Mar 2004 09:59:13 -0000	1.2
  +++ CountingProtocol.java	17 Mar 2004 03:11:59 -0000	1.3
  @@ -47,28 +47,31 @@
           return downCount;
       }
   
  -    public void doStart() throws ProtocolException {
  +    public void setup() throws ProtocolException {
           tracing = log.isTraceEnabled();
   
           if (tracing) log.trace("Starting");
       }
   
  -    public void doStop() throws ProtocolException {
  +    public void drain() throws ProtocolException {
           if (tracing) log.trace("Stopping");
       }
   
  +    public void teardown() throws ProtocolException {
  +    }
  +
       public void sendUp(UpPacket packet) throws ProtocolException {
           if (tracing) log.trace("sendUp " + upCount);
   
           upCount++;
  -        getUp().sendUp(packet);
  +        getUpProtocol().sendUp(packet);
       }
   
       public void sendDown(DownPacket packet) throws ProtocolException {
           if (tracing) log.trace("sendDown " + downCount);
   
           downCount++;
  -        getDown().sendDown(packet);
  +        getDownProtocol().sendDown(packet);
       }
   
       public Collection cook(ControlContext context) {
  
  
  
  1.4       +10 -7     incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/DatagramProtocol.java
  
  Index: DatagramProtocol.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/DatagramProtocol.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DatagramProtocol.java	14 Mar 2004 00:11:01 -0000	1.3
  +++ DatagramProtocol.java	17 Mar 2004 03:11:59 -0000	1.4
  @@ -59,19 +59,19 @@
       private int state = STOPPED;
   
   
  -    public Protocol getUp() {
  +    public Protocol getUpProtocol() {
           return up;
       }
   
  -    public void setUp(Protocol up) {
  +    public void setUpProtocol(Protocol up) {
           this.up = up;
       }
   
  -    public Protocol getDown() {
  +    public Protocol getDownProtocol() {
           throw new UnsupportedOperationException("Datagram protocol is at the bottom");
       }
   
  -    public void setDown(Protocol down) {
  +    public void setDownProtocol(Protocol down) {
           throw new UnsupportedOperationException("Datagram protocol is at the bottom");
       }
   
  @@ -114,7 +114,7 @@
           return (Protocol) super.clone();
       }
   
  -    public void doStart() throws ProtocolException {
  +    public void setup() throws ProtocolException {
           try {
               if (sourceAddress != null) {
                   source = DatagramChannel.open();
  @@ -157,9 +157,12 @@
           state = STARTED;
       }
   
  -    public void doStop() throws ProtocolException {
  +    public void drain() throws ProtocolException {
           close();
           state = STOPPED;
  +    }
  +
  +    public void teardown() throws ProtocolException {
       }
   
       public void sendUp(UpPacket packet) throws ProtocolException {
  
  
  
  1.3       +6 -3      incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/DoNothingProtocol.java
  
  Index: DoNothingProtocol.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/DoNothingProtocol.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DoNothingProtocol.java	10 Mar 2004 09:59:13 -0000	1.2
  +++ DoNothingProtocol.java	17 Mar 2004 03:11:59 -0000	1.3
  @@ -22,10 +22,13 @@
    */
   public class DoNothingProtocol extends AbstractProtocol {
   
  -    public void doStart() throws ProtocolException {
  +    public void setup() throws ProtocolException {
       }
   
  -    public void doStop() throws ProtocolException {
  +    public void drain() throws ProtocolException {
  +    }
  +
  +    public void teardown() throws ProtocolException {
       }
   
       public void sendUp(UpPacket packet) throws ProtocolException {
  
  
  
  1.3       +10 -7     incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/GSSAPIClientProtocol.java
  
  Index: GSSAPIClientProtocol.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/GSSAPIClientProtocol.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- GSSAPIClientProtocol.java	10 Mar 2004 09:59:13 -0000	1.2
  +++ GSSAPIClientProtocol.java	17 Mar 2004 03:11:59 -0000	1.3
  @@ -100,7 +100,7 @@
       }
   
   
  -    public void doStart() throws ProtocolException {
  +    public void setup() throws ProtocolException {
           log.trace("Starting");
           try {
               Oid krb5Oid = new Oid("1.2.840.113554.1.2.2");
  @@ -122,7 +122,7 @@
                           token = context.initSecContext(token, 0, token.length);
                           PlainDownPacket packet = new PlainDownPacket();
                           packet.setBuffers(Collections.singletonList(ByteBuffer.allocate(token.length).put(token).flip()));
  -                        getDown().sendDown(packet);
  +                        getDownProtocol().sendDown(packet);
                       } catch (ProtocolException e) {
                       } catch (GSSException e) {
                       }
  @@ -135,10 +135,13 @@
           }
       }
   
  -    public void doStop() throws ProtocolException {
  +    public void drain() throws ProtocolException {
           log.trace("Stoping");
       }
   
  +    public void teardown() throws ProtocolException {
  +    }
  +
       public void sendUp(UpPacket packet) throws ProtocolException {
           try {
               log.trace("sendUp");
  @@ -149,7 +152,7 @@
                   if (!context.isEstablished()) {
                       PlainDownPacket reply = new PlainDownPacket();
                       reply.setBuffers(Collections.singletonList(ByteBuffer.allocate(token.length).put(token).flip()));
  -                    getDown().sendDown(reply);
  +                    getDownProtocol().sendDown(reply);
                   } else {
                       log.trace("SECURE CONTEXT ESTABLISHED");
                       log.trace("Client is " + context.getSrcName());
  @@ -164,7 +167,7 @@
                   byte[] token = context.unwrap(buffer.array(), buffer.position(), buffer.remaining(), new MessageProp(0, true));
                   UpPacket message = new UpPacket();
                   message.setBuffer((ByteBuffer) ByteBuffer.allocate(token.length).put(token).flip());
  -                getUp().sendUp(message);
  +                getUpProtocol().sendUp(message);
               }
           } catch (GSSException e) {
               throw new ProtocolException(e);
  @@ -188,7 +191,7 @@
               byte[] token = context.wrap(buffer.array(), buffer.position(), buffer.remaining(), new MessageProp(0, true));
               PlainDownPacket reply = new PlainDownPacket();
               reply.setBuffers(Collections.singletonList(ByteBuffer.allocate(token.length).put(token).flip()));
  -            getDown().sendDown(reply);
  +            getDownProtocol().sendDown(reply);
           } catch (GSSException e) {
               throw new ProtocolException(e);
           }
  
  
  
  1.3       +9 -6      incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/GSSAPIServerProtocol.java
  
  Index: GSSAPIServerProtocol.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/GSSAPIServerProtocol.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- GSSAPIServerProtocol.java	10 Mar 2004 09:59:13 -0000	1.2
  +++ GSSAPIServerProtocol.java	17 Mar 2004 03:11:59 -0000	1.3
  @@ -98,7 +98,7 @@
           this.integrity = integrity;
       }
   
  -    public void doStart() throws ProtocolException {
  +    public void setup() throws ProtocolException {
           log.trace("Starting");
           try {
               GSSManager manager = GSSManager.getInstance();
  @@ -113,10 +113,13 @@
           }
       }
   
  -    public void doStop() throws ProtocolException {
  +    public void drain() throws ProtocolException {
           log.trace("Stoping");
       }
   
  +    public void teardown() throws ProtocolException {
  +    }
  +
       public void sendUp(UpPacket packet) throws ProtocolException {
           try {
               log.trace("sendUp");
  @@ -126,7 +129,7 @@
   
                   PlainDownPacket reply = new PlainDownPacket();
                   reply.setBuffers(Collections.singletonList(ByteBuffer.allocate(token.length).put(token).flip()));
  -                getDown().sendDown(reply);
  +                getDownProtocol().sendDown(reply);
   
                   if (context.isEstablished()) {
                       log.trace("SECURE CONTEXT ESTABLISHED");
  @@ -153,7 +156,7 @@
   
                   MetadataSupport.setSubject(message, clientSubject);
   
  -                getUp().sendUp(message);
  +                getUpProtocol().sendUp(message);
               }
           } catch (GSSException e) {
               throw new ProtocolException(e);
  @@ -177,7 +180,7 @@
               byte[] token = context.wrap(buffer.array(), buffer.position(), buffer.remaining(), new MessageProp(0, true));
               PlainDownPacket reply = new PlainDownPacket();
               reply.setBuffers(Collections.singletonList(ByteBuffer.allocate(token.length).put(token).flip()));
  -            getDown().sendDown(reply);
  +            getDownProtocol().sendDown(reply);
           } catch (GSSException e) {
               throw new ProtocolException(e);
           }
  
  
  
  1.3       +8 -5      incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/LossyProtocol.java
  
  Index: LossyProtocol.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/LossyProtocol.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- LossyProtocol.java	10 Mar 2004 09:59:13 -0000	1.2
  +++ LossyProtocol.java	17 Mar 2004 03:11:59 -0000	1.3
  @@ -53,24 +53,27 @@
           this.downLoss = downLoss;
       }
   
  -    public void doStart() throws ProtocolException {
  +    public void setup() throws ProtocolException {
           state = STARTED;
       }
   
  -    public void doStop() throws ProtocolException {
  +    public void drain() throws ProtocolException {
           state = STOPPED;
       }
   
  +    public void teardown() throws ProtocolException {
  +    }
  +
       public void sendUp(UpPacket packet) throws ProtocolException {
           if (state == STOPPED) throw new IllegalStateException("Protocol is not started");
   
  -        if (upRandom.nextFloat() > upLoss) getUp().sendUp(packet);
  +        if (upRandom.nextFloat() > upLoss) getUpProtocol().sendUp(packet);
       }
   
       public void sendDown(DownPacket packet) throws ProtocolException {
           if (state == STOPPED) throw new IllegalStateException("Protocol is not started");
   
  -        if (downRandom.nextFloat() > downLoss) getDown().sendDown(packet);
  +        if (downRandom.nextFloat() > downLoss) getDownProtocol().sendDown(packet);
       }
   
   }
  
  
  
  1.3       +6 -3      incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/MulticastProtocol.java
  
  Index: MulticastProtocol.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/MulticastProtocol.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- MulticastProtocol.java	10 Mar 2004 09:59:13 -0000	1.2
  +++ MulticastProtocol.java	17 Mar 2004 03:11:59 -0000	1.3
  @@ -22,10 +22,13 @@
    */
   public class MulticastProtocol extends AbstractProtocol {
   
  -    public void doStart() throws ProtocolException {
  +    public void setup() throws ProtocolException {
       }
   
  -    public void doStop() throws ProtocolException {
  +    public void drain() throws ProtocolException {
  +    }
  +
  +    public void teardown() throws ProtocolException {
       }
   
       public void sendUp(UpPacket packet) throws ProtocolException {
  
  
  
  1.3       +9 -7      incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/Protocol.java
  
  Index: Protocol.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/Protocol.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Protocol.java	10 Mar 2004 09:59:13 -0000	1.2
  +++ Protocol.java	17 Mar 2004 03:11:59 -0000	1.3
  @@ -22,21 +22,23 @@
    */
   public interface Protocol extends Cloneable {
   
  -    Protocol getUp();
  +    Protocol getUpProtocol();
   
  -    void setUp(Protocol up);
  +    void setUpProtocol(Protocol up);
   
  -    Protocol getDown();
  +    Protocol getDownProtocol();
   
  -    void setDown(Protocol down);
  +    void setDownProtocol(Protocol down);
   
       void clearLinks();
   
       Protocol cloneProtocol() throws CloneNotSupportedException;
   
  -    void doStart() throws ProtocolException;
  +    void setup() throws ProtocolException;
   
  -    void doStop() throws ProtocolException;
  +    void drain() throws ProtocolException;
  +
  +    void teardown() throws ProtocolException;
   
       void sendUp(UpPacket packet) throws ProtocolException;
   
  
  
  
  1.4       +8 -14     incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/ProtocolFactory.java
  
  Index: ProtocolFactory.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/ProtocolFactory.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ProtocolFactory.java	10 Mar 2004 09:59:13 -0000	1.3
  +++ ProtocolFactory.java	17 Mar 2004 03:11:59 -0000	1.4
  @@ -26,16 +26,13 @@
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
   
  -import org.apache.geronimo.gbean.GBean;
  -import org.apache.geronimo.gbean.GBeanContext;
  -import org.apache.geronimo.gbean.WaitingException;
   import org.apache.geronimo.system.ClockPool;
   
   
   /**
    * @version $Revision$ $Date$
    */
  -public class ProtocolFactory implements ServerSocketAcceptorListener, GBean {
  +public class ProtocolFactory implements ServerSocketAcceptorListener {
   
       private final static Log log = LogFactory.getLog(ProtocolFactory.class);
   
  @@ -92,7 +89,7 @@
           try {
               AcceptableProtocol protocol = (AcceptableProtocol) template.cloneProtocol();
               protocol.accept(socketChannel);
  -            protocol.doStart();
  +            protocol.setup();
   
               Long id = new Long(nextConnectionId++);
   
  @@ -109,20 +106,17 @@
           }
       }
   
  -    public void setGBeanContext(GBeanContext context) {
  +    public void startup() throws Exception {
       }
   
  -    public void doStart() throws WaitingException, Exception {
  -    }
  -
  -    public void doStop() throws WaitingException, Exception {
  +    public void drain() throws Exception {
           synchronized (connectionCache) {
               Iterator keys = connectionCache.keySet().iterator();
               while (keys.hasNext()) {
                   ConnectionCacheMonitor ccm = (ConnectionCacheMonitor) connectionCache.get(keys.next());
   
                   ClockDaemon.cancel(ccm.clockTicket);
  -                ccm.connection.doStop();
  +                ccm.connection.drain();
   
                   log.trace("Connection [" + ccm.key + "] reclaimed");
               }
  @@ -130,7 +124,7 @@
           }
       }
   
  -    public void doFail() {
  +    public void teardown() {
   
       }
   
  @@ -161,7 +155,7 @@
                               || (currentTime - connection.getLastUsed()) > maxInactivity) {
                           log.trace("Connection [" + key + "] reclaimed");
   
  -                        connection.doStop();
  +                        connection.drain();
   
                           ClockDaemon.cancel(clockTicket);
                           connectionCache.remove(key);
  
  
  
  1.3       +24 -21    incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/ProtocolStack.java
  
  Index: ProtocolStack.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/ProtocolStack.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ProtocolStack.java	10 Mar 2004 09:59:13 -0000	1.2
  +++ ProtocolStack.java	17 Mar 2004 03:11:59 -0000	1.3
  @@ -40,9 +40,9 @@
           } else {
               top = (Protocol) object;
               Protocol down = (Protocol) super.peek();
  -            top.setUp(down.getUp());
  -            top.setDown(down);
  -            down.setUp(top);
  +            top.setUpProtocol(down.getUpProtocol());
  +            top.setDownProtocol(down);
  +            down.setUpProtocol(top);
           }
           return super.push(object);
       }
  @@ -57,33 +57,33 @@
           Protocol result = (Protocol) super.pop();
   
           top = (Protocol) super.peek();
  -        top.setUp(result.getUp());
  +        top.setUpProtocol(result.getUpProtocol());
   
  -        result.setUp(null);
  -        result.setDown(null);
  +        result.setUpProtocol(null);
  +        result.setDownProtocol(null);
   
           return result;
       }
   
  -    public Protocol getUp() {
  -        return top.getUp();
  +    public Protocol getUpProtocol() {
  +        return top.getUpProtocol();
       }
   
  -    public void setUp(Protocol up) {
  -        top.setUp(up);
  +    public void setUpProtocol(Protocol up) {
  +        top.setUpProtocol(up);
       }
   
  -    public Protocol getDown() {
  -        return bottom.getDown();
  +    public Protocol getDownProtocol() {
  +        return bottom.getDownProtocol();
       }
   
  -    public void setDown(Protocol down) {
  -        bottom.setDown(down);
  +    public void setDownProtocol(Protocol down) {
  +        bottom.setDownProtocol(down);
       }
   
       public void clearLinks() {
  -        top.setUp(null);
  -        bottom.setDown(null);
  +        top.setUpProtocol(null);
  +        bottom.setDownProtocol(null);
       }
   
       public Protocol cloneProtocol() throws CloneNotSupportedException {
  @@ -98,20 +98,23 @@
           return stack;
       }
   
  -    public void doStart() throws ProtocolException {
  +    public void setup() throws ProtocolException {
           log.trace("Starting");
           for (int i = 0; i < this.size(); i++) {
               Protocol protocol = (Protocol) this.get(i);
  -            protocol.doStart();
  +            protocol.setup();
           }
       }
   
  -    public void doStop() throws ProtocolException {
  +    public void drain() throws ProtocolException {
           log.trace("Stopping");
           for (int i = this.size() - 1; 0 <= i; i--) {
               Protocol protocol = (Protocol) this.get(i);
  -            protocol.doStop();
  +            protocol.drain();
           }
  +    }
  +
  +    public void teardown() throws ProtocolException {
       }
   
       public void sendUp(UpPacket packet) throws ProtocolException {
  
  
  
  1.3       +6 -3      incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/SASLClientProtocol.java
  
  Index: SASLClientProtocol.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/SASLClientProtocol.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SASLClientProtocol.java	10 Mar 2004 09:59:13 -0000	1.2
  +++ SASLClientProtocol.java	17 Mar 2004 03:11:59 -0000	1.3
  @@ -24,10 +24,13 @@
    * @version $Revision$ $Date$
    */
   public class SASLClientProtocol extends AbstractProtocol {
  -    public void doStart() throws ProtocolException {
  +    public void setup() throws ProtocolException {
       }
   
  -    public void doStop() throws ProtocolException {
  +    public void drain() throws ProtocolException {
  +    }
  +
  +    public void teardown() throws ProtocolException {
       }
   
       public void sendUp(UpPacket packet) throws ProtocolException {
  
  
  
  1.3       +6 -3      incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/SASLServerProtocol.java
  
  Index: SASLServerProtocol.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/SASLServerProtocol.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SASLServerProtocol.java	10 Mar 2004 09:59:13 -0000	1.2
  +++ SASLServerProtocol.java	17 Mar 2004 03:11:59 -0000	1.3
  @@ -24,10 +24,13 @@
    * @version $Revision$ $Date$
    */
   public class SASLServerProtocol extends AbstractProtocol {
  -    public void doStart() throws ProtocolException {
  +    public void setup() throws ProtocolException {
       }
   
  -    public void doStop() throws ProtocolException {
  +    public void drain() throws ProtocolException {
  +    }
  +
  +    public void teardown() throws ProtocolException {
       }
   
       public void sendUp(UpPacket packet) throws ProtocolException {
  
  
  
  1.3       +10 -7     incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/SSLSocketProtocol.java
  
  Index: SSLSocketProtocol.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/SSLSocketProtocol.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SSLSocketProtocol.java	10 Mar 2004 09:59:13 -0000	1.2
  +++ SSLSocketProtocol.java	17 Mar 2004 03:11:59 -0000	1.3
  @@ -22,18 +22,18 @@
    */
   public class SSLSocketProtocol implements Protocol {
   
  -    public Protocol getUp() {
  +    public Protocol getUpProtocol() {
           return null;
       }
   
  -    public void setUp(Protocol up) {
  +    public void setUpProtocol(Protocol up) {
       }
   
  -    public Protocol getDown() {
  +    public Protocol getDownProtocol() {
           return null;
       }
   
  -    public void setDown(Protocol down) {
  +    public void setDownProtocol(Protocol down) {
       }
   
       public void clearLinks() {
  @@ -43,10 +43,13 @@
           return (Protocol) super.clone();
       }
   
  -    public void doStart() throws ProtocolException {
  +    public void setup() throws ProtocolException {
       }
   
  -    public void doStop() throws ProtocolException {
  +    public void drain() throws ProtocolException {
  +    }
  +
  +    public void teardown() throws ProtocolException {
       }
   
       public void sendUp(UpPacket packet) throws ProtocolException {
  
  
  
  1.4       +5 -33     incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/ServerSocketAcceptor.java
  
  Index: ServerSocketAcceptor.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/ServerSocketAcceptor.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ServerSocketAcceptor.java	14 Mar 2004 01:01:20 -0000	1.3
  +++ ServerSocketAcceptor.java	17 Mar 2004 03:11:59 -0000	1.4
  @@ -29,11 +29,6 @@
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
   
  -import org.apache.geronimo.gbean.GBean;
  -import org.apache.geronimo.gbean.GBeanContext;
  -import org.apache.geronimo.gbean.GBeanInfo;
  -import org.apache.geronimo.gbean.GBeanInfoFactory;
  -import org.apache.geronimo.gbean.WaitingException;
   import org.apache.geronimo.network.SelectionEventListner;
   import org.apache.geronimo.network.SelectorManager;
   import org.apache.geronimo.network.URISupport;
  @@ -42,7 +37,7 @@
   /**
    * @version $Revision$ $Date$
    */
  -public class ServerSocketAcceptor implements SelectionEventListner, GBean {
  +public class ServerSocketAcceptor implements SelectionEventListner {
   
       final static private Log log = LogFactory.getLog(SocketProtocol.class);
   
  @@ -120,10 +115,7 @@
           this.selectorManager = selectorManager;
       }
   
  -    public void setGBeanContext(GBeanContext context) {
  -    }
  -
  -    public void doStart() throws WaitingException, Exception {
  +    public void startup() throws Exception {
           String serverBindAddress = uri.getHost();
           int serverBindPort = uri.getPort();
           int connectBackLog = 50;
  @@ -158,13 +150,13 @@
           state = STARTED;
       }
   
  -    public void doStop() throws Exception {
  +    public void drain() throws Exception {
           selectionKey.cancel();
           serverSocketChannel.close();
           state = STOPPED;
       }
   
  -    public void doFail() {
  +    public void teardown() {
           state = STOPPED;        
       }
   
  @@ -185,25 +177,5 @@
               }
   
           }
  -    }
  -
  -    private static final GBeanInfo GBEAN_INFO;
  -
  -    static {
  -        GBeanInfoFactory infoFactory = new GBeanInfoFactory(ServerSocketAcceptor.class.getName());
  -
  -        infoFactory.addAttribute("uri", true);
  -        infoFactory.addAttribute("serverSocketChannel", true);
  -        infoFactory.addAttribute("timeOut", true);
  -        infoFactory.addAttribute("enableTcpNoDelay", true);
  -        infoFactory.addAttribute("acceptorListener", true);
  -        infoFactory.addAttribute("selectorManager", true);
  -        infoFactory.addOperation("getConnectURI");
  -
  -        GBEAN_INFO = infoFactory.getBeanInfo();
  -    }
  -
  -    public static GBeanInfo getGBeanInfo() {
  -        return GBEAN_INFO;
       }
   }
  
  
  
  1.3       +6 -3      incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/SigningProtocol.java
  
  Index: SigningProtocol.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/SigningProtocol.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SigningProtocol.java	10 Mar 2004 09:59:13 -0000	1.2
  +++ SigningProtocol.java	17 Mar 2004 03:11:59 -0000	1.3
  @@ -22,10 +22,13 @@
    */
   public class SigningProtocol extends AbstractProtocol {
   
  -    public void doStart() throws ProtocolException {
  +    public void setup() throws ProtocolException {
       }
   
  -    public void doStop() throws ProtocolException {
  +    public void drain() throws ProtocolException {
  +    }
  +
  +    public void teardown() throws ProtocolException {
       }
   
       public void sendUp(UpPacket packet) throws ProtocolException {
  
  
  
  1.4       +10 -7     incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/SocketProtocol.java
  
  Index: SocketProtocol.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/SocketProtocol.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SocketProtocol.java	16 Mar 2004 03:33:18 -0000	1.3
  +++ SocketProtocol.java	17 Mar 2004 03:11:59 -0000	1.4
  @@ -63,19 +63,19 @@
       private int state = STOPPED;
   
   
  -    public Protocol getUp() {
  +    public Protocol getUpProtocol() {
           return up;
       }
   
  -    public void setUp(Protocol up) {
  +    public void setUpProtocol(Protocol up) {
           this.up = up;
       }
   
  -    public Protocol getDown() {
  +    public Protocol getDownProtocol() {
           throw new NoSuchMethodError("Socket protocol is at the bottom");
       }
   
  -    public void setDown(Protocol down) {
  +    public void setDownProtocol(Protocol down) {
           throw new NoSuchMethodError("Socket protocol is at the bottom");
       }
   
  @@ -143,7 +143,7 @@
           return (Protocol) super.clone();
       }
   
  -    public void doStart() throws ProtocolException {
  +    public void setup() throws ProtocolException {
           if (address == null && acceptedSocketChannel == null) throw new IllegalStateException("No address set");
   
           log.trace("Starting");
  @@ -182,10 +182,13 @@
           state = STARTED;
       }
   
  -    public void doStop() throws ProtocolException {
  +    public void drain() throws ProtocolException {
           log.trace("Stopping");
           close();
           state = STOPPED;
  +    }
  +
  +    public void teardown() throws ProtocolException {
       }
   
       public void sendUp(UpPacket packet) throws ProtocolException {
  
  
  
  1.3       +6 -3      incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/TokenRingProtocol.java
  
  Index: TokenRingProtocol.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/TokenRingProtocol.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TokenRingProtocol.java	10 Mar 2004 09:59:13 -0000	1.2
  +++ TokenRingProtocol.java	17 Mar 2004 03:11:59 -0000	1.3
  @@ -23,10 +23,13 @@
    */
   public class TokenRingProtocol extends AbstractProtocol {
   
  -    public void doStart() throws ProtocolException {
  +    public void setup() throws ProtocolException {
       }
   
  -    public void doStop() throws ProtocolException {
  +    public void drain() throws ProtocolException {
  +    }
  +
  +    public void teardown() throws ProtocolException {
       }
   
       public void sendUp(UpPacket packet) throws ProtocolException {
  
  
  
  1.3       +12 -9     incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/control/ControlClientProtocol.java
  
  Index: ControlClientProtocol.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/control/ControlClientProtocol.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ControlClientProtocol.java	10 Mar 2004 09:59:14 -0000	1.2
  +++ ControlClientProtocol.java	17 Mar 2004 03:11:59 -0000	1.3
  @@ -68,11 +68,11 @@
           this.timeout = timeout;
       }
   
  -    public void doStart() throws ProtocolException {
  +    public void setup() throws ProtocolException {
           try {
               log.trace("Starting");
   
  -            getDown().sendDown(new BootRequestDownPacket()); //todo: this is probably dangerous, put in thread pool
  +            getDownProtocol().sendDown(new BootRequestDownPacket()); //todo: this is probably dangerous, put in thread pool
   
               sendMutex.acquire();
   
  @@ -82,10 +82,10 @@
           }
       }
   
  -    public void doStop() throws ProtocolException {
  +    public void drain() throws ProtocolException {
           log.trace("Stopping");
           if (state == STARTED) {
  -            getDown().sendDown(new ShutdownRequestDownPacket());
  +            getDownProtocol().sendDown(new ShutdownRequestDownPacket());
               try {
                   shutdownLatch.acquire();
               } catch (InterruptedException e) {
  @@ -95,16 +95,19 @@
           }
       }
   
  +    public void teardown() throws ProtocolException {
  +    }
  +
       public void sendUp(UpPacket packet) throws ProtocolException {
           UpPacket p = ControlPacketReader.getInstance().read(packet.getBuffer());
           if (p instanceof PassthroughUpPacket) {
               log.trace("PASSTHROUGH");
  -            getUp().sendUp(packet);
  +            getUpProtocol().sendUp(packet);
           } else if (p instanceof BootResponseUpPacket) {
               try {
                   log.trace("BOOT RESPONSE");
                   listener.serveUp(((BootResponseUpPacket) p).getMenu());
  -                getDown().sendDown(new BootSuccessDownPacket());
  +                getDownProtocol().sendDown(new BootSuccessDownPacket());
                   sendMutex.release();
               } catch (ControlException e) {
                   throw new ProtocolException(e);
  @@ -115,7 +118,7 @@
               listener.shutdown();
           } else if (p instanceof ShutdownRequestUpPacket) {
               log.trace("SHUTDOWN_REQ");
  -            getDown().sendDown(new ShutdownAcknowledgeDownPacket());
  +            getDownProtocol().sendDown(new ShutdownAcknowledgeDownPacket());
               state = STOPPED;
               listener.shutdown();
           } else if (p instanceof ShutdownAcknowledgeUpPacket) {
  @@ -132,7 +135,7 @@
               PassthroughDownPacket passthtough = new PassthroughDownPacket();
               passthtough.setBuffers(packet.getBuffers());
   
  -            getDown().sendDown(passthtough);
  +            getDownProtocol().sendDown(passthtough);
   
               sendMutex.release();
           } catch (InterruptedException e) {
  
  
  
  1.3       +9 -6      incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/control/ControlClientProtocolKitchen.java
  
  Index: ControlClientProtocolKitchen.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/control/ControlClientProtocolKitchen.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ControlClientProtocolKitchen.java	10 Mar 2004 09:59:14 -0000	1.2
  +++ ControlClientProtocolKitchen.java	17 Mar 2004 03:11:59 -0000	1.3
  @@ -101,7 +101,7 @@
               }
           }
           try {
  -            doStart();
  +            setup();
           } catch (ProtocolException e) {
               throw new ControlException(e);
           }
  @@ -124,18 +124,21 @@
   
       protected class Dummy extends AbstractProtocol {
   
  -        public void doStart() throws ProtocolException {
  +        public void setup() throws ProtocolException {
           }
   
  -        public void doStop() throws ProtocolException {
  +        public void drain() throws ProtocolException {
  +        }
  +
  +        public void teardown() throws ProtocolException {
           }
   
           public void sendUp(UpPacket packet) throws ProtocolException {
  -            getUp().sendUp(packet);
  +            getUpProtocol().sendUp(packet);
           }
   
           public void sendDown(DownPacket packet) throws ProtocolException {
  -            getDown().sendDown(packet);
  +            getDownProtocol().sendDown(packet);
           }
   
       }
  
  
  
  1.3       +6 -6      incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/control/ControlClientProtocolStack.java
  
  Index: ControlClientProtocolStack.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/control/ControlClientProtocolStack.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ControlClientProtocolStack.java	10 Mar 2004 09:59:14 -0000	1.2
  +++ ControlClientProtocolStack.java	17 Mar 2004 03:11:59 -0000	1.3
  @@ -91,7 +91,7 @@
           return result;
       }
   
  -    public void doStart() throws ProtocolException {
  +    public void setup() throws ProtocolException {
           try {
               kitchen = new ControlClientProtocolKitchen();
               kitchen.setClassLoader(classLoader);
  @@ -101,16 +101,16 @@
   
               push(kitchen);
   
  -            super.doStart();
  +            super.setup();
           } catch (InterruptedException e) {
               throw new ProtocolException(e);
           }
       }
   
  -    public void doStop() throws ProtocolException {
  +    public void drain() throws ProtocolException {
           pop();
   
  -        super.doStop();
  +        super.drain();
       }
   
       public void serveUp(Collection menu) throws ControlException {
  @@ -120,7 +120,7 @@
       public void shutdown() {
           log.trace("Shutdown");
           try {
  -            doStop();
  +            drain();
           } catch (ProtocolException e) {
           }
       }
  
  
  
  1.3       +11 -8     incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/control/ControlServerProtocol.java
  
  Index: ControlServerProtocol.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/control/ControlServerProtocol.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ControlServerProtocol.java	10 Mar 2004 09:59:14 -0000	1.2
  +++ ControlServerProtocol.java	17 Mar 2004 03:11:59 -0000	1.3
  @@ -98,7 +98,7 @@
           this.timeout = timeout;
       }
   
  -    public void doStart() throws ProtocolException {
  +    public void setup() throws ProtocolException {
           try {
               log.trace("Starting");
               sendMutex.acquire();
  @@ -108,28 +108,31 @@
           }
       }
   
  -    public void doStop() throws ProtocolException {
  +    public void drain() throws ProtocolException {
           log.trace("Stopping");
           if (state == STARTED) {
  -            getDown().sendDown(new ShutdownRequestDownPacket());
  +            getDownProtocol().sendDown(new ShutdownRequestDownPacket());
               state = STOPPED;
           }
       }
   
  +    public void teardown() throws ProtocolException {
  +    }
  +
       public void sendUp(UpPacket packet) throws ProtocolException {
           UpPacket p = ControlPacketReader.getInstance().read(packet.getBuffer());
           if (p instanceof PassthroughUpPacket) {
               log.trace("PASSTHROUGH");
  -            getUp().sendUp(packet);
  +            getUpProtocol().sendUp(packet);
           } else if (p instanceof BootRequestUpPacket) {
               log.trace("BOOT REQUEST");
  -            getDown().sendDown(constructBootPacket());
  +            getDownProtocol().sendDown(constructBootPacket());
           } else if (p instanceof BootSuccessUpPacket) {
               log.trace("BOOT SUCCESS");
               sendMutex.release();
           } else if (p instanceof ShutdownRequestUpPacket) {
               log.trace("SHUTDOWN_REQ");
  -            getDown().sendDown(new ShutdownAcknowledgeDownPacket());
  +            getDownProtocol().sendDown(new ShutdownAcknowledgeDownPacket());
               state = STOPPED;
               controlServerListener.shutdown();
           }
  @@ -142,7 +145,7 @@
               PassthroughDownPacket passthtough = new PassthroughDownPacket();
               passthtough.setBuffers(packet.getBuffers());
   
  -            getDown().sendDown(passthtough);
  +            getDownProtocol().sendDown(passthtough);
   
               sendMutex.release();
           } catch (InterruptedException e) {
  
  
  
  1.3       +4 -4      incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/control/ControlServerProtocolStack.java
  
  Index: ControlServerProtocolStack.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/control/ControlServerProtocolStack.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ControlServerProtocolStack.java	10 Mar 2004 09:59:14 -0000	1.2
  +++ ControlServerProtocolStack.java	17 Mar 2004 03:12:00 -0000	1.3
  @@ -57,16 +57,16 @@
           return result;
       }
   
  -    public void doStart() throws ProtocolException {
  +    public void setup() throws ProtocolException {
           if (waiter == null) throw new IllegalStateException("Waiter not added to stack");
   
  -        super.doStart();
  +        super.setup();
       }
   
       public void shutdown() {
           log.trace("Shutdown");
           try {
  -            doStop();
  +            drain();
           } catch (ProtocolException e) {
           }
       }
  
  
  
  1.3       +10 -7     incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/totem/multiplering/MultiTotemRingProtocol.java
  
  Index: MultiTotemRingProtocol.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/totem/multiplering/MultiTotemRingProtocol.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- MultiTotemRingProtocol.java	10 Mar 2004 09:59:15 -0000	1.2
  +++ MultiTotemRingProtocol.java	17 Mar 2004 03:12:00 -0000	1.3
  @@ -28,10 +28,13 @@
    */
   public class MultiTotemRingProtocol implements Protocol {
   
  -    public void doStart() throws ProtocolException {
  +    public void setup() throws ProtocolException {
       }
   
  -    public void doStop() throws ProtocolException {
  +    public void drain() throws ProtocolException {
  +    }
  +
  +    public void teardown() throws ProtocolException {
       }
   
       public void sendUp(UpPacket packet) throws ProtocolException {
  @@ -40,18 +43,18 @@
       public void sendDown(DownPacket packet) throws ProtocolException {
       }
   
  -    public Protocol getUp() {
  +    public Protocol getUpProtocol() {
           return null;
       }
   
  -    public void setUp(Protocol up) {
  +    public void setUpProtocol(Protocol up) {
       }
   
  -    public Protocol getDown() {
  +    public Protocol getDownProtocol() {
           return null;
       }
   
  -    public void setDown(Protocol down) {
  +    public void setDownProtocol(Protocol down) {
       }
   
       public void clearLinks() {
  
  
  
  1.3       +10 -7     incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/totem/replication/TotemReplicationProtocol.java
  
  Index: TotemReplicationProtocol.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/totem/replication/TotemReplicationProtocol.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TotemReplicationProtocol.java	10 Mar 2004 09:59:15 -0000	1.2
  +++ TotemReplicationProtocol.java	17 Mar 2004 03:12:00 -0000	1.3
  @@ -28,10 +28,13 @@
    */
   public class TotemReplicationProtocol implements Protocol {
   
  -    public void doStart() throws ProtocolException {
  +    public void setup() throws ProtocolException {
       }
   
  -    public void doStop() throws ProtocolException {
  +    public void drain() throws ProtocolException {
  +    }
  +
  +    public void teardown() throws ProtocolException {
       }
   
       public void sendUp(UpPacket packet) throws ProtocolException {
  @@ -40,18 +43,18 @@
       public void sendDown(DownPacket packet) throws ProtocolException {
       }
   
  -    public Protocol getUp() {
  +    public Protocol getUpProtocol() {
           return null;
       }
   
  -    public void setUp(Protocol up) {
  +    public void setUpProtocol(Protocol up) {
       }
   
  -    public Protocol getDown() {
  +    public Protocol getDownProtocol() {
           return null;
       }
   
  -    public void setDown(Protocol down) {
  +    public void setDownProtocol(Protocol down) {
       }
   
       public void clearLinks() {
  
  
  
  1.3       +10 -7     incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/totem/singlering/SingleTotemRingProtocol.java
  
  Index: SingleTotemRingProtocol.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/totem/singlering/SingleTotemRingProtocol.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SingleTotemRingProtocol.java	10 Mar 2004 09:59:15 -0000	1.2
  +++ SingleTotemRingProtocol.java	17 Mar 2004 03:12:00 -0000	1.3
  @@ -28,10 +28,13 @@
    */
   public class SingleTotemRingProtocol implements Protocol {
   
  -    public void doStart() throws ProtocolException {
  +    public void setup() throws ProtocolException {
       }
   
  -    public void doStop() throws ProtocolException {
  +    public void drain() throws ProtocolException {
  +    }
  +
  +    public void teardown() throws ProtocolException {
       }
   
       public void sendUp(UpPacket packet) throws ProtocolException {
  @@ -40,18 +43,18 @@
       public void sendDown(DownPacket packet) throws ProtocolException {
       }
   
  -    public Protocol getUp() {
  +    public Protocol getUpProtocol() {
           return null;
       }
   
  -    public void setUp(Protocol up) {
  +    public void setUpProtocol(Protocol up) {
       }
   
  -    public Protocol getDown() {
  +    public Protocol getDownProtocol() {
           return null;
       }
   
  -    public void setDown(Protocol down) {
  +    public void setDownProtocol(Protocol down) {
       }
   
       public void clearLinks() {
  
  
  
  1.4       +25 -19    incubator-geronimo/modules/network/src/test/org/apache/geronimo/network/protocol/DatagramProtocolTest.java
  
  Index: DatagramProtocolTest.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/network/src/test/org/apache/geronimo/network/protocol/DatagramProtocolTest.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DatagramProtocolTest.java	14 Mar 2004 00:11:29 -0000	1.3
  +++ DatagramProtocolTest.java	17 Mar 2004 03:12:00 -0000	1.4
  @@ -49,20 +49,20 @@
           sm.doStart();
   
           DatagramProtocol dgp = new DatagramProtocol();
  -        dgp.setUp(new Protocol() {
  -            public Protocol getUp() {
  +        dgp.setUpProtocol(new Protocol() {
  +            public Protocol getUpProtocol() {
                   throw new NoSuchMethodError();
               }
   
  -            public void setUp(Protocol up) {
  +            public void setUpProtocol(Protocol up) {
                   throw new NoSuchMethodError();
               }
   
  -            public Protocol getDown() {
  +            public Protocol getDownProtocol() {
                   throw new NoSuchMethodError();
               }
   
  -            public void setDown(Protocol down) {
  +            public void setDownProtocol(Protocol down) {
                   throw new NoSuchMethodError();
               }
   
  @@ -73,10 +73,13 @@
                   return (Protocol) super.clone();
               }
   
  -            public void doStart() {
  +            public void setup() {
               }
   
  -            public void doStop() {
  +            public void drain() {
  +            }
  +
  +            public void teardown() throws ProtocolException {
               }
   
               public void sendUp(UpPacket packet) {
  @@ -93,7 +96,7 @@
           dgp.setSourceAddress(new InetSocketAddress("localhost", 0));
           dgp.setSelectorManager(sm);
   
  -        dgp.doStart();
  +        dgp.setup();
   
           DatagramDownPacket packet = new DatagramDownPacket();
           packet.setAddress(new InetSocketAddress(dgp.getConnectURI().getHost(), dgp.getConnectURI().getPort()));
  @@ -105,7 +108,7 @@
   
           Thread.sleep(1 * 1000);
   
  -        dgp.doStop();
  +        dgp.drain();
   
           sm.doStop();
   
  @@ -126,20 +129,20 @@
           sm.doStart();
   
           DatagramProtocol dgp = new DatagramProtocol();
  -        dgp.setUp(new Protocol() {
  -            public Protocol getUp() {
  +        dgp.setUpProtocol(new Protocol() {
  +            public Protocol getUpProtocol() {
                   throw new NoSuchMethodError();
               }
   
  -            public void setUp(Protocol up) {
  +            public void setUpProtocol(Protocol up) {
                   throw new NoSuchMethodError();
               }
   
  -            public Protocol getDown() {
  +            public Protocol getDownProtocol() {
                   throw new NoSuchMethodError();
               }
   
  -            public void setDown(Protocol down) {
  +            public void setDownProtocol(Protocol down) {
                   throw new NoSuchMethodError();
               }
   
  @@ -150,10 +153,13 @@
                   return (Protocol) super.clone();
               }
   
  -            public void doStart() {
  +            public void setup() {
  +            }
  +
  +            public void drain() {
               }
   
  -            public void doStop() {
  +            public void teardown() throws ProtocolException {
               }
   
               public void sendUp(UpPacket packet) {
  @@ -172,7 +178,7 @@
   
           DatagramProtocol dgp2 = (DatagramProtocol) dgp.cloneProtocol();
   
  -        dgp2.doStart();
  +        dgp2.setup();
   
           DatagramDownPacket packet = new DatagramDownPacket();
           packet.setAddress(new InetSocketAddress("localhost", 8081));
  @@ -184,7 +190,7 @@
   
           Thread.sleep(5 * 1000);
   
  -        dgp2.doStop();
  +        dgp2.drain();
   
           sm.doStop();
   
  
  
  
  1.5       +6 -6      incubator-geronimo/modules/network/src/test/org/apache/geronimo/network/protocol/GSSAPIProtocolTest.java
  
  Index: GSSAPIProtocolTest.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/network/src/test/org/apache/geronimo/network/protocol/GSSAPIProtocolTest.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- GSSAPIProtocolTest.java	14 Mar 2004 01:01:20 -0000	1.4
  +++ GSSAPIProtocolTest.java	17 Mar 2004 03:12:00 -0000	1.5
  @@ -118,7 +118,7 @@
   
               clientStack.push(ccp);
   
  -            clientStack.doStart();
  +            clientStack.setup();
               Thread.sleep(5 * 1000); //todo delete
   
               clientStack.sendDown(getPlainPacket());
  @@ -127,7 +127,7 @@
   
               Thread.sleep(5 * 1000); //todo back to 5s
   
  -            clientStack.doStop();
  +            clientStack.drain();
   
               shutdownLatch.release();
   
  @@ -236,15 +236,15 @@
               ssa.setTimeOut(5 * 1000);
               ssa.setUri(new URI("async://localhost:0/?tcp.nodelay=true&tcp.backlog=5#"));
               ssa.setAcceptorListener(pf);
  -            ssa.doStart();
  +            ssa.startup();
   
               startLatch.release();
   
               shutdownLatch.acquire();
   
  -            ssa.doStop();
  +            ssa.drain();
   
  -            pf.doStop();
  +            pf.drain();
   
               sm.doStop();
   
  
  
  
  1.4       +17 -14    incubator-geronimo/modules/network/src/test/org/apache/geronimo/network/protocol/ProtocolStackTest.java
  
  Index: ProtocolStackTest.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/network/src/test/org/apache/geronimo/network/protocol/ProtocolStackTest.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ProtocolStackTest.java	14 Mar 2004 01:01:20 -0000	1.3
  +++ ProtocolStackTest.java	17 Mar 2004 03:12:00 -0000	1.4
  @@ -80,23 +80,23 @@
           ssa.setTimeOut(5 * 1000);
           ssa.setUri(new URI("async://localhost:0/?tcp.nodelay=true&tcp.backlog=5#"));
           ssa.setAcceptorListener(pf);
  -        ssa.doStart();
  +        ssa.startup();
   
           SocketProtocol sp = new SocketProtocol();
  -        sp.setUp(new Protocol() {
  -            public Protocol getUp() {
  +        sp.setUpProtocol(new Protocol() {
  +            public Protocol getUpProtocol() {
                   throw new NoSuchMethodError();
               }
   
  -            public void setUp(Protocol up) {
  +            public void setUpProtocol(Protocol up) {
                   throw new NoSuchMethodError();
               }
   
  -            public Protocol getDown() {
  +            public Protocol getDownProtocol() {
                   throw new NoSuchMethodError();
               }
   
  -            public void setDown(Protocol down) {
  +            public void setDownProtocol(Protocol down) {
                   throw new NoSuchMethodError();
               }
   
  @@ -107,10 +107,13 @@
                   return (Protocol) super.clone();
               }
   
  -            public void doStart() {
  +            public void setup() {
               }
   
  -            public void doStop() {
  +            public void drain() {
  +            }
  +
  +            public void teardown() throws ProtocolException {
               }
   
               public void sendUp(UpPacket packet) {
  @@ -126,7 +129,7 @@
           sp.setAddress(new InetSocketAddress(ssa.getConnectURI().getHost(), ssa.getConnectURI().getPort()));
           sp.setSelectorManager(sm);
   
  -        sp.doStart();
  +        sp.setup();
   
   
           sp.sendDown(getDatagramPacket());
  @@ -139,13 +142,13 @@
   
           Thread.sleep(5 * 1000);
   
  -        sp.doStop();
  +        sp.drain();
   
  -        ssa.doStop();
  +        ssa.drain();
   
  -        pf.doStop();
  +        pf.drain();
   
  -        spt.doStop();
  +        spt.drain();
   
           sm.doStop();
   
  
  
  
  1.4       +27 -21    incubator-geronimo/modules/network/src/test/org/apache/geronimo/network/protocol/SocketProtocolStressTest.java
  
  Index: SocketProtocolStressTest.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/network/src/test/org/apache/geronimo/network/protocol/SocketProtocolStressTest.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SocketProtocolStressTest.java	14 Mar 2004 01:01:20 -0000	1.3
  +++ SocketProtocolStressTest.java	17 Mar 2004 03:12:00 -0000	1.4
  @@ -116,20 +116,20 @@
           sm.doStart();
   
           spt = new SocketProtocol();
  -        spt.setUp(new Protocol() {
  -            public Protocol getUp() {
  +        spt.setUpProtocol(new Protocol() {
  +            public Protocol getUpProtocol() {
                   throw new NoSuchMethodError();
               }
   
  -            public void setUp(Protocol up) {
  +            public void setUpProtocol(Protocol up) {
                   throw new NoSuchMethodError();
               }
   
  -            public Protocol getDown() {
  +            public Protocol getDownProtocol() {
                   throw new NoSuchMethodError();
               }
   
  -            public void setDown(Protocol down) {
  +            public void setDownProtocol(Protocol down) {
                   throw new NoSuchMethodError();
               }
   
  @@ -140,10 +140,13 @@
                   return (Protocol) super.clone();
               }
   
  -            public void doStart() {
  +            public void setup() {
               }
   
  -            public void doStop() {
  +            public void drain() {
  +            }
  +
  +            public void teardown() throws ProtocolException {
               }
   
               public void sendUp(UpPacket packet) {
  @@ -169,23 +172,23 @@
           ssa.setTimeOut(5 * 1000);
           ssa.setUri(new URI("async://localhost:0/?tcp.nodelay=true&tcp.backlog=5#"));
           ssa.setAcceptorListener(pf);
  -        ssa.doStart();
  +        ssa.startup();
   
           sp = new SocketProtocol();
  -        sp.setUp(new Protocol() {
  -            public Protocol getUp() {
  +        sp.setUpProtocol(new Protocol() {
  +            public Protocol getUpProtocol() {
                   throw new NoSuchMethodError();
               }
   
  -            public void setUp(Protocol up) {
  +            public void setUpProtocol(Protocol up) {
                   throw new NoSuchMethodError();
               }
   
  -            public Protocol getDown() {
  +            public Protocol getDownProtocol() {
                   throw new NoSuchMethodError();
               }
   
  -            public void setDown(Protocol down) {
  +            public void setDownProtocol(Protocol down) {
                   throw new NoSuchMethodError();
               }
   
  @@ -196,10 +199,13 @@
                   return (Protocol) super.clone();
               }
   
  -            public void doStart() {
  +            public void setup() {
  +            }
  +
  +            public void drain() {
               }
   
  -            public void doStop() {
  +            public void teardown() throws ProtocolException {
               }
   
               public void sendUp(UpPacket packet) {
  @@ -215,17 +221,17 @@
           sp.setAddress(new InetSocketAddress(ssa.getConnectURI().getHost(), ssa.getConnectURI().getPort()));
           sp.setSelectorManager(sm);
   
  -        sp.doStart();
  +        sp.setup();
       }
   
       public void tearDown() throws Exception {
  -        sp.doStop();
  +        sp.drain();
   
  -        ssa.doStop();
  +        ssa.drain();
   
  -        pf.doStop();
  +        pf.drain();
   
  -        spt.doStop();
  +        spt.drain();
   
           sm.doStop();
   
  
  
  
  1.4       +27 -21    incubator-geronimo/modules/network/src/test/org/apache/geronimo/network/protocol/SocketProtocolTest.java
  
  Index: SocketProtocolTest.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/network/src/test/org/apache/geronimo/network/protocol/SocketProtocolTest.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SocketProtocolTest.java	14 Mar 2004 01:01:20 -0000	1.3
  +++ SocketProtocolTest.java	17 Mar 2004 03:12:00 -0000	1.4
  @@ -54,20 +54,20 @@
           sm.doStart();
   
           SocketProtocol spt = new SocketProtocol();
  -        spt.setUp(new Protocol() {
  -            public Protocol getUp() {
  +        spt.setUpProtocol(new Protocol() {
  +            public Protocol getUpProtocol() {
                   throw new NoSuchMethodError();
               }
   
  -            public void setUp(Protocol up) {
  +            public void setUpProtocol(Protocol up) {
                   throw new NoSuchMethodError();
               }
   
  -            public Protocol getDown() {
  +            public Protocol getDownProtocol() {
                   throw new NoSuchMethodError();
               }
   
  -            public void setDown(Protocol down) {
  +            public void setDownProtocol(Protocol down) {
                   throw new NoSuchMethodError();
               }
   
  @@ -78,10 +78,13 @@
                   return (Protocol) super.clone();
               }
   
  -            public void doStart() {
  +            public void setup() {
               }
   
  -            public void doStop() {
  +            public void drain() {
  +            }
  +
  +            public void teardown() throws ProtocolException {
               }
   
               public void sendUp(UpPacket packet) {
  @@ -107,23 +110,23 @@
           ssa.setTimeOut(5 * 1000);
           ssa.setUri(new URI("async://localhost:0/?tcp.nodelay=true&tcp.backlog=5#"));
           ssa.setAcceptorListener(pf);
  -        ssa.doStart();
  +        ssa.startup();
   
           SocketProtocol sp = new SocketProtocol();
  -        sp.setUp(new Protocol() {
  -            public Protocol getUp() {
  +        sp.setUpProtocol(new Protocol() {
  +            public Protocol getUpProtocol() {
                   throw new NoSuchMethodError();
               }
   
  -            public void setUp(Protocol up) {
  +            public void setUpProtocol(Protocol up) {
                   throw new NoSuchMethodError();
               }
   
  -            public Protocol getDown() {
  +            public Protocol getDownProtocol() {
                   throw new NoSuchMethodError();
               }
   
  -            public void setDown(Protocol down) {
  +            public void setDownProtocol(Protocol down) {
                   throw new NoSuchMethodError();
               }
   
  @@ -134,10 +137,13 @@
                   return (Protocol) super.clone();
               }
   
  -            public void doStart() {
  +            public void setup() {
  +            }
  +
  +            public void drain() {
               }
   
  -            public void doStop() {
  +            public void teardown() throws ProtocolException {
               }
   
               public void sendUp(UpPacket packet) {
  @@ -153,7 +159,7 @@
           sp.setAddress(new InetSocketAddress(ssa.getConnectURI().getHost(), ssa.getConnectURI().getPort()));
           sp.setSelectorManager(sm);
   
  -        sp.doStart();
  +        sp.setup();
   
   
           sp.sendDown(getDatagramPacket());
  @@ -166,13 +172,13 @@
   
           Thread.sleep(5 * 1000);
   
  -        sp.doStop();
  +        sp.drain();
   
  -        ssa.doStop();
  +        ssa.drain();
   
  -        pf.doStop();
  +        pf.drain();
   
  -        spt.doStop();
  +        spt.drain();
   
           sm.doStop();
   
  
  
  
  1.3       +8 -5      incubator-geronimo/modules/network/src/test/org/apache/geronimo/network/protocol/TestProtocol.java
  
  Index: TestProtocol.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/network/src/test/org/apache/geronimo/network/protocol/TestProtocol.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TestProtocol.java	10 Mar 2004 09:59:15 -0000	1.2
  +++ TestProtocol.java	17 Mar 2004 03:12:00 -0000	1.3
  @@ -83,10 +83,13 @@
           this.selectorManager = selectorManager;
       }
   
  -    public void doStart() throws ProtocolException {
  +    public void setup() throws ProtocolException {
       }
   
  -    public void doStop() throws ProtocolException {
  +    public void drain() throws ProtocolException {
  +    }
  +
  +    public void teardown() throws ProtocolException {
       }
   
       public void sendUp(UpPacket packet) throws ProtocolException {
  @@ -101,12 +104,12 @@
           Subject subject = MetadataSupport.getSubject(packet);
           if (subject != null) log.trace("Subject passed: " + subject);
   
  -        if (getUp() != null) getUp().sendUp(packet);
  +        if (getUpProtocol() != null) getUpProtocol().sendUp(packet);
       }
   
       public void sendDown(DownPacket packet) throws ProtocolException {
           log.trace("sendDown");
  -        getDown().sendDown(packet);
  +        getDownProtocol().sendDown(packet);
       }
   
       public Collection cook(ControlContext context) {
  
  
  
  1.4       +6 -6      incubator-geronimo/modules/network/src/test/org/apache/geronimo/network/protocol/control/ControlProtocolTest.java
  
  Index: ControlProtocolTest.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/network/src/test/org/apache/geronimo/network/protocol/control/ControlProtocolTest.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ControlProtocolTest.java	14 Mar 2004 01:01:21 -0000	1.3
  +++ ControlProtocolTest.java	17 Mar 2004 03:12:00 -0000	1.4
  @@ -110,7 +110,7 @@
           ssa.setTimeOut(5 * 1000);
           ssa.setUri(new URI("async://localhost:0/?tcp.nodelay=true&tcp.backlog=5#"));
           ssa.setAcceptorListener(pf);
  -        ssa.doStart();
  +        ssa.startup();
   
           ControlClientProtocolStack clientStack = new ControlClientProtocolStack();
           clientStack.setClassLoader(Thread.currentThread().getContextClassLoader());
  @@ -131,7 +131,7 @@
   
           clientStack.push(ccp);
   
  -        clientStack.doStart();
  +        clientStack.setup();
   
           clientStack.sendDown(getDatagramPacket());
           clientStack.sendDown(getDatagramPacket());
  @@ -139,13 +139,13 @@
   
           Thread.sleep(5 * 1000);
   
  -        clientStack.doStop();
  +        clientStack.drain();
   
           Thread.sleep(5 * 1000);
   
  -        ssa.doStop();
  +        ssa.drain();
   
  -        pf.doStop();
  +        pf.drain();
   
           sm.doStop();
   
  
  
  

Mime
View raw message