[Beepcore-java-commits] CVS: beepcore-java/src/org/beepcore/beep/lib ChannelPool.java,1.3,1.4 NullRe
Status: Beta
Brought to you by:
huston
From: Huston F. <hu...@us...> - 2001-10-31 00:32:40
|
Update of /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/lib In directory usw-pr-cvs1:/tmp/cvs-serv24137/src/org/beepcore/beep/lib Modified Files: ChannelPool.java NullReplyListener.java Reply.java SharedChannel.java Log Message: New *DataStream Index: ChannelPool.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/lib/ChannelPool.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** ChannelPool.java 2001/07/18 21:03:41 1.3 --- ChannelPool.java 2001/10/31 00:32:37 1.4 *************** *** 20,24 **** import org.beepcore.beep.core.BEEPException; ! import org.beepcore.beep.core.DataListener; import org.beepcore.beep.core.Session; --- 20,24 ---- import org.beepcore.beep.core.BEEPException; ! import org.beepcore.beep.core.MessageListener; import org.beepcore.beep.core.Session; *************** *** 155,159 **** * @throws BEEPException */ ! synchronized public SharedChannel getSharedChannel(String profile, DataListener listener) throws BEEPException { --- 155,159 ---- * @throws BEEPException */ ! synchronized public SharedChannel getSharedChannel(String profile, MessageListener listener) throws BEEPException { Index: NullReplyListener.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/lib/NullReplyListener.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** NullReplyListener.java 2001/04/16 20:02:16 1.2 --- NullReplyListener.java 2001/10/31 00:32:37 1.3 *************** *** 46,58 **** public void receiveRPY(Message message) { ! ((FrameDataStream)message.getDataStream()).close(); } public void receiveERR(Message message) { ! ((FrameDataStream)message.getDataStream()).close(); } public void receiveANS(Message message) { ! ((FrameDataStream)message.getDataStream()).close(); } public void receiveNUL(Message message) --- 46,58 ---- public void receiveRPY(Message message) { ! message.getDataStream().close(); } public void receiveERR(Message message) { ! message.getDataStream().close(); } public void receiveANS(Message message) { ! message.getDataStream().close(); } public void receiveNUL(Message message) Index: Reply.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/lib/Reply.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** Reply.java 2001/04/26 18:33:14 1.4 --- Reply.java 2001/10/31 00:32:37 1.5 *************** *** 79,87 **** synchronized public Message getNextReply() throws BEEPInterruptedException { - if (this.complete) { - throw new NoSuchElementException(); - } - if (this.replies.size() == 0) { try { this.wait(); --- 79,87 ---- synchronized public Message getNextReply() throws BEEPInterruptedException { if (this.replies.size() == 0) { + if (this.complete) { + throw new NoSuchElementException(); + } + try { this.wait(); Index: SharedChannel.java =================================================================== RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/lib/SharedChannel.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** SharedChannel.java 2001/07/03 20:51:28 1.3 --- SharedChannel.java 2001/10/31 00:32:37 1.4 *************** *** 1,3 **** - /* * SharedChannel.java $Revision$ $Date$ --- 1,2 ---- *************** *** 8,12 **** * "License"); You may not use this file except in compliance with the License. * ! * You may obtain a copy of the License at http://www.invisible.net/ * * Software distributed under the License is distributed on an "AS IS" basis, --- 7,11 ---- * "License"); You may not use this file except in compliance with the License. * ! * You may obtain a copy of the License at http://www.beepcore.org/ * * Software distributed under the License is distributed on an "AS IS" basis, *************** *** 22,29 **** import org.beepcore.beep.core.BEEPException; import org.beepcore.beep.core.Channel; - import org.beepcore.beep.core.DataListener; - import org.beepcore.beep.core.DataStream; import org.beepcore.beep.core.Message; import org.beepcore.beep.core.MessageStatus; import org.beepcore.beep.core.ReplyListener; import org.beepcore.beep.core.Session; --- 21,28 ---- import org.beepcore.beep.core.BEEPException; import org.beepcore.beep.core.Channel; import org.beepcore.beep.core.Message; + import org.beepcore.beep.core.MessageListener; import org.beepcore.beep.core.MessageStatus; + import org.beepcore.beep.core.OutputDataStream; import org.beepcore.beep.core.ReplyListener; import org.beepcore.beep.core.Session; *************** *** 65,69 **** { super(channel.getProfile(), String.valueOf(channel.getNumber()), ! channel.getDataListener(), channel.getSession()); this.channel = channel; --- 64,68 ---- { super(channel.getProfile(), String.valueOf(channel.getNumber()), ! channel.getMessageListener(), channel.getSession()); this.channel = channel; *************** *** 89,115 **** /** - * Send a message of type ANS. Sends <code>stream</code> as message's - * payload. - * An ANS type message is one of many to be sent in response and must be - * terminated with a NUL. - * - * @param stream <code>DataStream</code> to send. - * - * @see DataStream - * @see MessageStatus - * @see #sendNUL - * - * @return MessageStutas Can be queried to get status information about the - * message. - * - * @throws BEEPException - * @deprecated - */ - public MessageStatus sendANS(DataStream stream) throws BEEPException - { - return channel.sendANS(stream); - } - - /** * Send a message of type MSG. Sends <code>stream</code> as message's * payload. --- 88,91 ---- *************** *** 128,132 **** * @deprecated */ ! public MessageStatus sendMSG(DataStream stream, ReplyListener replyListener) throws BEEPException { --- 104,109 ---- * @deprecated */ ! public MessageStatus sendMSG(OutputDataStream stream, ! ReplyListener replyListener) throws BEEPException { *************** *** 135,236 **** /** - * Send a NUL message type to terminate a sequence of ANSs. - * Note: If the stream is not complete, then the send will block - * until it is finished. - * - * @return MessageStutas Can be queried to get status information about the - * message. - * - * @see MessageStatus - * - * @throws BEEPException - * @deprecated - */ - public MessageStatus sendNUL() throws BEEPException - { - return channel.sendNUL(); - } - - /** - * Send a message of type RPY. Sends <code>stream</code> as message's - * payload. - * Note: If the stream is not complete, then the send will block - * until it is finished (a <code>read</code> returns a -1). - * - * @param stream <code>DataStream</code> that is read to send data. - * - * @return MessageStutas Can be queried to get status information about the - * message. - * - * @see DataStream - * @see MessageStatus - * - * @throws BEEPException - * @deprecated - */ - public MessageStatus sendRPY(DataStream stream) throws BEEPException - { - return channel.sendRPY(stream); - } - - /** - * Sends a message of type ERR. - * - * @param error Error to send in the form of <code>BEEPError</code>. - * - * @see BEEPError - * @see MessageStatus - * - * @return MessageStatus - * - * @throws BEEPException if an error is encoutered. - * @deprecated - */ - public MessageStatus sendERR(BEEPError error) throws BEEPException - { - return channel.sendERR(error); - } - - /** - * Sends a message of type ERR. - * - * @param code <code>code</code> attibute in <code>error</code> element. - * @param diagnostic Message for <code>error</code> element. - * - * @see MessageStatus - * - * @return MessageStatus - * - * @throws BEEPException if an error is encoutered. - * @deprecated - */ - public MessageStatus sendERR(int code, String diagnostic) - throws BEEPException - { - return channel.sendERR(code, diagnostic); - } - - /** - * Sends a message of type ERR. - * - * @param code <code>code</code> attibute in <code>error</code> element. - * @param diagnostic Message for <code>error</code> element. - * @param xmlLang <code>xml:lang</code> attibute in <code>error</code> - * element. - * - * @see MessageStatus - * - * @return MessageStatus - * - * @throws BEEPException if an error is encoutered. - * @deprecated - */ - public MessageStatus sendERR(int code, String diagnostic, String xmlLang) - throws BEEPException - { - return channel.sendERR(code, diagnostic, xmlLang); - } - - /** * Sets the <code>DataListener</code> for this <code>SharedChannel</code>. * --- 112,115 ---- *************** *** 239,245 **** * */ ! public void setDataListener(DataListener dl) { ! channel.setDataListener(dl); } --- 118,124 ---- * */ ! public MessageListener setMessageListener(MessageListener dl) { ! return channel.setMessageListener(dl); } *************** *** 259,265 **** } ! public DataListener getDataListener() { ! return channel.getDataListener(); } --- 138,144 ---- } ! public MessageListener getMessageListener() { ! return channel.getMessageListener(); } *************** *** 314,318 **** * */ ! public Reply sendRequest(DataStream ds) throws BEEPException { Reply r = new Reply(); --- 193,197 ---- * */ ! public Reply sendRequest(OutputDataStream ds) throws BEEPException { Reply r = new Reply(); |