* JMS container on first request.
*/
public void initializeLazyListener(JmsService jmsService) {
if (jmsService != null) {
if (EMBEDDED.equalsIgnoreCase(jmsService.getType()) && !grizzlyListenerInit) {
GrizzlyService grizzlyService = Globals.get(GrizzlyService.class);
if (grizzlyService != null) {
List<JmsHost> jmsHosts = jmsService.getJmsHost();
for (JmsHost oneHost : jmsHosts) {
if (Boolean.valueOf(oneHost.getLazyInit())) {
String jmsHost = null;
if (oneHost.getHost() != null && "localhost".equals(oneHost.getHost())) {
jmsHost = "0.0.0.0";
} else {
jmsHost = oneHost.getHost();
}
NetworkListener dummy = new DummyNetworkListener();
dummy.setPort(oneHost.getPort());
dummy.setAddress(jmsHost);
dummy.setProtocol("light-weight-listener");
dummy.setTransport("tcp");
dummy.setName(JMS_SERVICE);
grizzlyService.createNetworkProxy(dummy);
grizzlyListenerInit = true;
}
}
}
}