/** * 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>. */ @Override 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.removeDestination(oldId); service.addDestination(this); } }
/** * 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>. */ @Override 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.removeDestination(oldId); service.addDestination(this); } }
/** * Sets the <code>Service</code> managing this <code>Destination</code>. * Removes the <code>Destination</code> from the old service * (if there was one) and adds to the list of destination in the new service. * * @param service The <code>Service</code> managing this <code>Destination</code>. */ public void setService(Service service) { Service oldService = getService(); setParent(service); if (oldService != null) oldService.removeDestination(getId()); // Add the destination to the service if needed if (service.getDestination(getId()) != this) service.addDestination(this); }
/** * Sets the <code>Service</code> managing this <code>Destination</code>. * Removes the <code>Destination</code> from the old service * (if there was one) and adds to the list of destination in the new service. * * @param service The <code>Service</code> managing this <code>Destination</code>. */ public void setService(Service service) { Service oldService = getService(); setParent(service); if (oldService != null) oldService.removeDestination(getId()); // Add the destination to the service if needed if (service.getDestination(getId()) != this) service.addDestination(this); }
/** * Sets the <code>Service</code> managing this <code>Destination</code>. * Removes the <code>Destination</code> from the old service * (if there was one) and adds to the list of destination in the new service. * * @param service The <code>Service</code> managing this <code>Destination</code>. */ public void setService(Service service) { Service oldService = getService(); setParent(service); if (oldService != null) oldService.removeDestination(getId()); // Add the destination to the service if needed if (service.getDestination(getId()) != this) service.addDestination(this); }