summaryrefslogtreecommitdiff
path: root/java/newclient/src/main/java/org/apache/qpid/nclient/transport/TransportConnectionFactory.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/newclient/src/main/java/org/apache/qpid/nclient/transport/TransportConnectionFactory.java')
-rw-r--r--java/newclient/src/main/java/org/apache/qpid/nclient/transport/TransportConnectionFactory.java44
1 files changed, 44 insertions, 0 deletions
diff --git a/java/newclient/src/main/java/org/apache/qpid/nclient/transport/TransportConnectionFactory.java b/java/newclient/src/main/java/org/apache/qpid/nclient/transport/TransportConnectionFactory.java
new file mode 100644
index 0000000000..5c97100bdc
--- /dev/null
+++ b/java/newclient/src/main/java/org/apache/qpid/nclient/transport/TransportConnectionFactory.java
@@ -0,0 +1,44 @@
+package org.apache.qpid.nclient.transport;
+
+import java.net.URISyntaxException;
+
+public class TransportConnectionFactory
+{
+ public enum ConnectionType
+ {
+ TCP,VM
+ }
+
+ public static TransportConnection createTransportConnection(String url,ConnectionType type) throws URISyntaxException
+ {
+ return createTransportConnection(new AMQPConnectionURL(url),type);
+
+ }
+
+ public static TransportConnection createTransportConnection(ConnectionURL url,ConnectionType type)
+ {
+ switch (type)
+ {
+ case TCP : default:
+ {
+ return createTCPConnection(url);
+ }
+
+ case VM :
+ {
+ return createVMConnection(url);
+ }
+ }
+
+ }
+
+ private static TransportConnection createTCPConnection(ConnectionURL url)
+ {
+ return new TCPConnection(url);
+ }
+
+ private static TransportConnection createVMConnection(ConnectionURL url)
+ {
+ return null;
+ }
+}