}
if(event.getSource().toString().indexOf("connectors.jms.config.JmsService") != -1) {
boolean notifyFlag = true;
if (oldValue != null && newValue == null && "jms-host".equals(event.getPropertyName())) {
JmsHost jmsHost = (JmsHost) oldValue;
String name = ActiveJmsResourceAdapter.GRIZZLY_PROXY_PREFIX + jmsHost.getName();
ActiveJmsResourceAdapter adapter = Globals.get(ActiveJmsResourceAdapter.class);
if (adapter.getGrizzlyListeners().contains(name)) {
GrizzlyService grizzlyService = Globals.get(GrizzlyService.class);
synchronized (adapter.getGrizzlyListeners()) {
if (_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE, "Stopping Grizzly proxy " + name);
}
grizzlyService.removeNetworkProxy(name);
adapter.getGrizzlyListeners().remove(name);
}
notifyFlag = false;
}
}
if (notifyFlag) {
UnprocessedChangeEvent uchangeEvent = new UnprocessedChangeEvent(event, "restart required");
unprocessedEvents.add(uchangeEvent);
}
}
else if(event.getSource().toString().indexOf("connectors.jms.config.JmsHost") != -1) {
if (oldValue == null && newValue != null && "name".equals(event.getPropertyName())) {
JmsProviderLifecycle lifecycle = Globals.get(JmsProviderLifecycle.class);
JmsHost jmsHost = (JmsHost) event.getSource();
if (ActiveJmsResourceAdapter.EMBEDDED.equalsIgnoreCase(jmsService.getType())) {
ActiveJmsResourceAdapter adapter = Globals.get(ActiveJmsResourceAdapter.class);
if (!adapter.getDoBind()) {
if (Boolean.valueOf(jmsHost.getLazyInit())) {
String host = null;
if (jmsHost.getHost() != null && "localhost".equals(jmsHost.getHost())) {
host = "0.0.0.0";
} else {
host = jmsHost.getHost();
}
try {
GrizzlyService grizzlyService = Globals.get(GrizzlyService.class);
NetworkListener dummy = new DummyNetworkListener();
dummy.setPort(jmsHost.getPort());
dummy.setAddress(host);
dummy.setType("proxy");
dummy.setProtocol(ActiveJmsResourceAdapter.JMS_SERVICE);
dummy.setTransport("tcp");
String name = ActiveJmsResourceAdapter.GRIZZLY_PROXY_PREFIX + jmsHost.getName();
dummy.setName(name);
synchronized (adapter.getGrizzlyListeners()) {
if (_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE, "Starting Grizzly proxy " + name + " on port " + jmsHost.getPort());
}
grizzlyService.createNetworkProxy(dummy);
adapter.getGrizzlyListeners().add(name);
}
return unprocessedEvents.size() > 0 ? new UnprocessedChangeEvents(unprocessedEvents) : null;