use of com.swiftmq.swiftlet.net.IntraVMListenerMetaData in project swiftmq-ce by iitsoftware.
the class IntraVMScheduler method connectListener.
public synchronized void connectListener(String swiftletName, IntraVMConnection clientConnection) throws Exception {
if (ctx.traceSpace.enabled)
ctx.traceSpace.trace("sys$net", toString() + "/connectListener: swiftletName=" + swiftletName + ", clientConnection=" + clientConnection);
IntraVMListenerMetaData metaData = (IntraVMListenerMetaData) listeners.get(swiftletName);
if (metaData == null)
throw new Exception("No intra-VM listener found for Swiftlet '" + swiftletName + "'");
IntraVMServerEndpointImpl connection = new IntraVMServerEndpointImpl(ctx, clientConnection);
try {
ConnectionListener connectionListener = metaData.getConnectionListener();
connection.setConnectionListener(connectionListener);
connection.setMetaData(metaData);
connectionListener.connected(connection);
ctx.networkSwiftlet.getConnectionManager().addConnection(connection);
} catch (ConnectionVetoException cve) {
connection.close();
if (ctx.traceSpace.enabled)
ctx.traceSpace.trace("sys$net", toString() + "/ConnectionVetoException: " + cve.getMessage());
ctx.logSwiftlet.logError("sys$net", toString() + "/ConnectionVetoException: " + cve.getMessage());
throw new Exception(cve.getMessage());
}
ctx.logSwiftlet.logInformation("sys$net", toString() + "/connection accepted: " + connection);
}
Aggregations