[Ubermq-commits] jms/src/com/ubermq/jms/server/journal DurableSubscriptionProxy.java,1.21,1.22
Brought to you by:
jimmyp
From: <ji...@us...> - 2002-10-22 20:32:26
|
Update of /cvsroot/ubermq/jms/src/com/ubermq/jms/server/journal In directory usw-pr-cvs1:/tmp/cvs-serv21195/src/com/ubermq/jms/server/journal Modified Files: DurableSubscriptionProxy.java Log Message: Add a new delivery mode, GUARANTEED_PROCESSING, that indicates a publish() call should fail if a registered durable subscription is disconnected. Allows the creation of fail-fast, guaranteed messaging in addition to the normal JMS modus operandi. Index: DurableSubscriptionProxy.java =================================================================== RCS file: /cvsroot/ubermq/jms/src/com/ubermq/jms/server/journal/DurableSubscriptionProxy.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** DurableSubscriptionProxy.java 18 Oct 2002 16:59:30 -0000 1.21 --- DurableSubscriptionProxy.java 22 Oct 2002 20:32:23 -0000 1.22 *************** *** 2,5 **** --- 2,6 ---- import EDU.oswego.cs.dl.util.concurrent.*; + import com.ubermq.jms.client.DeliveryMode; import com.ubermq.jms.server.*; import com.ubermq.jms.server.datagram.*; *************** *** 260,263 **** --- 261,275 ---- } + /** + * Outputs a datagram. + * + * @param d an IDatagram + * @param h an IOverflowHandler + * + * @throws IOException if an IO error occurs. + * @throws IllegalStateException if the proxy is disconnected, + * and the message delivery mode requires the subscriber + * to process the message. + */ public synchronized void output(IDatagram d, IOverflowHandler h) throws IOException *************** *** 265,271 **** // output the datagram to the recovery buffer; // if we overflow, compress the buffer and try again. // we remember if we are connected by setting flag bits. ! if (!proxyFor.isOpen()) d.setDatagramFlagBits(DGF_LOGGED_DISCONNECTED); journal.output(d, h); --- 277,301 ---- // output the datagram to the recovery buffer; // if we overflow, compress the buffer and try again. + // we remember if we are connected by setting flag bits. ! // if we are not connected, using the GUARNATEED_PROCESSING delivery mode ! // will cause an IllegalStateException and refuse the message delivery. ! if (!proxyFor.isOpen()) { ! if (d instanceof IMessageDatagram) ! { ! int deliveryMode = ((Number)((IMessageDatagram)d).getStandardProperty(IMessageDatagram.STDPROP_DELIVERYMODE)).intValue(); ! ! // if the delivery mode requires ! // guaranteed processing, we bail out if the proxy is ! // not open. ! if (deliveryMode == DeliveryMode.GUARANTEED_PROCESSING) ! { ! throw new IllegalStateException("Guaranteed processing required, but the subscriber is disconnected."); ! } ! } ! ! // remember that we were disconnected. d.setDatagramFlagBits(DGF_LOGGED_DISCONNECTED); + } journal.output(d, h); |