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 DatagramProtocolTest.java ProtocolStackTest.java SocketProtocolStressTest.java SocketProtocolTest.java TestProtocol.java
Date Sun, 01 Aug 2004 13:03:52 GMT
adc         2004/08/01 06:03:52

  Modified:    modules/network/src/java/org/apache/geronimo/network/protocol
                        AcceptableProtocolStack.java BufferProtocol.java
                        ChecksumProtocol.java ChunkingProtocol.java
                        CountingProtocol.java DatagramProtocol.java
                        DoNothingProtocol.java EchoDownProtocol.java
                        EchoUpProtocol.java GSSAPIClientProtocol.java
                        GSSAPIServerProtocol.java LossyProtocol.java
                        MulticastProtocol.java PacketInputStream.java
                        Protocol.java ProtocolStack.java
                        SASLClientProtocol.java SASLServerProtocol.java
                        SSLSocketProtocol.java SigningProtocol.java
                        SocketProtocol.java TokenRingProtocol.java
               modules/network/src/java/org/apache/geronimo/network/protocol/control
                        ControlClientProtocol.java
                        ControlClientProtocolKitchen.java
                        ControlServerProtocol.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 ProtocolStackTest.java
                        SocketProtocolStressTest.java
                        SocketProtocolTest.java TestProtocol.java
  Log:
  Added a flush method.
  
  Revision  Changes    Path
  1.4       +5 -1      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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- AcceptableProtocolStack.java	17 Mar 2004 03:11:59 -0000	1.3
  +++ AcceptableProtocolStack.java	1 Aug 2004 13:03:37 -0000	1.4
  @@ -126,6 +126,10 @@
           top.sendDown(packet);
       }
   
  +    public void flush() throws ProtocolException {
  +        top.flush();
  +    }
  +
       public void accept(SocketChannel socketChannel) {
           bottom.accept(socketChannel);
       }
  
  
  
  1.7       +15 -3     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.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- BufferProtocol.java	11 Jul 2004 21:45:37 -0000	1.6
  +++ BufferProtocol.java	1 Aug 2004 13:03:42 -0000	1.7
  @@ -60,7 +60,7 @@
                   public void run() {
                       try {
                           while (running) {
  -                            UpPacket packet = (UpPacket) upQueue.poll(500);
  +                            UpPacket packet = (UpPacket) upQueue.take();
                               if (packet != null) getUpProtocol().sendUp(packet);
                           }
                       } catch (InterruptedException e) {
  @@ -74,7 +74,7 @@
                   public void run() {
                       try {
                           while (running) {
  -                            DownPacket packet = (DownPacket) downQueue.poll(500);
  +                            DownPacket packet = (DownPacket) downQueue.take();
                               if (packet != null) getDownProtocol().sendDown(packet);
                           }
                       } catch (InterruptedException e) {
  @@ -112,6 +112,18 @@
               downQueue.put(packet);
           } catch (InterruptedException e) {
               throw new ProtocolException(e);
  +        }
  +    }
  +
  +    public void flush() throws ProtocolException {
  +        try {
  +            while (running) {
  +                // TODO: should subclass off of this queue to avoid sleeping.
  +                DownPacket packet = (DownPacket) downQueue.peek();
  +                if (packet == null) break;
  +                Thread.sleep(50);
  +            }
  +        } catch (InterruptedException e) {
           }
       }
   
  
  
  
  1.4       +3 -1      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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ChecksumProtocol.java	17 Mar 2004 03:11:59 -0000	1.3
  +++ ChecksumProtocol.java	1 Aug 2004 13:03:42 -0000	1.4
  @@ -37,4 +37,6 @@
       public void sendDown(DownPacket packet) throws ProtocolException {
       }
   
  +    public void flush() throws ProtocolException {
  +    }
   }
  
  
  
  1.4       +3 -1      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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ChunkingProtocol.java	17 Mar 2004 03:11:59 -0000	1.3
  +++ ChunkingProtocol.java	1 Aug 2004 13:03:42 -0000	1.4
  @@ -37,4 +37,6 @@
       public void sendDown(DownPacket packet) throws ProtocolException {
       }
   
  +    public void flush() throws ProtocolException {
  +    }
   }
  
  
  
  1.4       +5 -1      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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- CountingProtocol.java	17 Mar 2004 03:11:59 -0000	1.3
  +++ CountingProtocol.java	1 Aug 2004 13:03:42 -0000	1.4
  @@ -74,6 +74,10 @@
           getDownProtocol().sendDown(packet);
       }
   
  +    public void flush() throws ProtocolException {
  +        getDownProtocol().flush();
  +    }
  +
       public Collection cook(ControlContext context) {
           CreateInstanceMenuItem item = new CreateInstanceMenuItem();
           item.setClassName(CountingProtocol.class.getName());
  
  
  
  1.7       +4 -1      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.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- DatagramProtocol.java	4 May 2004 03:05:36 -0000	1.6
  +++ DatagramProtocol.java	1 Aug 2004 13:03:42 -0000	1.7
  @@ -205,6 +205,9 @@
           }
       }
   
  +    public void flush() throws ProtocolException {
  +    }
  +
       ByteBuffer receiveBuffer = ByteBuffer.allocate(65336);
   
       public synchronized void selectionEvent(SelectorManager.Event event) {
  
  
  
  1.4       +3 -1      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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DoNothingProtocol.java	17 Mar 2004 03:11:59 -0000	1.3
  +++ DoNothingProtocol.java	1 Aug 2004 13:03:42 -0000	1.4
  @@ -37,4 +37,6 @@
       public void sendDown(DownPacket packet) throws ProtocolException {
       }
   
  +    public void flush() throws ProtocolException {
  +    }
   }
  
  
  
  1.2       +4 -1      incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/EchoDownProtocol.java
  
  Index: EchoDownProtocol.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/EchoDownProtocol.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- EchoDownProtocol.java	18 Mar 2004 04:05:27 -0000	1.1
  +++ EchoDownProtocol.java	1 Aug 2004 13:03:43 -0000	1.2
  @@ -45,4 +45,7 @@
           getDownProtocol().sendDown(packet);
       }
   
  +    public void flush() throws ProtocolException {
  +        getDownProtocol().flush();
  +    }
   }
  
  
  
  1.2       +3 -1      incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/EchoUpProtocol.java
  
  Index: EchoUpProtocol.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/EchoUpProtocol.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- EchoUpProtocol.java	18 Mar 2004 04:05:27 -0000	1.1
  +++ EchoUpProtocol.java	1 Aug 2004 13:03:43 -0000	1.2
  @@ -44,4 +44,6 @@
           getUpProtocol().sendUp(upPacket);
       }
   
  +    public void flush() throws ProtocolException {
  +    }
   }
  
  
  
  1.8       +4 -1      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.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- GSSAPIClientProtocol.java	11 Jul 2004 21:45:37 -0000	1.7
  +++ GSSAPIClientProtocol.java	1 Aug 2004 13:03:43 -0000	1.8
  @@ -211,4 +211,7 @@
           }
       }
   
  +    public void flush() throws ProtocolException {
  +        getDownProtocol().flush();
  +    }
   }
  
  
  
  1.6       +5 -1      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.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- GSSAPIServerProtocol.java	8 Jul 2004 05:13:29 -0000	1.5
  +++ GSSAPIServerProtocol.java	1 Aug 2004 13:03:43 -0000	1.6
  @@ -199,6 +199,10 @@
           }
       }
   
  +    public void flush() throws ProtocolException {
  +        getDownProtocol().flush();
  +    }
  +
       public Collection cook(ControlContext context) {
           ArrayList list = new ArrayList(6);
   
  
  
  
  1.5       +4 -1      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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- LossyProtocol.java	15 Apr 2004 23:15:55 -0000	1.4
  +++ LossyProtocol.java	1 Aug 2004 13:03:43 -0000	1.5
  @@ -76,4 +76,7 @@
           if (downRandom.nextFloat() > downLoss) getDownProtocol().sendDown(packet);
       }
   
  +    public void flush() throws ProtocolException {
  +        getDownProtocol().flush();
  +    }
   }
  
  
  
  1.4       +3 -1      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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- MulticastProtocol.java	17 Mar 2004 03:11:59 -0000	1.3
  +++ MulticastProtocol.java	1 Aug 2004 13:03:43 -0000	1.4
  @@ -37,4 +37,6 @@
       public void sendDown(DownPacket packet) throws ProtocolException {
       }
   
  +    public void flush() throws ProtocolException {
  +    }
   }
  
  
  
  1.5       +3 -1      incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/PacketInputStream.java
  
  Index: PacketInputStream.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/network/src/java/org/apache/geronimo/network/protocol/PacketInputStream.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- PacketInputStream.java	22 Apr 2004 14:45:45 -0000	1.4
  +++ PacketInputStream.java	1 Aug 2004 13:03:43 -0000	1.5
  @@ -186,5 +186,7 @@
               throw new UnsupportedOperationException("Method not implemented");
           }
   
  +        public void flush() throws ProtocolException {
  +        }
       }
   }
  
  
  
  1.4       +3 -1      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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Protocol.java	17 Mar 2004 03:11:59 -0000	1.3
  +++ Protocol.java	1 Aug 2004 13:03:43 -0000	1.4
  @@ -43,4 +43,6 @@
       void sendUp(UpPacket packet) throws ProtocolException;
   
       void sendDown(DownPacket packet) throws ProtocolException;
  +
  +    void flush() throws ProtocolException;
   }
  
  
  
  1.5       +5 -1      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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ProtocolStack.java	22 Jul 2004 03:25:30 -0000	1.4
  +++ ProtocolStack.java	1 Aug 2004 13:03:43 -0000	1.5
  @@ -124,4 +124,8 @@
       public void sendDown(DownPacket packet) throws ProtocolException {
           top.sendDown(packet);
       }
  +
  +    public void flush() throws ProtocolException {
  +        top.flush();
  +    }
   }
  
  
  
  1.5       +3 -1      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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- SASLClientProtocol.java	21 Jun 2004 20:40:23 -0000	1.4
  +++ SASLClientProtocol.java	1 Aug 2004 13:03:43 -0000	1.5
  @@ -36,4 +36,6 @@
       public void sendDown(DownPacket packet) throws ProtocolException {
       }
   
  +    public void flush() throws ProtocolException {
  +    }
   }
  
  
  
  1.5       +3 -1      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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- SASLServerProtocol.java	21 Jun 2004 20:40:23 -0000	1.4
  +++ SASLServerProtocol.java	1 Aug 2004 13:03:43 -0000	1.5
  @@ -36,4 +36,6 @@
       public void sendDown(DownPacket packet) throws ProtocolException {
       }
   
  +    public void flush() throws ProtocolException {
  +    }
   }
  
  
  
  1.4       +3 -1      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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SSLSocketProtocol.java	17 Mar 2004 03:11:59 -0000	1.3
  +++ SSLSocketProtocol.java	1 Aug 2004 13:03:43 -0000	1.4
  @@ -58,4 +58,6 @@
       public void sendDown(DownPacket packet) throws ProtocolException {
       }
   
  +    public void flush() throws ProtocolException {
  +    }
   }
  
  
  
  1.4       +3 -1      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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SigningProtocol.java	17 Mar 2004 03:11:59 -0000	1.3
  +++ SigningProtocol.java	1 Aug 2004 13:03:44 -0000	1.4
  @@ -37,4 +37,6 @@
       public void sendDown(DownPacket packet) throws ProtocolException {
       }
   
  +    public void flush() throws ProtocolException {
  +    }
   }
  
  
  
  1.15      +16 -1     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.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- SocketProtocol.java	27 Jun 2004 18:29:07 -0000	1.14
  +++ SocketProtocol.java	1 Aug 2004 13:03:44 -0000	1.15
  @@ -271,6 +271,21 @@
           }
       }
   
  +    public void flush() throws ProtocolException {
  +        try {
  +            log.trace("flush AQUIRING " + sendMutex);
  +            if (!sendMutex.attempt(timeout)) throw new ProtocolException("Send timeout.");
  +            log.trace("flush AQUIRED " + sendMutex);
  +            log.trace("flush RELEASING " + sendMutex);
  +            sendMutex.release();
  +            log.trace("flush RELEASED " + sendMutex);
  +        } catch (InterruptedException e) {
  +            log.trace("Communications error, closing connection: ", e);
  +            close();
  +            throw new ProtocolException(e);
  +        }
  +    }
  +
       public void selectionEvent(SelectorManager.Event event) {
           try {
               if (event.isReadable()) {
  
  
  
  1.4       +3 -1      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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TokenRingProtocol.java	17 Mar 2004 03:11:59 -0000	1.3
  +++ TokenRingProtocol.java	1 Aug 2004 13:03:44 -0000	1.4
  @@ -38,4 +38,6 @@
       public void sendDown(DownPacket packet) throws ProtocolException {
       }
   
  +    public void flush() throws ProtocolException {
  +    }
   }
  
  
  
  1.8       +6 -5      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.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ControlClientProtocol.java	24 Apr 2004 22:34:01 -0000	1.7
  +++ ControlClientProtocol.java	1 Aug 2004 13:03:50 -0000	1.8
  @@ -63,6 +63,7 @@
           log.trace("Stopping");
           if (state == RUN) {
               getDownProtocol().sendDown(new ShutdownRequestDownPacket());
  +            getDownProtocol().flush();
           }
       }
   
  @@ -77,6 +78,10 @@
           state.sendDown(packet);
       }
   
  +    public void flush() throws ProtocolException {
  +        getDownProtocol().flush();
  +    }
  +
       private final State START = new State(this) {
           Latch startupLatch = new Latch();
   
  @@ -126,10 +131,6 @@
               } else if (p instanceof ShutdownRequestUpPacket) {
                   log.trace("SHUTDOWN_REQ");
                   getDownProtocol().sendDown(new ShutdownAcknowledgeDownPacket());
  -                listener.shutdown();
  -                state = START;
  -            } else if (p instanceof ShutdownAcknowledgeUpPacket) {
  -                log.trace("SHUTDOWN_ACK");
                   listener.shutdown();
                   state = START;
               }
  
  
  
  1.6       +4 -1      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.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ControlClientProtocolKitchen.java	8 Jul 2004 05:13:29 -0000	1.5
  +++ ControlClientProtocolKitchen.java	1 Aug 2004 13:03:50 -0000	1.6
  @@ -154,6 +154,9 @@
               getDownProtocol().sendDown(packet);
           }
   
  +        public void flush() throws ProtocolException {
  +            getDownProtocol().flush();
  +        }
       }
   
   }
  
  
  
  1.8       +10 -15    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.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ControlServerProtocol.java	8 Jul 2004 05:13:29 -0000	1.7
  +++ ControlServerProtocol.java	1 Aug 2004 13:03:50 -0000	1.8
  @@ -108,7 +108,7 @@
       public void drain() throws ProtocolException {
           log.trace("Stopping");
   
  -        if (getState() == RUN) {
  +        if (state == RUN) {
               getDownProtocol().sendDown(new ShutdownRequestDownPacket());
           }
       }
  @@ -117,11 +117,15 @@
       }
   
       public void sendUp(UpPacket packet) throws ProtocolException {
  -        getState().sendUp(packet);
  +        state.sendUp(packet);
       }
   
       public void sendDown(DownPacket packet) throws ProtocolException {
  -        getState().sendDown(packet);
  +        state.sendDown(packet);
  +    }
  +
  +    public void flush() throws ProtocolException {
  +        getDownProtocol().flush();
       }
   
       protected DownPacket constructBootPacket() {
  @@ -153,7 +157,7 @@
               } else if (p instanceof BootSuccessUpPacket) {
                   log.trace("BOOT SUCCESS");
                   log.trace("RELEASING " + startupLatch);
  -                ((ControlServerProtocol)getParent()).setState(RUN);
  +                ((ControlServerProtocol)getParent()). state = RUN;
                   startupLatch.release();
                   log.trace("RELEASED " + startupLatch);
               }
  @@ -184,8 +188,7 @@
                   getUpProtocol().sendUp(packet);
               } else if (p instanceof ShutdownRequestUpPacket) {
                   log.trace("SHUTDOWN_REQ");
  -                getDownProtocol().sendDown(new ShutdownAcknowledgeDownPacket());
  -                ((ControlServerProtocol)getParent()).setState(START);
  +                ((ControlServerProtocol)getParent()).state = START;
                   controlServerListener.shutdown();
               }
           }
  @@ -197,14 +200,6 @@
               getDownProtocol().sendDown(passthtough);
           }
       };
  -
  -    public State getState() {
  -        return state;
  -    }
  -
  -    public void setState(State state) {
  -        this.state = state;
  -    }
   
       private volatile State state = START;
   }
  
  
  
  1.4       +4 -1      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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- MultiTotemRingProtocol.java	17 Mar 2004 03:12:00 -0000	1.3
  +++ MultiTotemRingProtocol.java	1 Aug 2004 13:03:50 -0000	1.4
  @@ -57,6 +57,9 @@
       public void setDownProtocol(Protocol down) {
       }
   
  +    public void flush() throws ProtocolException {
  +    }
  +
       public void clearLinks() {
       }
   
  
  
  
  1.4       +4 -1      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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TotemReplicationProtocol.java	17 Mar 2004 03:12:00 -0000	1.3
  +++ TotemReplicationProtocol.java	1 Aug 2004 13:03:51 -0000	1.4
  @@ -57,6 +57,9 @@
       public void setDownProtocol(Protocol down) {
       }
   
  +    public void flush() throws ProtocolException {
  +    }
  +
       public void clearLinks() {
       }
   
  
  
  
  1.4       +4 -1      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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SingleTotemRingProtocol.java	17 Mar 2004 03:12:00 -0000	1.3
  +++ SingleTotemRingProtocol.java	1 Aug 2004 13:03:51 -0000	1.4
  @@ -43,6 +43,9 @@
       public void sendDown(DownPacket packet) throws ProtocolException {
       }
   
  +    public void flush() throws ProtocolException {
  +    }
  +
       public Protocol getUpProtocol() {
           return null;
       }
  
  
  
  1.7       +5 -1      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.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- DatagramProtocolTest.java	8 Jul 2004 22:07:54 -0000	1.6
  +++ DatagramProtocolTest.java	1 Aug 2004 13:03:51 -0000	1.7
  @@ -89,6 +89,8 @@
               public void sendDown(DownPacket packet) {
               }
   
  +            public void flush() throws ProtocolException {
  +            }
           });
   
           dgp.setDestinationInterface(new InetSocketAddress("localhost", 0));
  @@ -168,6 +170,8 @@
               public void sendDown(DownPacket packet) {
               }
   
  +            public void flush() throws ProtocolException {
  +            }
           });
   
           dgp.setDestinationInterface(new InetSocketAddress("localhost", 0));
  
  
  
  1.9       +3 -1      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.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ProtocolStackTest.java	8 Jul 2004 22:07:54 -0000	1.8
  +++ ProtocolStackTest.java	1 Aug 2004 13:03:51 -0000	1.9
  @@ -122,6 +122,8 @@
               public void sendDown(DownPacket packet) {
               }
   
  +            public void flush() throws ProtocolException {
  +            }
           });
   
           sp.setTimeout(1000 * 1000);  //todo set back to 10s
  
  
  
  1.13      +5 -1      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.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- SocketProtocolStressTest.java	28 Jul 2004 17:30:45 -0000	1.12
  +++ SocketProtocolStressTest.java	1 Aug 2004 13:03:51 -0000	1.13
  @@ -141,6 +141,8 @@
               public void sendDown(DownPacket packet) {
               }
   
  +            public void flush() throws ProtocolException {
  +            }
           });
   
           pf = new ProtocolFactory();
  @@ -197,6 +199,8 @@
               public void sendDown(DownPacket packet) {
               }
   
  +            public void flush() throws ProtocolException {
  +            }
           });
   
           sp.setTimeout(60 * 1000);
  
  
  
  1.9       +5 -1      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.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- SocketProtocolTest.java	8 Jul 2004 22:07:54 -0000	1.8
  +++ SocketProtocolTest.java	1 Aug 2004 13:03:51 -0000	1.9
  @@ -95,6 +95,8 @@
               public void sendDown(DownPacket packet) {
               }
   
  +            public void flush() throws ProtocolException {
  +            }
           });
           spt.setTimeout(10 * 1000);
           spt.setSelectorManager(sm);
  @@ -153,6 +155,8 @@
               public void sendDown(DownPacket packet) {
               }
   
  +            public void flush() throws ProtocolException {
  +            }
           });
   
           sp.setTimeout(10 * 1000);
  
  
  
  1.5       +5 -1      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.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TestProtocol.java	8 Jul 2004 05:13:28 -0000	1.4
  +++ TestProtocol.java	1 Aug 2004 13:03:51 -0000	1.5
  @@ -112,6 +112,10 @@
           getDownProtocol().sendDown(packet);
       }
   
  +    public void flush() throws ProtocolException {
  +        getDownProtocol().flush();
  +    }
  +
       public Collection cook(ControlContext context) {
           ArrayList items = new ArrayList(2);
   
  
  
  

Mime
View raw message