Adds a destination to this message bus.

@param destination
the destination of bus messages.
@return
the object itself, for method chaining.
11024
public Bus<M> addDestination(Destination<M> destination) {
		if(destination != null) {
			logger.info("adding destination '{}' of class '{}'", destination.getId(), destination.getClass().getSimpleName());
			destinations.add(destination);
		}
		return this;
	}
425321
public void addExportPoint(String uri, String destination) {

        CmsExportPoint point = new CmsExportPoint(uri, destination);
        m_exportPoints.add(point);
        if (CmsLog.INIT.isInfoEnabled() && (point.getDestinationPath() != null)) {
            CmsLog.INIT.info(
                Messages.get().getBundle().key(
                    Messages.INIT_ADD_EXPORT_POINT_2,
                    point.getUri(),
                    point.getDestinationPath()));
        }
    }
825285
function extend(destination, source) {
  for (var prop in source)
    if (source.hasOwnProperty(prop))
      destination[prop] = source[prop];
}
294162
public void setBasicTraceDetail(SIDestinationAddress destinationAddress, 
                                  DestinationType destinationType,
                                  SIBusMessage message)
  {
    if (destinationAddress == null)
    {
      validateAndPutProperty("BusName", "");
      validateAndPutProperty("DestinationName", "");
    }
    else
    {
      validateAndPutProperty("BusName", destinationAddress.getBusName());
      validateAndPutProperty("DestinationName", destinationAddress.getDestinationName());
    }
    
    validateAndPutProperty("DestinationType", destinationType);
    
    if (message == null)
    {
      validateAndPutProperty("SystemMessageID", "");
      validateAndPutProperty("Priority", "");
      validateAndPutProperty("Reliability", "");
      validateAndPutProperty("Discriminator","");
    }
    else
    {
      validateAndPutProperty("SystemMessageID", message.getSystemMessageId());
      validateAndPutProperty("Priority", message.getPriority());
      validateAndPutProperty("Reliability", message.getReliability());
      validateAndPutProperty("Discriminator",message.getDiscriminator());
    }
  }
468975
private Destination resolveDestination(String destinationName) throws JMSException {
        if (log.isDebugEnabled()) {
            log.debug("Sending JMS message to destination: '" + destinationName + "'");
        }

        return resolveDestinationName(destinationName, session);
    }
709156
public static boolean isAssignableFrom(Class<?> destination,Class<?> source){
		return destination.isAssignableFrom(source) || isBoxing(destination,source) || isUnBoxing(destination,source);
	}
773547
@Override
    public DestinationDefinition createDestinationDefinition(DestinationType type, String name) {
        return new DestinationDefinitionImpl(type, name);
    }
369978
private DestinationHandler createForeignDestination(DestinationForeignDefinition dfd, String busName) throws SIResourceException, SINotPossibleInCurrentConfigurationException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "createForeignDestination", new Object[] { dfd, busName });

        ForeignDestinationHandler fdh = null;

        //The lock on the destinationManager is taken to stop 2 threads creating the same
        //destination and also to synchronize dynamic deletes with the
        //creation of aliases.  This stops an alias destination being created that targets a
        //destination in the process of being deleted.
        synchronized (this)
        {
            // Create a new DestinationHandler, which is created locked
            fdh = new ForeignDestinationHandler(dfd, messageProcessor, this, findBus(dfd.getBus()), busName);

            DestinationIndex.Type type = new DestinationIndex.Type();
            type.foreignDestination = Boolean.TRUE;
            type.alias = Boolean.FALSE;
            type.local = Boolean.FALSE;
            type.remote = Boolean.FALSE;
            type.queue = new Boolean(!fdh.isPubSub());
            type.state = State.ACTIVE;
            destinationIndex.put(fdh, type);

            fdh.registerControlAdapters();
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "createForeignDestination", fdh);

        return fdh;
    }
51531
public static void serializeTo( Destination destination , RawDataBuffer out )
    {
    	try
    	{
    		if (destination == null)
    		{
    			out.writeByte(NO_DESTINATION);
    		}
    		else
	        if (destination instanceof Queue)
	        {
	            out.writeByte(TYPE_QUEUE);
	            out.writeUTF(((Queue)destination).getQueueName());
	        }
	        else
            if (destination instanceof Topic)
            {
            	out.writeByte(TYPE_TOPIC);
                out.writeUTF(((Topic)destination).getTopicName());
            }
            else
                throw new IllegalArgumentException("Unsupported destination : "+destination);
    	}
    	catch (JMSException e)
    	{
    		throw new IllegalArgumentException("Cannot serialize destination : "+e.getMessage());
    	}
    }
290147
private JmsDestinationImpl validateDestination(Destination destination) throws JMSException {

        // if this is an identified producer, throw an
        // UnsupportedOperationException as this is an unidentified producer
        // method.

        if (this.dest != null) {
            if (destination == null) {
                throw (InvalidDestinationException) JmsErrorUtils.newThrowable(InvalidDestinationException.class
                                                                               , "INVALID_VALUE_CWSIA0281"
                                                                               , new Object[] { "Destination", null }
                                                                               , tc);
            }

            throw (UnsupportedOperationException) JmsErrorUtils.newThrowable(
                                                                             UnsupportedOperationException.class,
                                                                             "DEST_SPECIFIED_ON_SEND_CWSIA0066",
                                                                             null,
                                                                             tc);
        }

        // if the supplied destination is set to null, or it isn't a jetstream
        // destination, throw a jms InvalidDestinationException.
        // Note that in some situations this method call can return a _different_
        // destination than the one passed in as the parameter (e.g. Spring).
        JmsDestinationImpl nativeDest = JmsDestinationImpl.checkNativeInstance(destination);

        // for an identified producer, this check will have been done at constructor time.
        if (this.dest == null) {
            // Check that this destination is not blocked from creating consumers
            JmsDestinationImpl.checkBlockedStatus(nativeDest);
        }

        return nativeDest;

    }
265402
public void add(final String source, final T destination) {

    // replace multiple slashes with a single slash.
    String path = source.replaceAll("/+", "/");

    path = (path.endsWith("/") && path.length() > 1)
      ? path.substring(0, path.length() - 1) : path;


    String[] parts = path.split("/", maxPathParts + 2);
    if (parts.length - 1 > maxPathParts) {
      throw new IllegalArgumentException(String.format("Number of parts of path %s exceeds allowed limit %s",
                                                       source, maxPathParts));
    }
    StringBuilder sb =  new StringBuilder();
    List<String> groupNames = new ArrayList<>();

    for (String part : parts) {
      Matcher groupMatcher = GROUP_PATTERN.matcher(part);
      if (groupMatcher.matches()) {
        groupNames.add(groupMatcher.group(1));
        sb.append("([^/]+?)");
      } else if (WILD_CARD_PATTERN.matcher(part).matches()) {
        sb.append(".*?");
      } else {
        sb.append(part);
      }
      sb.append("/");
    }

    //Ignore the last "/"
    sb.setLength(sb.length() - 1);

    Pattern pattern = Pattern.compile(sb.toString());
    patternRouteList.add(ImmutablePair.of(pattern, new RouteDestinationWithGroups(destination, groupNames)));
  }
470971
public void add(IConverter converter, Object sourceObject,
			TypeReference<?> destinationType, Object convertedObject) {
		convertedObjects.put(new ConvertedObjectsKey(converter, sourceObject,
				destinationType), convertedObject);
	}
612359
public void setDestination(String destination)
  {
    if (tc.isEntryEnabled())
      SibTr.entry(tc, "setDestination", destination);

    this.destination = destination;

    if (tc.isEntryEnabled())
      SibTr.exit(tc, "setDestination");
  }
1231341
public void setDestinationFilter(SIBUuid12 destination)
  {
    if (tc.isEntryEnabled())
      SibTr.entry(tc, "setDestinationFilter", destination);

    this._destination = destination;
    this._subscriptionId = null;
    this._consumerDispatcherState = null;
    
    if (tc.isEntryEnabled())
      SibTr.exit(tc, "setDestinationFilter");
  }
403698
private javax.jms.Message receive(Destination destination, String selector) {
        javax.jms.Message receivedJmsMessage;

        if (log.isDebugEnabled()) {
            log.debug("Receiving JMS message on destination: '" + endpointConfiguration.getDestinationName(destination) + (StringUtils.hasText(selector) ? "(" + selector + ")" : "") + "'");
        }

        if (StringUtils.hasText(selector)) {
            receivedJmsMessage = endpointConfiguration.getJmsTemplate().receiveSelected(destination, selector);
        } else {
            receivedJmsMessage = endpointConfiguration.getJmsTemplate().receive(destination);
        }

        if (receivedJmsMessage == null) {
            throw new ActionTimeoutException("Action timed out while receiving JMS message on '" + endpointConfiguration.getDestinationName(destination) + (StringUtils.hasText(selector) ? "(" + selector + ")" : "") + "'");
        }

        log.info("Received JMS message on destination: '" + endpointConfiguration.getDestinationName(destination) + (StringUtils.hasText(selector) ? "(" + selector + ")" : "") + "'");

        return receivedJmsMessage;
    }
602674
function extend(destination, source) {
    for (var k in source) {
      if (source.hasOwnProperty(k)) {
        destination[k] = source[k];
      }
    }
    return destination;
  }
660619
public Bus<M> addObserver(BusObserver<M> observer) {
		if(observer != null) {
			logger.info("adding observer of class '{}'", observer.getClass().getSimpleName());
			observers.add(observer);
		}
		return this;
	}