[Ubermq-commits] jms/src/com/ubermq/jms/server/datagram/impl DatagramFactory.java,1.14,1.15
Brought to you by:
jimmyp
From: <ji...@us...> - 2002-10-10 20:03:31
|
Update of /cvsroot/ubermq/jms/src/com/ubermq/jms/server/datagram/impl In directory usw-pr-cvs1:/tmp/cvs-serv5241/src/com/ubermq/jms/server/datagram/impl Modified Files: DatagramFactory.java Log Message: some cool optimizations. Index: DatagramFactory.java =================================================================== RCS file: /cvsroot/ubermq/jms/src/com/ubermq/jms/server/datagram/impl/DatagramFactory.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** DatagramFactory.java 10 Oct 2002 14:32:34 -0000 1.14 --- DatagramFactory.java 10 Oct 2002 20:02:58 -0000 1.15 *************** *** 5,8 **** --- 5,9 ---- import com.ubermq.kernel.*; + import java.io.IOException; import java.nio.ByteBuffer; *************** *** 67,79 **** public static DatagramFactoryHolder getHolder() {return theHolder;} - /** - * Chances are, the buffer position is resting exactly on a datagram - * boundary. If this is the case, our job is simple. - * - * If it is not the case, generally we punt and ask for a packet of - * length one at the buffer's limit. - */ public int frame(ByteBuffer bb) ! throws IllegalStateException { if (bb.remaining() < UBERMQ_HEADER_LENGTH) --- 68,73 ---- public static DatagramFactoryHolder getHolder() {return theHolder;} public int frame(ByteBuffer bb) ! throws IOException { if (bb.remaining() < UBERMQ_HEADER_LENGTH) *************** *** 85,89 **** return UBERMQ_HEADER_LENGTH + bb.getInt(); } else { ! throw new IllegalStateException(); } } finally { --- 79,83 ---- return UBERMQ_HEADER_LENGTH + bb.getInt(); } else { ! throw new IOException(); } } finally { *************** *** 92,102 **** } - - /** - * this method knows how to parse the generic datagram headers - * in order to determine which datagram class should handle - * the parsing. - * - */ public IDatagram incoming(ByteBuffer bb) throws IllegalArgumentException --- 86,89 ---- *************** *** 114,118 **** d.incoming(bb); return d; ! } catch(Exception io) {throw new IllegalArgumentException(io.toString());} } --- 101,107 ---- d.incoming(bb); return d; ! } ! catch(IllegalArgumentException iae) {throw iae;} ! catch(Exception io) {throw new IllegalArgumentException(io.toString());} } |