_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;
} catch (Exception e) {
_logger.log(Level.WARNING, "Failed to start Grizlly proxy for MQ broker", e);
}
}
}
}
}
}
if ("JMS_PROVIDER_PORT".equals(newValue)){
//The value is in the next event
PropertyChangeEvent nextevent = events[i+1] ;
jmsProviderPort = (String) nextevent.getNewValue();
}
if(event.getSource() instanceof JmsService ) {
if (eventName.equals(ServerTags.MASTER_BROKER)) {
String oldMB = oldValue != null ? oldValue.toString() : null;
String newMB = newValue != null ? newValue.toString(): null;
if (_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE, "Got JmsService Master Broker change event "
+ event.getSource() + " "
+ eventName + " " + oldMB + " " + newMB);
}
if (newMB != null) {
Server newMBServer = domain.getServerNamed(newMB);
if(newMBServer != null)
{
Node node = domain.getNodeNamed(newMBServer.getNodeRef());
String newMasterBrokerPort = JmsRaUtil.getJMSPropertyValue(newMBServer);
if(newMasterBrokerPort == null) newMasterBrokerPort = getDefaultJmsHost(jmsService).getPort();
String newMasterBrokerHost = node.getNodeHost();
aresourceAdapter.setMasterBroker(newMasterBrokerHost + ":" + newMasterBrokerPort);
}
}
}
} if (eventName.equals(ServerTags.SERVER_REF)){
//if(event instanceof ServerRef){
String oldServerRef = oldValue != null ? oldValue.toString() : null;
String newServerRef = newValue != null ? newValue.toString(): null;
if(oldServerRef != null && newServerRef == null && !thisServer.isDas()) {//instance has been deleted
if (_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE, "Got Cluster change event for server_ref"
+ event.getSource() + " "
+ eventName + " " + oldServerRef + " " + null);
}
String url = getBrokerList();
aresourceAdapter.setClusterBrokerList(url);
break;
}//
} // else skip
if (event.getSource() instanceof Server) {
_logger.log(Level.FINE, "In JMSConfigListener - recieved cluster event " + event.getSource());
Server changedServer = (Server) event.getSource();
if (thisServer.isDas())return null;
if(jmsProviderPort != null){
String nodeName = changedServer.getNodeRef();
String nodeHost = null;
if(nodeName != null)
nodeHost = domain.getNodeNamed(nodeName).getNodeHost();
String url = getBrokerList();
url = url + ",mq://" + nodeHost + ":" + jmsProviderPort;
aresourceAdapter.setClusterBrokerList(url);
break;
}
}
}
return unprocessedEvents.size() > 0 ? new UnprocessedChangeEvents(unprocessedEvents) : null;
}