KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > ubermq > jms > client > URLTopicConnectionFactory


1 package com.ubermq.jms.client;
2
3 import com.ubermq.*;
4 import java.io.*;
5 import java.lang.reflect.*;
6 import java.net.*;
7 import java.util.*;
8 import javax.jms.*;
9
10 /**
11  * Processes uniform resource identifiers (URI's) as a way of
12  * describing a connection to a messaging infrastructure via
13  * a delegate TopicConnectionFactory.<P>
14  *
15  * This implementation also allows custom factories to register
16  * themselves with this centralized registry. Clients of this
17  * unified topic connection factory will have all ranges of
18  * factories available to them at runtime. <P>
19  *
20  * URI's are formatted as follows: <BR>
21  * <code>scheme://host:port</code>
22  * <P>
23  *
24  * Some URI handlers, like the default UberMQ <code>UnicastTopicConnectionFactory</code>
25  * can accept URI's that have failover instructions embedded in them, as follows:<br>
26  * <code>scheme://host:port,host2:port2...</code>
27  *
28  * The two default connection schemes are registered at initialization
29  * time. These are given by <code>DEFAULT_UBERMQ_SCHEME</code>
30  * and <code>DEFAULT_UBERMQ_MULTICAST_SCHEME</code>.<P>
31  *
32  * The factory class will also look for a properties file named
33  * <code>URL_REGISTRY_NAME</code> and use that as a set of key-value pairs
34  * specifying custom connection schemes and implementations at runtime.
35  * The <code>ClassLoader.findResource</code> method is used to locate this
36  * file. For example, the line: <br>
37
38  * <code>my-scheme=com.my-company.MySchemeConnectionFactory</code><br>
39  *
40  * will delegate URI's for <code>my-scheme</code> to the named factory
41  * class. The factory class must provide a constructor that accepts a
42  * single <code>java.net.URI</code> object.<P>
43  *
44  * @since 1.1
45  * @deprecated Use URLConnectionFactory instead
46  * @see java.net.URI, URLConnectionFactory
47  */

48 public class URLTopicConnectionFactory
49     extends URLConnectionFactory
50     implements TopicConnectionFactory
51 {
52     public static void registerFactory(String JavaDoc scheme,
53                                        Class JavaDoc clazz)
54     {
55         URLConnectionFactory.registerFactory(scheme, clazz);
56     }
57
58     /**
59      * Creates a URL topic connection factory with the given string.
60      * @param sz a URI
61      */

62     public URLTopicConnectionFactory(String JavaDoc sz)
63     {
64         super(sz);
65     }
66
67     public TopicConnection createTopicConnection() throws javax.jms.JMSException JavaDoc
68     {
69         return (TopicConnection)super.createConnection();
70     }
71
72     public TopicConnection createTopicConnection(String JavaDoc p0, String JavaDoc p1) throws javax.jms.JMSException JavaDoc
73     {
74         return (TopicConnection)super.createConnection(p0, p1);
75     }
76
77 }
78
Popular Tags