Object socketRef = tc.getParams().remove(SOCKET_REF);
if (socketRef != null) {
String name = socketRef.toString();
SocketBinding binding = socketBindings.get(name);
if (binding == null) {
throw new StartException("Failed to find SocketBinding for connector: " + tc.getName());
}
tc.getParams().put(HOST, binding.getSocketAddress().getHostName());
tc.getParams().put(PORT, "" + binding.getSocketAddress().getPort());
}
}
}
if (acceptors != null) {
for (TransportConfiguration tc : acceptors) {
// If there is a socket binding set the HOST/PORT values
Object socketRef = tc.getParams().remove(SOCKET_REF);
if (socketRef != null) {
String name = socketRef.toString();
SocketBinding binding = socketBindings.get(name);
if (binding == null) {
throw new StartException("Failed to find SocketBinding for connector: " + tc.getName());
}
tc.getParams().put(HOST, binding.getSocketAddress().getHostName());
tc.getParams().put(PORT, "" + binding.getSocketAddress().getPort());
}
}
}
// Now start the server
server = new HornetQServerImpl(configuration, mbeanServer.getOptionalValue(), null);
// FIXME started by the JMSService
// HornetQ expects the TCCL to be set to something that can find the
// log factory class.
// ClassLoader loader = getClass().getClassLoader();
// SecurityActions.setContextClassLoader(loader);
// server.start();
} catch (Exception e) {
throw new StartException("Failed to start service", e);
} finally {
SecurityActions.setContextClassLoader(origTCCL);
}
}