use of com.swiftmq.net.client.IntraVMConnection in project swiftmq-client by iitsoftware.
the class ConnectionFactoryImpl method createServerConnection.
private com.swiftmq.net.client.Connection createServerConnection() throws JMSException {
PoolManager.setIntraVM(intraVM);
com.swiftmq.net.client.Connection conn = null;
if (intraVM) {
try {
conn = new IntraVMConnection();
NetworkSwiftlet networkSwiftlet = (NetworkSwiftlet) SwiftletManager.getInstance().getSwiftlet("sys$net");
networkSwiftlet.connectIntraVMListener("sys$jms", (IntraVMConnection) conn);
} catch (Exception e) {
throw new JMSException("error creating intraVM connection, message: " + e.getMessage());
}
} else {
try {
if (socketFactory == null)
socketFactory = (SocketFactory) Class.forName(socketFactoryClass).newInstance();
Socket socket = socketFactory.createSocket(hostname, port);
conn = new BlockingConnection(socket, inputBufferSize, inputExtendSize, outputBufferSize, outputExtendSize);
} catch (Exception e) {
throw new JMSException("error creating socket connection to " + hostname + ":" + port + ", message: " + e.getMessage());
}
}
return conn;
}
use of com.swiftmq.net.client.IntraVMConnection in project swiftmq-client by iitsoftware.
the class ConnectionFactoryImpl method createServerConnection.
private com.swiftmq.net.client.Connection createServerConnection() throws JMSException {
PoolManager.setIntraVM(intraVM);
com.swiftmq.net.client.Connection conn = null;
if (intraVM) {
try {
conn = new IntraVMConnection();
NetworkSwiftlet networkSwiftlet = (NetworkSwiftlet) SwiftletManager.getInstance().getSwiftlet("sys$net");
networkSwiftlet.connectIntraVMListener("sys$jms", (IntraVMConnection) conn);
} catch (Exception e) {
throw new JMSException("error creating intraVM connection, message: " + e.getMessage());
}
} else {
try {
if (socketFactory == null)
socketFactory = (SocketFactory) Class.forName(socketFactoryClass).newInstance();
Socket socket = socketFactory.createSocket(hostname, port);
conn = new BlockingConnection(socket, inputBufferSize, inputExtendSize, outputBufferSize, outputExtendSize);
} catch (Exception e) {
throw new JMSException("error creating socket connection to " + hostname + ":" + port + ", message: " + e.getMessage());
}
}
return conn;
}
use of com.swiftmq.net.client.IntraVMConnection in project swiftmq-client by iitsoftware.
the class ConnectionFactoryImpl method createServerConnection.
private com.swiftmq.net.client.Connection createServerConnection() throws JMSException {
PoolManager.setIntraVM(intraVM);
com.swiftmq.net.client.Connection conn = null;
if (intraVM) {
try {
conn = new IntraVMConnection();
NetworkSwiftlet networkSwiftlet = (NetworkSwiftlet) SwiftletManager.getInstance().getSwiftlet("sys$net");
networkSwiftlet.connectIntraVMListener("sys$jms", (IntraVMConnection) conn);
} catch (Exception e) {
throw new JMSException("error creating intraVM connection, message: " + e.getMessage());
}
} else {
try {
if (socketFactory == null)
socketFactory = (SocketFactory) Class.forName(socketFactoryClass).newInstance();
Socket socket = socketFactory.createSocket(hostname, port, Boolean.valueOf(System.getProperty("swiftmq.tcp.no.delay", "true")).booleanValue());
conn = new BlockingConnection(socket, inputBufferSize, inputExtendSize, outputBufferSize, outputExtendSize);
} catch (Exception e) {
throw new JMSException("error creating socket connection to " + hostname + ":" + port + ", message: " + e.getMessage());
}
}
return conn;
}
Aggregations