Cold start version of method to create state associated with Destination.

@param messageProcessor
@param transaction
@throws SIResourceException
321731
protected void createRealizationAndState(
                                             MessageProcessor messageProcessor,
                                             TransactionCommon transaction)
                    throws SIResourceException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(
                        tc,
                        "createRealizationAndState",
                        new Object[] {
                                      messageProcessor,
                                      transaction });

        /*
         * Create associated protocol suppor of appropriate type
         */
        if (isPubSub())
        {
            _pubSubRealization = new PubSubRealization(this,
                            messageProcessor,
                            getLocalisationManager(),
                            transaction);
            _protoRealization = _pubSubRealization;
        }
        else
        {

            _ptoPRealization = new JSPtoPRealization(this,
                            messageProcessor,
                            getLocalisationManager());
            _protoRealization = _ptoPRealization;

        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "createRealizationAndState");
    }
1096372
protected void saveClonedState(Transaction transaction)
                    throws ObjectManagerException {
        final String methodName = "saveClonedState";
        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.entry(this, cclass, methodName, transaction);

        // Loop over all of the ObjecStores.
        java.util.Iterator objectStoreIterator = objectStores.values()
                        .iterator();
        while (objectStoreIterator.hasNext()) {
            ObjectStore objectStore = (ObjectStore) objectStoreIterator.next();

            // Don't bother with ObjectStores that can't be used for recovery.
            if (objectStore.getContainsRestartData()) {

                // Locate any existing copy.
                Token objectManagerStateCloneToken = new Token(objectStore,
                                                               ObjectStore.objectManagerStateIdentifier.longValue());
                // Swap for the definitive Token, if there is one.
                objectManagerStateCloneToken = objectStore.like(objectManagerStateCloneToken);

                ObjectManagerState objectManagerStateClone = (ObjectManagerState) objectManagerStateCloneToken.getManagedObject();

                // Does the cloned state already exist?
                if (objectManagerStateClone == null) {
                    objectManagerStateClone = new ObjectManagerState();
                    objectManagerStateClone.objectStores = objectStores;
                    objectManagerStateClone.becomeCloneOf(this);
                    objectManagerStateCloneToken.setManagedObject(objectManagerStateClone);
                    transaction.add(objectManagerStateClone);

                } else {
                    transaction.lock(objectManagerStateClone);
                    objectManagerStateClone.objectStores = objectStores;
                    objectManagerStateClone.becomeCloneOf(this);
                    transaction.replace(objectManagerStateClone);
                } //  if (objectManagerStateClone == null).
            } // if (objectStore.getContainsRestartData()).
        } // While objectStoreIterator.hasNext().

        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.exit(this, cclass, methodName);
    }
867673
public void createLocalDurableSubscription(
                                               ConsumerDispatcherState subState,
                                               TransactionCommon transaction)
                    throws
                    SIDurableSubscriptionAlreadyExistsException,
                    SIDiscriminatorSyntaxException,
                    SISelectorSyntaxException,
                    SIResourceException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(
                        tc,
                        "createLocalDurableSubscription",
                        new Object[] { subState, transaction });

        // Create new getCursor and consumer dispatchers to return to the calling method
        ConsumerDispatcher consumerDispatcher = null;

        /*
         * Lock the list of durable subscriptions to prevent others creating/using an
         * identical subscription
         */
        synchronized (_consumerDispatchersDurable)
        {
            // If there's already a consumer dispatcher with this client name, then the
            // create must fail according to the current core API semantics.
            consumerDispatcher = getDurableSubscriptionConsumerDispatcher(subState);

            if (consumerDispatcher != null)
            {
                if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                    SibTr.exit(
                               tc,
                               "createLocalDurableSubscription",
                               "Sub Already Exists - " + subState);

                throw new SIDurableSubscriptionAlreadyExistsException(
                                nls.getFormattedMessage(
                                                        "SUBSCRIPTION_ALREADY_EXISTS_ERROR_CWSIP0143",
                                                        new Object[] {
                                                                      subState.getSubscriberID(),
                                                                      _messageProcessor.getMessagingEngineName() },
                                                        null));
            }
            /* We did not find the consumerDispatcher so we create it */

            /*
             * If a transaction was not provided...
             * Create a new LocalTransaction to perform the creation of a durable subscription.
             * Operations will include the creation of the itemstream,the persisting of
             * the durable state and the attaching of the consumerpoint.
             */
            boolean tranProvided = true;
            LocalTransaction siTran = null;

            if (transaction == null)
            {
                tranProvided = false;
                siTran =
                                _baseDestinationHandler
                                                .getTransactionManager()
                                                .createLocalTransaction(false);
                transaction = siTran;
            }

            /*
             * Create the consumerDispatcher, note we do not require this to be done under
             * the localTransaction. If something goes wrong after this operation, the
             * consumerDispatcher will be lost but thats ok.
             */

            Transaction msTran = _messageProcessor.resolveAndEnlistMsgStoreTransaction(transaction);

            try
            {
                /*
                 * Create a reference stream to be used by the durable subscription's
                 * consumer dispatcher
                 */
                final DurableSubscriptionItemStream durableSubscriptionReferenceStream =
                                new DurableSubscriptionItemStream(
                                                subState,
                                                _baseDestinationHandler.getDestinationManager(),
                                                _pubsubMessageItemStream,
                                                msTran);

                /* Create the consumer dispatcher to represent the subscription */
                consumerDispatcher =
                                configureDurableSubscription(durableSubscriptionReferenceStream);
                consumerDispatcher.registerControlAdapterAsMBean();

                //Venu mock mock
                // No ProxyHandler .. so commenting our this 
                /*
                 * // 166833.2
                 * // Generate the subscribeEvent for this new subscription
                 * // to see if this needs to be forwarded to a Neighbouring ME.
                 * _messageProcessor.getProxyHandler().subscribeEvent(
                 * subState,
                 * msTran);
                 */
            } catch (OutOfCacheSpace e)
            {
                // No FFDC code needed
                SibTr.exception(tc, e);
                // Rollback the transaction
                if (!tranProvided)
                    _baseDestinationHandler.handleRollback(siTran);
                if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                    SibTr.exit(
                               tc,
                               "createLocalDurableSubscription",
                               "SIResourceException");
                throw new SIResourceException(
                                nls.getFormattedMessage(
                                                        "SUBSCRIPTION_CREATION_FAILED_CWSIP0033",
                                                        new Object[] {
                                                                      _baseDestinationHandler.getName(),
                                                                      subState.getSubscriberID(),
                                                                      e },
                                                        null),
                                e);

            } catch (MessageStoreException e)
            {
                // MessageStoreException shouldn't occur so FFDC.
                FFDCFilter.processException(
                                            e,
                                            "com.ibm.ws.sib.processor.impl.destination.PubSubRealization.createLocalDurableSubscription",
                                            "1:1093:1.35.2.4",
                                            this);
                SibTr.exception(tc, e);
                // Rollback the transaction
                if (!tranProvided)
                    _baseDestinationHandler.handleRollback(siTran);

                /*
                 * The message store has thrown an exception, which leaves us stuck. Record an ffst,
                 * write a trace record and throw a SIResourceException to the caller.
                 */
                if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                    SibTr.exit(tc, "createLocalDurableSubscription", e);

                SibTr.error(
                            tc,
                            "INTERNAL_MESSAGING_ERROR_CWSIP0003",
                            new Object[] {
                                          "com.ibm.ws.sib.processor.impl.destination.PubSubRealization.createLocalDurableSubscription",
                                          "1:1112:1.35.2.4",
                                          e,
                                          _baseDestinationHandler.getName() });

                throw new SIResourceException(
                                nls.getFormattedMessage(
                                                        "INTERNAL_MESSAGING_ERROR_CWSIP0003",
                                                        new Object[] {
                                                                      "com.ibm.ws.sib.processor.impl.destination.PubSubRealization",
                                                                      "1:1121:1.35.2.4",
                                                                      e,
                                                                      _baseDestinationHandler.getName() },
                                                        null),
                                e);
            } catch (SIDiscriminatorSyntaxException e)
            {
                // No FFDC code needed
                _baseDestinationHandler.handleRollback(siTran);
                if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                    SibTr.exit(tc, "createLocalDurableSubscription", e);
                throw e;
            } catch (SISelectorSyntaxException e)
            {
                // No FFDC code needed
                _baseDestinationHandler.handleRollback(siTran);
                if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                    SibTr.exit(tc, "createLocalDurableSubscription", e);
                throw e;
            }
            //Venu mock mock
            //commenting out as this exception became unreachable
            /*
             * catch (SIResourceException e)
             * {
             * // No FFDC code needed
             * _baseDestinationHandler.handleRollback(siTran);
             * if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
             * SibTr.exit(tc, "createLocalDurableSubscription", e);
             * throw e;
             * }
             */
            catch (RuntimeException e)
            {
                // FFDC
                FFDCFilter.processException(
                                            e,
                                            "com.ibm.ws.sib.processor.impl.destination.PubSubRealization.createLocalDurableSubscription",
                                            "1:1153:1.35.2.4",
                                            this);

                if (siTran != null)
                    _baseDestinationHandler.handleRollback(siTran);
                if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                    SibTr.exit(tc, "createLocalDurableSubscription", e);
                throw e;
            }

            if (!tranProvided)
            {
                /*
                 * If no transaction was provided, this call must have been made from
                 * the core api (i.e. JMS). We can not provide transaction at runtime.
                 * Since we are creating via JMS, we need to attach the consumer
                 * as part of the create operation.
                 */
                try
                {

                    /* We have our own transaction so commit it here */
                    siTran.commit();

                } catch (SIException e)
                {
                    // MessageStoreException shouldn't occur so FFDC.
                    FFDCFilter.processException(
                                                e,
                                                "com.ibm.ws.sib.processor.impl.destination.PubSubRealization.createLocalDurableSubscription",
                                                "1:1182:1.35.2.4",
                                                this);

                    SibTr.exception(tc, e);
                    SibTr.error(
                                tc,
                                "INTERNAL_MESSAGING_ERROR_CWSIP0003",
                                new Object[] {
                                              "com.ibm.ws.sib.processor.impl.destination.PubSubRealization",
                                              "1:1191:1.35.2.4",
                                              e,
                                              _baseDestinationHandler.getName() });

                    // Failed to attach consumer, rollback the creation of the durable sub
                    // and throw exception.
                    _baseDestinationHandler.handleRollback(siTran);

                    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                        SibTr.exit(tc, "createLocalDurableSubscription", e);

                    throw new SIResourceException(
                                    nls.getFormattedMessage(
                                                            "INTERNAL_MESSAGING_ERROR_CWSIP0003",
                                                            new Object[] {
                                                                          "com.ibm.ws.sib.processor.impl.destination.PubSubRealization",
                                                                          "1:1207:1.35.2.4",
                                                                          e,
                                                                          _baseDestinationHandler.getName() },
                                                            null),
                                    e);
                }
            }
            // Transaction was provided

        } // Release the durable subs lock

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "createLocalDurableSubscription");
    }
1261753
void postBackout(Transaction transaction)
                    throws ObjectManagerException
    {
        throw new InvalidStateException(this, InternalTransaction.stateTerminated, InternalTransaction.stateNames[InternalTransaction.stateTerminated]);
    }
1099072
public void update( Transaction transaction ) {
    RestfulUtils.update( TransactionService.PATH, transaction, Transaction.class, super.httpClient );
  }
637315
public void reconstitute(BaseDestinationHandler destinationHandler, 
                           SIMPTransactionManager txManager, 
                           ProducerInputHandler inputHandler)
    throws MessageStoreException, SIException
  {
    if (tc.isEntryEnabled())
      SibTr.entry(tc, "reconstitute", new Object[] {destinationHandler, txManager, inputHandler}); 

    super.reconstitute(destinationHandler, txManager);
    
    reconstituteTargetStreams(inputHandler);
          
    if (tc.isEntryEnabled())
      SibTr.exit(tc, "reconstitute");           
  }
675045
private void checkStarted() throws SIResourceException {
        if (TraceComponent.isAnyTracingEnabled()
            && tc.isEntryEnabled())
            SibTr.entry(tc, "checkStarted");

        synchronized (_mpStartStopLock) {
            if (!isStarted()) {
                if (TraceComponent.isAnyTracingEnabled()
                    && tc.isEntryEnabled())
                    SibTr.exit(tc, "checkStarted", "ME not started");

                throw new SIResourceException(nls.getFormattedMessage(
                                                                      "MESSAGE_PROCESSOR_NOT_STARTED_ERROR_CWSIP0211",
                                                                      new Object[] { getMessagingEngineName(),
                                                                                    getMessagingEngineBus() }, null));
            }
        }

        if (TraceComponent.isAnyTracingEnabled()
            && tc.isEntryEnabled())
            SibTr.exit(tc, "checkStarted");
    }
1198822
public void replaceUuid(SIBUuid8 newUuid, Transaction transaction) throws SIResourceException
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "replaceUuid", new Object[] {newUuid, transaction});

    if (messagingEngineUuid.toString().equals(SIMPConstants.UNKNOWN_UUID))
    {
      messagingEngineUuid = newUuid;
      
      try
      {
        requestUpdate(transaction);
      }
      catch(MessageStoreException e)
      {
        // MessageStoreException shouldn't occur so FFDC.
        FFDCFilter.processException(
          e,
          "com.ibm.ws.sib.processor.impl.store.itemstreams.PtoPMessageItemStream.replaceUuid",
          "1:720:1.93.1.14",
          this);
        
        SibTr.exception(tc, e);
      
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
          SibTr.exit(tc, "replaceUuid", e);
      
        throw new SIResourceException(e);
      }
    }
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "replaceUuid");
    
    return;
  }
26446
public boolean rollbackInsert(MessageItem msg) throws SIResourceException
  {  
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "rollbackInsert", msg);
    boolean updated = updateSourceStream(msg, true);
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "rollbackInsert", new Boolean(updated));
    return updated;
  }
59111
public synchronized void putSITransaction(SITransaction transaction)
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "putSITransaction", transaction);
      Transaction commsTx = (Transaction)transaction;

      int flags = -1;

      if (transaction == null)
      {
         // No transaction - add "no transaction" flags to buffer.
        putInt(0x00000000);
      }
      else
      {
         // First we must search for any optimized transactions as they hold much more information
         // than the old-style ones.
         OptimizedTransaction optTx = null;

         // First see if the transaction is a global one. This could be both optimized or
         // unoptimized but the result is buried within it
         if (transaction instanceof SuspendableXAResource)
         {
            SIXAResource suspendableXARes = ((SuspendableXAResource) transaction).getCurrentXAResource();
            if (suspendableXARes instanceof OptimizedTransaction)
            {
               // The current XA Resource is indeed optimized
               optTx = (OptimizedTransaction) suspendableXARes;
            }
         }
         // Otherwise the actual transaction itself may be an optimized one - this is in the case
         // of an optimized local transaction.
         else if (transaction instanceof OptimizedTransaction)
         {
            optTx = (OptimizedTransaction) transaction;
         }

         // If we are optimized...
         if (optTx != null)
         {
            // Optimized transaction
            flags = CommsConstants.OPTIMIZED_TX_FLAGS_TRANSACTED_BIT;

            boolean local = optTx instanceof SIUncoordinatedTransaction;
            boolean addXid = false;
            boolean endPreviousUow = false;
            if (local)
            {
               flags |= CommsConstants.OPTIMIZED_TX_FLAGS_LOCAL_BIT;
            }
            if (!optTx.isServerTransactionCreated())
            {
               flags |= CommsConstants.OPTIMIZED_TX_FLAGS_CREATE_BIT;
               if (local && optTx.areSubordinatesAllowed())
                  flags |= CommsConstants.OPTIMIZED_TX_FLAGS_SUBORDINATES_ALLOWED;
               optTx.setServerTransactionCreated();
               addXid = !local;
            }
            if (addXid && (optTx.isEndRequired()))
            {
               flags |= CommsConstants.OPTIMIZED_TX_END_PREVIOUS_BIT;
               endPreviousUow = true;
            }
            putInt(flags);
            putInt(optTx.getCreatingConversationId());
            putInt(commsTx.getTransactionId());
            if (addXid)
            {
               if (endPreviousUow)
               {
                  putInt(optTx.getEndFlags());
                  optTx.setEndNotRequired();
               }
               putXid(new XidProxy(optTx.getXidForCurrentUow()));
            }
         }
         else
         {
            // This is an un-optimized transaction - simply append transaction ID.
            putInt(commsTx.getTransactionId());
         }
      }

      if (TraceComponent.isAnyTracingEnabled()) {
        int commsId = -1;
        if (commsTx != null)  commsId = commsTx.getTransactionId();
        CommsLightTrace.traceTransaction(tc, "PutTxnTrace", commsTx, commsId, flags);
      }

      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "putSITransaction");
   }
387817
public void createDestinationLocalization(
      DestinationDefinition destinationDefinition,
      LocalizationDefinition destinationLocalizationDefinition,
      Set destinationLocalizingMEs,      
      boolean isTemporary) throws SIResourceException, SIMPDestinationAlreadyExistsException
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "createDestinationLocalization", new Object[] {
          destinationDefinition, destinationLocalizationDefinition,
          destinationLocalizingMEs,
          new Boolean(isTemporary) });
    
    destinationManager.createDestinationLocalization(destinationDefinition,
        destinationLocalizationDefinition,        
        destinationLocalizingMEs,
        false);
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "createDestinationLocalization");
  }
806967
@Override
    public void add(ItemStream itemStream, long lockID, Transaction transaction) throws MessageStoreException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "add", new Object[] { itemStream, transaction });

        if (_rootMembership != null)
        {
            _rootMembership.addItemStream(itemStream, lockID, transaction);

            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                SibTr.exit(this, tc, "add");
        }
        else
        {
            MessageStoreUnavailableException msue;
            if (!_startupExceptions.isEmpty())
            {
                if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
                    SibTr.event(this, tc, "Operation not possible as MessageStore failed to start!");
                msue = new MessageStoreUnavailableException("Operation not possible as MessageStore failed to start!", _startupExceptions.get(0));
            }
            else
            {
                if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
                    SibTr.event(this, tc, "Operation not possible as MessageStore is unavailable!");
                msue = new MessageStoreUnavailableException("Operation not possible as MessageStore is unavailable!");
            }

            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                SibTr.exit(this, tc, "add");
            throw msue;
        }
    }
978387
public void execute(TransactionCommon t) throws Throwable
    {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        SibTr.entry(tc, "execute", t);

      _aiStream.removeCompletedPrefix(
        t,
        _messageProcessor.getMessageStore().getUniqueLockID(AbstractItem.STORE_NEVER));
      synchronized (_persistentStreamState)
      {
        if (_streamStateRemoveNeedsToWait)
        {
          _persistentStreamState.wait();
        }

        long lockID = _messageProcessor.getMessageStore().getUniqueLockID(AbstractItem.STORE_NEVER);
        _persistentStreamState.lockItemIfAvailable(lockID);
        Transaction msTran = _messageProcessor.resolveAndEnlistMsgStoreTransaction(t);
        _persistentStreamState.remove(msTran, lockID);
      }

      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        SibTr.exit(tc, "execute");
    }
955702
private void deleteSystemDestination(BaseDestinationHandler destinationHandler) throws SINotPossibleInCurrentConfigurationException, SIResourceException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "deleteSystemDestination", new Object[] { destinationHandler });

        synchronized (destinationHandler)
        {
            if (destinationHandler.isToBeDeleted() || !destinationHandler.isSystem())
            {
                // Treat as if the destination does not exist.
                if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                    SibTr.exit(
                               tc,
                               "deleteSystemDestination",
                               "Destination not found as destination is to be deleted, or is system");

                throw new SIMPNotPossibleInCurrentConfigurationException(
                                nls_cwsik.getFormattedMessage(
                                                              "DELETE_SYSTEM_DEST_ERROR_CWSIP0046",
                                                              new Object[] { destinationHandler.getName(), messageProcessor.getMessagingEngineName() }, null));
            }

            // Set the deletion flag in the DH persistently.
            ExternalAutoCommitTransaction transaction = txManager.createAutoCommitTransaction();

            destinationHandler.setToBeDeleted(true);
            destinationIndex.delete(destinationHandler);
            try
            {
                destinationHandler.requestUpdate(transaction);
            } catch (MessageStoreException e)
            {
                // MessageStoreException shouldn't occur so FFDC.
                FFDCFilter.processException(
                                            e,
                                            "com.ibm.ws.sib.processor.impl.DestinationManager.deleteSystemDestination",
                                            "1:5476:1.508.1.7",
                                            this);

                SibTr.exception(tc, e);
                if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                    SibTr.exit(tc, "deleteSystemDestination", "SIResourceException");
                throw new SIResourceException(e);
            }

            // Close all connections to the localisation
            // Ensure that before calling these methods, the destination is marked
            // to-be-deleted or is marked as deleted, to avoid any new producers and
            // consumers attaching after we have closed the currently attached ones.
            destinationHandler.closeProducers();
            destinationHandler.closeConsumers();

            //Add all the localisations to the set of those requiring clean-up
            destinationHandler.addAllLocalisationsForCleanUp();

            //Clear the set of ME's that localise the destination
            destinationHandler.clearLocalisingUuidsSet();

            startAsynchDeletion();

        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "deleteSystemDestination");
    }
449446
private synchronized void createProducerSession()

  throws SIResourceException
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "createProducerSession");

    if (iProducerSession == null)
    {

      try
      {
        iProducerSession =
          (ProducerSessionImpl) iProxyHandler
            .getMessageProcessor()
            .getSystemConnection()
            .createSystemProducerSession(iRemoteQueue, null, null, null, null);
      }
      catch (SIException e)
      {
        // No exceptions should occur as the destination should always exists
        // as it is created at start time.
        FFDCFilter.processException(
          e,
          "com.ibm.ws.sib.processor.proxyhandler.Neighbour.createProducerSession",
          "1:434:1.107",
          this);

        SibTr.exception(tc, e);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
          SibTr.exit(tc, "createProducerSession", "SIResourceException");

        // this is already NLS'd //175907
        throw new SIResourceException(e);
      }

    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "createProducerSession");
  }
418095
final protected void eventPrecommitAdd(MessageItem msg, final TransactionCommon transaction) throws SIDiscriminatorSyntaxException, SIResourceException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "eventPrecommitAdd", new Object[] { msg, transaction });

        if (!(_destination.isToBeDeleted()))
        {
            if (msg.isTransacted() && (!(msg.isToBeStoredAtSendTime())))
            {
                // LockR the destination to prevent reallocation from occurring on the chosen localisation
                LockManager reallocationLock = _destination.getReallocationLockManager();
                reallocationLock.lock();
                try
                {
                    // If we fixed the ME it'll be in the routing address in the message
                    SIBUuid8 fixedME = null;
                    JsDestinationAddress routingAddr = msg.getMessage().getRoutingDestination();
                    if (routingAddr != null)
                        fixedME = routingAddr.getME();

                    // If the sender prefers any local ME over others then we'll give it a go
                    SIBUuid8 preferredME = null;
                    if (msg.preferLocal())
                    {
                        if (_destination.hasLocal())
                            preferredME = _messageProcessor.getMessagingEngineUuid();
                    }
                    // 176658.3.5
                    OutputHandler handler = _destination.choosePtoPOutputHandler(fixedME,
                                                                                 preferredME,
                                                                                 !msg.isFromRemoteME(),
                                                                                 msg.isForcePut(),
                                                                                 null);

                    if (handler == null)
                    {
                        // We can't find a suitable localisation.
                        // Although a queue must have at least one localisation this is
                        // possible if the sender restricted the potential localisations
                        // using a fixed ME or a scoping alias (to an out-of-date set of
                        // localisation)

                        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                        {
                            SibTr.debug(tc, "No suitable OutputHandler found for " + _destination.getName() + " (" + fixedME + ")");
                        }

                        //Put the message to the exception destination.
                        handleUndeliverableMessage(_destination
                                                   , null // null LinkHandler
                                                   , msg
                                                   , SIRCConstants.SIRC0026_NO_LOCALISATIONS_FOUND_ERROR
                                                   , new String[] { _destination.getName() }
                                                   , transaction);
                    }
                    else
                    {
                        //Indicate in the message if this was a guess
                        msg.setStreamIsGuess(handler.isWLMGuess());

                        // put the message to the output handler
                        handler.put(msg, transaction, null, true);
                    }
                } finally
                {
                    // unlock the reallocation lock
                    reallocationLock.unlock();
                }
            }
        }
        else
        {
            //The destination has been deleted.  Put the message to the exception destination#
            ExceptionDestinationHandlerImpl exceptionDestinationHandlerImpl =
                            (ExceptionDestinationHandlerImpl) _messageProcessor.createExceptionDestinationHandler(null);

            //Set indicator to send the message to the exception destination immediately,
            //rather than registering it for pre-prepare of the transaction, as this is
            //pre-prepare of the transaction!
            msg.setStoreAtSendTime(true);

            String destName = _destination.getName();
            if (_destination.isLink())
                destName = ((LinkHandler) _destination).getBusName();

            final UndeliverableReturnCode rc =
                            exceptionDestinationHandlerImpl.handleUndeliverableMessage(msg
                                                                                       , transaction
                                                                                       , SIRCConstants.SIRC0032_DESTINATION_DELETED_ERROR
                                                                                       , new String[] { destName,
                                                                                                       _messageProcessor.getMessagingEngineName() });
            if (rc != UndeliverableReturnCode.OK)
            {
                if (rc == UndeliverableReturnCode.DISCARD)
                {
                    //The message is to be discarded.  Do nothing and it will disappear.
                }
                else
                {
                    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                        SibTr.exit(tc, "eventPrecommitAdd", "WsRuntimeException");
                    //We cannot put the message to the exception destination.  All we can
                    //do in this case is rollback the users transaction.  This is done by
                    //throwing an exception that is caught by the transaction manager.
                    throw new WsRuntimeException(
                                    nls.getFormattedMessage(
                                                            "DESTINATION_DELETED_ERROR_CWSIP0247",
                                                            new Object[] { _destination.getName(),
                                                                          rc },
                                                            null));
                }
            }
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "eventPrecommitAdd");
    }
263709
public void createTransitionsForState(final Flow flow, final String stateId, final Map<String, String> criteriaAndTargets) {
        if (containsFlowState(flow, stateId)) {
            val state = getState(flow, stateId);
            criteriaAndTargets.forEach((k, v) -> createTransitionForState(state, k, v));
        }
    }