use of com.swiftmq.swiftlet.net.NetworkSwiftlet in project swiftmq-client by iitsoftware.
the class IntraVMReconnector method createConnection.
protected Connection createConnection(ServerEntry entry, Map parameters) {
Connection connection = null;
try {
connection = new IntraVMConnection();
NetworkSwiftlet networkSwiftlet = (NetworkSwiftlet) SwiftletManager.getInstance().getSwiftlet("sys$net");
networkSwiftlet.connectIntraVMListener("sys$jms", (IntraVMConnection) connection);
} catch (Exception e) {
if (debug)
System.out.println(toString() + " exception creating connection: " + e);
}
return connection;
}
use of com.swiftmq.swiftlet.net.NetworkSwiftlet 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.swiftlet.net.NetworkSwiftlet 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.swiftlet.net.NetworkSwiftlet 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