/** * Creates a <code>Destination</code> instance, sets its id, sets it manageable * if the <code>AbstractService</code> that created it is manageable, * and sets its <code>Service</code> to the <code>AbstractService</code> that * created it. * * @param id The id of the <code>Destination</code>. * @return The <code>Destination</code> instanced created. */ public Destination createDestination(String id) { Destination destination = new Destination(); destination.setId(id); destination.setManaged(isManaged()); destination.setService(this); return destination; }
/** * Creates a <code>Destination</code> instance, sets its id, sets it manageable * if the <code>AbstractService</code> that created it is manageable, * and sets its <code>Service</code> to the <code>AbstractService</code> that * created it. Note that it cannot have a null id and cannot have an id of * a <code>Destination</code> already registered with the <code>AbstractService</code>. * * @param id The id of the <code>Destination</code>. * @return The <code>Destination</code> instanced created. */ public Destination createDestination(String id) { if (id == null) { // Cannot add ''{0}'' with null id to the ''{1}'' ConfigurationException ex = new ConfigurationException(); ex.setMessage(ConfigurationConstants.NULL_COMPONENT_ID, new Object[]{"Destination", "Service"}); throw ex; } // check with the message broker to make sure that no destination with the id already exists getMessageBroker().isDestinationRegistered(id, getId(), true); Destination destination = new Destination(); destination.setId(id); destination.setManaged(isManaged()); destination.setService(this); return destination; }
/** * The default implementation of this method stops all of the destinations * of the service. * If subclasses override, they must call <code>super.stop()</code>. */ public void stop() { if (!isStarted()) { return; } stopDestinations(); super.stop(); // Remove management if (isManaged() && getMessageBroker().isManaged()) { if (getControl() != null) { getControl().unregister(); setControl(null); } setManaged(false); } }
/** * Creates a <code>Destination</code> instance, sets its id, sets it manageable * if the <code>AbstractService</code> that created it is manageable, * and sets its <code>Service</code> to the <code>AbstractService</code> that * created it. Note that it cannot have a null id and cannot have an id of * a <code>Destination</code> already registered with the <code>AbstractService</code>. * * @param id The id of the <code>Destination</code>. * @return The <code>Destination</code> instanced created. */ public Destination createDestination(String id) { if (id == null) { // Cannot add ''{0}'' with null id to the ''{1}'' ConfigurationException ex = new ConfigurationException(); ex.setMessage(ConfigurationConstants.NULL_COMPONENT_ID, new Object[]{"Destination", "Service"}); throw ex; } // check with the message broker to make sure that no destination with the id already exists getMessageBroker().isDestinationRegistered(id, getId(), true); Destination destination = new Destination(); destination.setId(id); destination.setManaged(isManaged()); destination.setService(this); return destination; }
/** * The default implementation of this method stops all of the destinations * of the service. * If subclasses override, they must call <code>super.stop()</code>. */ @Override public void stop() { if (!isStarted()) { return; } stopDestinations(); super.stop(); // Remove management if (isManaged() && getMessageBroker().isManaged()) { if (getControl() != null) { getControl().unregister(); setControl(null); } setManaged(false); } }
/** * The default implementation of this method stops all of the destinations * of the service. * If subclasses override, they must call <code>super.stop()</code>. */ @Override public void stop() { if (!isStarted()) { return; } stopDestinations(); super.stop(); // Remove management if (isManaged() && getMessageBroker().isManaged()) { if (getControl() != null) { getControl().unregister(); setControl(null); } setManaged(false); } }
if (isManaged() && broker.isManaged())
if (isManaged() && broker.isManaged())
if (isManaged() && broker.isManaged())