MessageListener listener = new MessageListener() {
public void onMessage(Message message) {
try {
Object obj = ((ObjectMessage) message).getObject();
if (obj instanceof EndpointEvent) {
EndpointEvent event = (EndpointEvent) obj;
String container = ((InternalEndpoint) event.getEndpoint()).getComponentNameSpace().getContainerName();
if (!getBroker().getContainer().getName().equals(container)) {
if (event.getEventType() == EndpointEvent.INTERNAL_ENDPOINT_REGISTERED) {
onRemoteEndpointRegistered(event);
} else if (event.getEventType() == EndpointEvent.INTERNAL_ENDPOINT_UNREGISTERED) {
onRemoteEndpointUnregistered(event);
}
}
}
} catch (Exception e) {