/** * Sets the id of the <code>Destination</code>. If the <code>Destination</code> * has a <code>Service</code> assigned, it also updates the id in the * <code>Service</code>. * * @param id The id of the <code>Destination</code>. */ public void setId(String id) { String oldId = getId(); super.setId(id); // Update the destination id in the service and MessageBroker Service service = getService(); if (service != null) { service.getMessageBroker().unregisterDestination(oldId); service.getDestinations().remove(oldId); service.getMessageBroker().registerDestination(id, service.getId()); service.getDestinations().put(id, this); } }
public void preDeregister() throws Exception { MessageBrokerControl parent = (MessageBrokerControl)getParentControl(); parent.removeService(getObjectName()); // Unregister destinations of the service for (Iterator iter = service.getDestinations().values().iterator(); iter.hasNext();) { Destination child = (Destination) iter.next(); if (child.getControl() != null) { child.getControl().unregister(); child.setControl(null); child.setManaged(false); } } super.preDeregister(); }
public void preDeregister() throws Exception { MessageBrokerControl parent = (MessageBrokerControl)getParentControl(); parent.removeService(getObjectName()); // Unregister destinations of the service for (Iterator iter = service.getDestinations().values().iterator(); iter.hasNext();) { Destination child = (Destination) iter.next(); if (child.getControl() != null) { child.getControl().unregister(); child.setControl(null); child.setManaged(false); } } super.preDeregister(); }
public void preDeregister() throws Exception { MessageBrokerControl parent = (MessageBrokerControl)getParentControl(); parent.removeService(getObjectName()); // Unregister destinations of the service for (Iterator iter = service.getDestinations().values().iterator(); iter.hasNext();) { Destination child = (Destination) iter.next(); if (child.getControl() != null) { child.getControl().unregister(); child.setControl(null); child.setManaged(false); } } super.preDeregister(); }