[Ubermq-commits] jms/src/com/ubermq/jms/server/cluster ClusterTopicConnection.java,1.9,1.10 ClusterT
Brought to you by:
jimmyp
From: <ji...@us...> - 2002-10-18 17:00:03
|
Update of /cvsroot/ubermq/jms/src/com/ubermq/jms/server/cluster In directory usw-pr-cvs1:/tmp/cvs-serv28217/src/com/ubermq/jms/server/cluster Modified Files: ClusterTopicConnection.java ClusterTopicConnectionFactory.java Log Message: massive changes: 1. new failover and URL connection architecture. supports arbitrary URL schemes for registration. 2. connection state events, and a event listener framework for those events. 3. general refactoring and cleanup. Index: ClusterTopicConnection.java =================================================================== RCS file: /cvsroot/ubermq/jms/src/com/ubermq/jms/server/cluster/ClusterTopicConnection.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ClusterTopicConnection.java 10 Oct 2002 20:02:58 -0000 1.9 --- ClusterTopicConnection.java 18 Oct 2002 16:59:29 -0000 1.10 *************** *** 1,13 **** package com.ubermq.jms.server.cluster; import com.ubermq.jms.server.datagram.*; import com.ubermq.kernel.*; ! import javax.jms.*; ! ! import com.ubermq.jms.client.proc.ClientProc; ! import com.ubermq.jms.client.unicast.UnicastTopicConnection; ! import com.ubermq.jms.server.datagram.control.IClusterPeerDatagram; ! import com.ubermq.kernel.overflow.DropIncoming; ! import java.io.IOException; /** --- 1,12 ---- package com.ubermq.jms.server.cluster; + import com.ubermq.jms.client.proc.*; + import com.ubermq.jms.client.unicast.*; + import com.ubermq.jms.client.*; import com.ubermq.jms.server.datagram.*; + import com.ubermq.jms.server.datagram.control.*; import com.ubermq.kernel.*; ! import com.ubermq.kernel.overflow.*; ! import java.io.*; /** *************** *** 30,37 **** * @param port the port to connect to */ ! public ClusterTopicConnection(String host, int port) throws IOException { ! super(host, port); } --- 29,36 ---- * @param port the port to connect to */ ! public ClusterTopicConnection(InternetConnectionDescriptor icd) throws IOException { ! super(icd); } *************** *** 78,82 **** public void deliver(IDatagram d) { ! output(d, new DropIncoming()); } --- 77,87 ---- public void deliver(IDatagram d) { ! try ! { ! output(d, new DropIncoming()); ! } ! catch (IOException e) { ! // can't do much... ! } } Index: ClusterTopicConnectionFactory.java =================================================================== RCS file: /cvsroot/ubermq/jms/src/com/ubermq/jms/server/cluster/ClusterTopicConnectionFactory.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ClusterTopicConnectionFactory.java 4 Oct 2002 16:04:15 -0000 1.5 --- ClusterTopicConnectionFactory.java 18 Oct 2002 16:59:29 -0000 1.6 *************** *** 2,9 **** ! import com.ubermq.jms.client.JMSIOException; ! import com.ubermq.jms.client.UnicastTopicConnectionFactory; ! import com.ubermq.kernel.IOverflowHandler; ! import com.ubermq.kernel.overflow.ExponentialBackoff; /** --- 2,7 ---- ! import com.ubermq.jms.client.*; ! import com.ubermq.jms.client.impl.*; /** *************** *** 11,50 **** * cannot be made. */ ! public class ClusterTopicConnectionFactory ! extends UnicastTopicConnectionFactory { ! private int bitmask; ! ! /** ! * Connects to a url of the form <code>host:port</code>. ! * @param url the URL to connect to ! */ ! public ClusterTopicConnectionFactory(String url) {super(url);} ! ! /** ! * Connects to a host and port. ! * @param host the host ! * @param port the port ! */ ! public ClusterTopicConnectionFactory(String host, int port) {super(host,port);} ! public javax.jms.TopicConnection createTopicConnection() throws javax.jms.JMSException { ! IOverflowHandler h = new ExponentialBackoff(15000L, ! 2, ! 60000L, ! false); ! ! while(true) { ! try { ! ClusterTopicConnection tc = new ClusterTopicConnection(getHost(), getPort()); ! return tc; ! } catch(Exception x) { ! if (h.overflow()) ! h = h.getRetryHandler(); ! else ! throw new JMSIOException("unable to connect"); ! } } } --- 9,34 ---- * cannot be made. */ ! public final class ClusterTopicConnectionFactory { ! private InternetConnectionDescriptor icd; ! ! /** ! * Connects to a url of the form <code>host:port</code>. ! * @param url the URL to connect to ! */ ! public ClusterTopicConnectionFactory(String url) ! { ! this.icd = new SimpleInternetConnectionDescriptor(url); ! } ! public javax.jms.TopicConnection createTopicConnection() throws javax.jms.JMSException { ! try ! { ! return new ClusterTopicConnection(icd); ! } ! catch (java.io.IOException e) { ! throw new JMSIOException(e.getMessage()); } } |