/* (non-Javadoc)
@see com.ibm.ws.sib.processor.impl.interfaces.DestinationHandler#isForeignBus()
184728
public boolean isForeignBus()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "isForeignBus");

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "isForeignBus",Boolean.TRUE);

    return true;
  }
11571
boolean isPredecessorOf(final ControlFlowBlock possibleSuccessor) {
        boolean result = false;
        for (final ControlFlowBlock directSuccessor : successors) {
            if (directSuccessor.equals(possibleSuccessor) || directSuccessor.isPredecessorOf(possibleSuccessor)) {
                result = true;
                break;
            }
        }
        return result;
    }
534519
protected SingleBusLocatorRegistrar getRegistrar(Bus bus) {
        SingleBusLocatorRegistrar registrar = busRegistrars.get(bus);
        if (registrar == null) {
            check(locatorClient, "serviceLocator", "registerService");
            registrar = new SingleBusLocatorRegistrar(bus);
            registrar.setServiceLocator(locatorClient);
            registrar.setEndpointPrefix(endpointPrefix);
            Map<String, String> endpointPrefixes = new HashMap<String, String>();
            endpointPrefixes.put("HTTP", endpointPrefixHttp);
            endpointPrefixes.put("HTTPS", endpointPrefixHttps);
            registrar.setEndpointPrefixes(endpointPrefixes);
            busRegistrars.put(bus, registrar);
            addLifeCycleListener(bus);
        }
        return registrar;
    }
201565
public SIMPIterator getForeignBusIterator()
  {
    ForeignBusTypeFilter filter = new ForeignBusTypeFilter();
    SIMPIterator foreignBusItr = destinationManager.getForeignBusIndex().iterator(filter);
    return new ControllableIterator(foreignBusItr);
  }
422712
@Override
    public String getBusName() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "getBusName");
        String busName = jcaConnectionFactory.getBusName();
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "getBusName", busName);
        return busName;
    }
553313
@Pure
	public Iterator<BusStop> busStopIterator() {
		return Iterators.unmodifiableIterator(
				Iterators.concat(this.validBusStops.iterator(), this.invalidBusStops.iterator()));
	}
16208
@Override
    public boolean hasLocal()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "hasLocal");

        boolean hasLocal = false;

        // If this alias scopes the set of possible queue points then to qualify
        // as having a local one it must be in this set.
        if (_hasScopedMessagePoints)
        {
            if (_singleScopedQueuePointME != null)
            {
                if (_singleScopedQueuePointME.equals(getMessageProcessor().getMessagingEngineUuid()))
                    hasLocal = true;
            }
            else if ((_scopedQueuePointMEs != null) && _scopedQueuePointMEs.contains(getMessageProcessor().getMessagingEngineUuid()))
                hasLocal = true;
        }

        // Because we can't trust the scoped set being up-to-date with the
        // target destination (which could have removed an ME and hence queue point
        // since the alias was created) we still check that the target has
        // a local queue point.
        if (hasLocal || !_hasScopedMessagePoints)
            hasLocal = _targetDestinationHandler.hasLocal();

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "hasLocal", Boolean.valueOf(hasLocal));

        return hasLocal;
    }
178296
@Override
    public boolean isSendAllowed()
    {
        if (tc.isEntryEnabled())
            SibTr.entry(tc, "isSendAllowed");

        boolean isSendAllowed = true;

        // We check first whether send is disallowed at the bus definition level. A 
        // setting at the bus level overrides a setting on the Foreign Destination
        // Definition.
        if (_sendAllowedOnTargetForeignBus != null)
            isSendAllowed = _sendAllowedOnTargetForeignBus.booleanValue();

        // If allowed at the bus level, check at the foreign dest def level
        if (isSendAllowed)
            isSendAllowed = _definition.isSendAllowed();

        if (tc.isEntryEnabled())
            SibTr.exit(tc, "isSendAllowed", new Boolean(isSendAllowed));

        return isSendAllowed;
    }
29146
public SIMPForeignBusControllable getForeignBusControllable()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
    {
      SibTr.entry(tc, "getForeignBusControlAdapter");
      SibTr.exit(tc, "getForeignBusControlAdapter");
    }    
    return (SIMPForeignBusControllable)_messageProcessor.getDestinationManager()
                                                        .getForeignBusIndex()
                                                        .findByName(_link.getBusName(), null)
                                                        .getControlAdapter(); 
  }
222973
private DestinationHandler createAliasDestination(DestinationAliasDefinition add, AliasChainValidator validator, DestinationHandler baseDest) throws SINotPossibleInCurrentConfigurationException, SIMPDestinationCorruptException, SIResourceException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "createAliasDestination", new Object[] { add, validator, baseDest });

        String destinationName = add.getName();
        String busName = add.getBus();

        // Through the admin panels it is possible for an empty string to be specified.
        // An empty string means use the local bus name.
        if (busName == null || busName.equals(""))
            busName = messageProcessor.getMessagingEngineBus();

        // If the validator is null, we must be at the top of any alias chain.
        if (null == validator)
        {
            validator = new AliasChainValidator();
        }

        // Check that we are not going around in a loop with alias validation.
        validator.validate(destinationName, busName);

        AliasDestinationHandler aliasDestinationHandler = null;

        try
        {
            boolean aliasChainError = false;

            // If we are trying to plug in a destination handler rather than look it up then we need
            // to check that we are not an alias chain. If we are we recursively call into the chain
            // handing the plugin destination to the last one.
            if (baseDest != null)
            {
                String targetBus = add.getTargetBus();
                if (targetBus == null || targetBus.equals(""))
                    targetBus = messageProcessor.getMessagingEngineBus();

                // If the name of the current alias target is not the same as the plugin basedest, then
                // we are an alias chaing and we create the next part of the chain passing in the basedest
                if (!add.getTargetName().equals(baseDest.getName()) || !targetBus.equals(baseDest.getBus()))
                {
                    baseDest = getAliasDestinationInternal(add.getTargetName(), targetBus, validator, baseDest, false);
                    if (baseDest == null)
                        aliasChainError = true;
                }
            }

            //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)
            {
                DestinationHandler targetDH = baseDest;

                if (targetDH == null && !aliasChainError)
                {

                    targetDH =
                                    getDestinationInternal(
                                                           add.getTargetName(),
                                                           add.getTargetBus(),
                                                           validator,
                                                           false,
                                                           false);

                }

                if (targetDH == null)
                {
                    // Throw out exception detailing chain
                    // Add the destination name which has triggered the exception to the end
                    // of the list, making the problem obvious.
                    String chainText = validator.toStringPlus(add.getTargetName(), busName);

                    String targetName = add.getTargetName();
                    AliasChainValidator.CompoundName firstInChain = validator.getFirstInChain();

                    SIMPNotPossibleInCurrentConfigurationException e =
                                    new SIMPNotPossibleInCurrentConfigurationException(
                                                    nls_cwsik.getFormattedMessage(
                                                                                  "DELIVERY_ERROR_SIRC_45", // ALIAS_TARGET_DESTINATION_NOT_FOUND_EXCEPTION_CWSIP0057
                                                                                  new Object[]
                                                                                  { firstInChain.getDestName(), targetName },
                                                                                  null)
                                    );

                    e.setExceptionReason(SIRCConstants.SIRC0028_ALIAS_TARGET_DESTINATION_NOT_FOUND_EXCEPTION);
                    e.setExceptionInserts(new String[] { firstInChain.getDestName(), targetName });

                    SibTr.exception(tc, e);

                    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                        SibTr.exit(tc, "createAliasDestination", e);
                    throw e;
                }
                else if (targetDH.getDestinationType().equals(DestinationType.SERVICE))
                {
                    // Throw out exception detailing chain
                    // Add the destination name which has triggered the exception to the end
                    // of the list, making the problem obvious.
                    String chainText = validator.toStringPlus(targetDH.getName(), targetDH.getBus());

                    AliasChainValidator.CompoundName firstInChain = validator.getFirstInChain();

                    String nlsMessage =
                                    nls_cwsik.getFormattedMessage(
                                                                  "DELIVERY_ERROR_SIRC_29", // ALIAS_TARGETS_SERVICE_DESTINATION_ERROR_CWSIP0622
                                                                  new Object[]
                                                                  { firstInChain.getDestName(), targetDH.getName(), chainText, busName },
                                                                  null);

                    SIMPNotPossibleInCurrentConfigurationException e = new SIMPNotPossibleInCurrentConfigurationException(nlsMessage);

                    e.setExceptionReason(SIRCConstants.SIRC0029_ALIAS_TARGETS_SERVICE_DESTINATION_ERROR);
                    e.setExceptionInserts(new String[] { firstInChain.getDestName(), targetDH.getName(), chainText, busName });

                    SibTr.exception(tc, e);

                    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                        SibTr.exit(tc, "createAliasDestination", e);
                    throw e;
                }

                // Create a new DestinationHandler, which is created locked
                aliasDestinationHandler = new AliasDestinationHandler(add, messageProcessor, this, targetDH, busName);

                DestinationIndex.Type type = new DestinationIndex.Type();
                type.alias = Boolean.TRUE;
                type.foreignDestination = Boolean.FALSE;
                type.local = Boolean.FALSE;
                type.remote = Boolean.FALSE;
                type.queue = new Boolean(!aliasDestinationHandler.isPubSub());
                type.state = State.ACTIVE;
                destinationIndex.put(aliasDestinationHandler, type);
            }
        } catch (SITemporaryDestinationNotFoundException e)
        {
            // FFDC
            FFDCFilter.processException(
                                        e,
                                        "com.ibm.ws.sib.processor.impl.DestinationManager.createAliasDestination",
                                        "1:6701:1.508.1.7",
                                        this);

            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                SibTr.exit(tc, "createAliasDestination", "SIErrorException");

            SIMPErrorException ee = new SIMPErrorException(
                            nls_cwsik.getFormattedMessage(
                                                          "DELIVERY_ERROR_SIRC_901",
                                                          new Object[] { "com.ibm.ws.sib.processor.impl.DestinationManager", "1:6710:1.508.1.7", e, destinationName },
                                                          null),
                            e);

            ee.setExceptionReason(SIRCConstants.SIRC0901_INTERNAL_MESSAGING_ERROR);
            ee.setExceptionInserts(new String[] { "com.ibm.ws.sib.processor.impl.DestinationManager",
                                                 "1:6716:1.508.1.7",
                                                 SIMPUtils.getStackTrace(e) });
            throw ee;
        } catch (SIIncorrectCallException e)
        {
            // FFDC
            FFDCFilter.processException(
                                        e,
                                        "com.ibm.ws.sib.processor.impl.DestinationManager.createAliasDestination",
                                        "1:6166:1.487",
                                        this);

            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                SibTr.exit(tc, "createAliasDestination", "SIErrorException");

            SIMPErrorException ee = new SIMPErrorException(
                            nls_cwsik.getFormattedMessage(
                                                          "DELIVERY_ERROR_SIRC_901",
                                                          new Object[] { "com.ibm.ws.sib.processor.impl.DestinationManager", "1:6175:1.487", e, destinationName },
                                                          null),
                            e);

            ee.setExceptionReason(SIRCConstants.SIRC0901_INTERNAL_MESSAGING_ERROR);
            ee.setExceptionInserts(new String[] { "com.ibm.ws.sib.processor.impl.DestinationManager",
                                                 "1:6181:1.487",
                                                 SIMPUtils.getStackTrace(e) });
            throw ee;
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "createAliasDestination", aliasDestinationHandler);

        return aliasDestinationHandler;
    }
737989
public BaseDestinationDefinition getSIBDestinationByUuid(String busName, String uuid) throws SIBExceptionBase, SIBExceptionDestinationNotFound {

        String thisMethodName = "getSIBDestinationByUuid";

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            SibTr.entry(tc, thisMethodName, new Object[] { busName, uuid });
        }

        BaseDestinationDefinition bdd = getSIBDestinationByUuid(busName, uuid, false);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            SibTr.exit(tc, thisMethodName, bdd);
        }

        return bdd;
    }
922824
def is_primary_vehicle(self, msg):
        ''''''
        sysid = msg.get_srcSystem()
        if self.target_system == 0 or self.target_system == sysid:
            return True
        return False
650314
BusGroup getBus()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
    {
      SibTr.entry(tc, "getBus");
      SibTr.exit(tc, "getBus", iBusGroup);
    }

    return iBusGroup;
  }
990521
@Pure
	public boolean isStartingBusHalt() {
		final BusItinerary itinerary = getContainer();
		if (itinerary != null && itinerary.isValidPrimitive()) {
			try {
				return itinerary.getBusHaltAt(0) == this;
			} catch (IndexOutOfBoundsException exception) {
				// invalid halt
			}
		}
		return false;
	}
51003
public Set getSIBDestinationLocalitySet(String busName, String uuid) throws SIBExceptionBase, SIBExceptionDestinationNotFound {

        String thisMethodName = "getSIBDestinationLocalitySet";

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            SibTr.entry(tc, thisMethodName, new Object[] { busName, uuid });
        }

        Set retVal = getSIBDestinationLocalitySet(busName, uuid, false);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            SibTr.exit(tc, thisMethodName, retVal);
        }

        return retVal;
    }
1062024
private boolean detectWSAddressingFeature(InterceptorProvider provider, Bus bus) {
        //detect on the bus level
        if (bus.getFeatures() != null) {
            Iterator<Feature> busFeatures = bus.getFeatures().iterator();
            while (busFeatures.hasNext()) {
                Feature busFeature = busFeatures.next();
                if (busFeature instanceof WSAddressingFeature) {
                    return true;
                }
            }
        }

        //detect on the endpoint/client level
        Iterator<Interceptor<? extends Message>> interceptors = provider.getInInterceptors().iterator();
        while (interceptors.hasNext()) {
            Interceptor<? extends Message> ic = interceptors.next();
            if (ic instanceof MAPAggregator) {
                return true;
            }
        }

        return false;
    }
520181
public static void setBusStopNamesDrawable(Boolean isNamesDrawable) {
		final Preferences prefs = Preferences.userNodeForPackage(BusLayerConstants.class);
		if (prefs != null) {
			if (isNamesDrawable == null) {
				prefs.remove("DRAW_BUS_STOPS_NAMES"); //$NON-NLS-1$
			} else {
				prefs.putBoolean("DRAW_BUS_STOPS_NAMES", isNamesDrawable.booleanValue()); //$NON-NLS-1$
			}
			try {
				prefs.sync();
			} catch (BackingStoreException exception) {
				//
			}
		}
	}