/* (non-Javadoc)
@see com.ibm.ws.sib.admin.JsAdminService#getMessagingEngine(java.lang.String, java.lang.String)
501512
public JsMessagingEngine getMessagingEngine(String busName, String engine) {
    if (!isInitialized()) {
      return null;
    }
    return _jsmain.getMessagingEngine(busName, engine);
  }
940916
@Override
    public String getFormattedMessage() {
        if (formattedMessage == null) {
            formattedMessage = formatMessage(messagePattern, parameters);
        }
        return formattedMessage;
    }
246920
public String getMessagingEngineBus() {
        if (TraceComponent.isAnyTracingEnabled()
            && tc.isEntryEnabled())
            SibTr.entry(tc, "getMessagingEngineBus");
        String returnString = _engine.getBusName();
        if (TraceComponent.isAnyTracingEnabled()
            && tc.isEntryEnabled())
            SibTr.exit(tc, "getMessagingEngineBus", returnString);
        return returnString;
    }
770273
@Override
	protected AbstractMessage retrieveMessage(int handle) throws JMSException
    {
    	return (AbstractMessage)((InMemoryLinkedDataStore)dataStore).retrieve(handle);
    }
405720
public static MessageHandler signallingMessageHandler(final ProcessEngine processEngine) {
        return new MessageHandler() {
            @Override
            public void handleMessage(Message<?> message) throws MessagingException {
                String executionId = message.getHeaders().containsKey("executionId") ?
                        (String) message.getHeaders().get("executionId") : (String) null;

                if (null != executionId)
                    processEngine.getRuntimeService().trigger(executionId);
            }
        };
    }
909418
@Override
    public synchronized void messagingEngineStopping(
                                                     final JsMessagingEngine messagingEngine, final int mode)
    {

        final String methodName = "messagingEngineStopping";
        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled())
        {
            SibTr.entry(this, TRACE, methodName, new Object[] { messagingEngine, Integer.valueOf(mode) });
        }

        SibTr.info(TRACE, "ME_STOPPING_CWSIV0784", new Object[] {
                                                                 messagingEngine.getName(),
                                                                 messagingEngine.getBus() });

//        dropConnection (messagingEngine.getUuid().toString(), null, true);

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled())
        {
            SibTr.exit(this, TRACE, methodName);
        }
    }
13606
@Nullable
  public String getServiceId() throws AppEngineException {
    String serviceId = getText(getNode(document, "appengine-web-app", "service"));
    if (serviceId != null) {
      return serviceId;
    }
    return getText(getNode(document, "appengine-web-app", "module"));
  }
213341
public static String getMessageString(String msgKey) {

        assert (msgKey != null);

        try {

            return bundle.getString(msgKey);

        } catch (MissingResourceException mre) {
            throw new CompilerError(mre.getLocalizedMessage());
        } catch (ClassCastException cce) {
            throw new CompilerError("bundle contains non-string object for key '" + msgKey + "'");
        }
    }
1342291
@Override
  public String getMessage() {
    String additionalInfo = "";
    if (code != null) {
      additionalInfo += "; code: " + code;
    }
    if (requestId != null) {
      additionalInfo += "; request-id: " + requestId;
    }
    return super.getMessage() + additionalInfo;
  }
861382
public SIBUuid8 getMessagingEngineUuid() {
        if (TraceComponent.isAnyTracingEnabled()
            && tc.isEntryEnabled())
            SibTr.entry(tc, "getMessagingEngineUuid");
        SIBUuid8 uuid = _persistentStore.getMessagingEngineUuid();
        if (TraceComponent.isAnyTracingEnabled()
            && tc.isEntryEnabled())
            SibTr.exit(tc, "getMessagingEngineUuid", uuid);
        return uuid;
    }
72233
public JMessageListener getMessageListener(int iIndex)
    {
        if (m_vListenerList == null)
            return null;
        if (iIndex >= m_vListenerList.size())
            return null;
        return m_vListenerList.get(iIndex);
    }
1178465
@Override
    public String getMessage() {
        if (message_ != null) {
            return message_;
        }

        if (getCause() != null) {
            return getCause().getMessage();
        }

        switch (code_) {
            case UNSPECIFIED_ERR:
                return "unknown error";
            case NOT_SUPPORTED_ERR:
                return "not supported";
            case SYNTAX_ERR:
                return "syntax error";
            default:
                return null;
        }
    }
896764
public MessageManager getMessageManager(App application, boolean bCreateIfNotFound)
    {
    	if (application == null)
    		application = this.getDefaultApplication();
        if (this.getMessageApplication(bCreateIfNotFound, application.getProperties()) != null)
            return this.getMessageApplication(bCreateIfNotFound, application.getProperties()).getThickMessageManager();
        return null;
    }
1142154
public static boolean isMessagingEngine (byte[] b) {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "isMessagingEngine", new Object[]{ b });

    boolean rc = false;

    if (b.length > 0) {
      rc = (b[0] == MESSAGINGENGINE);
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "isMessagingEngine", Boolean.valueOf(rc));
    return rc;
  }
36352
public JsMessagingEngine getMessagingEngine(String busName, String engine) {

        String thisMethodName = CLASS_NAME
                                + ".getMessagingEngine(String, String)";

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

        AuditManager auditManager = new AuditManager();
        auditManager.setJMSBusName(busName);
        auditManager.setJMSMessagingEngine(engine);

        Enumeration vEnum = _messagingEngines.elements();
        JsMessagingEngine foundMessagingEngine = null;

        while (vEnum.hasMoreElements() && foundMessagingEngine == null) {

            //Liberty COMMs change
            //In Liberty only one Messaging Engine and connection fctory properties
            //cannot specify Target name.
            //Hence changing the logic to not to compare.

            Object o = vEnum.nextElement();
            Object c = ((MessagingEngine) o).getRuntime();

            foundMessagingEngine = (JsMessagingEngine) c;
            break;
        }

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

        return foundMessagingEngine;
    }
1358296
public void messagingEngineDestroyed(JsMessagingEngine messagingEngine)
    {
        final String methodName = "messagingEngineDestroyed";
        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled())
        {
            SibTr.entry(this, TRACE, methodName, messagingEngine);
        }

        /*
         * If there are no longer any local messaging engines on the required
         * bus, switch to a remote messaging engine
         */

        final JsMessagingEngine[] localMessagingEngines = SibRaEngineComponent
                .getMessagingEngines(_endpointConfiguration.getBusName());

        if (0 == localMessagingEngines.length)
        {
            /*
             * The last local messaging engine for the required bus has been
             * destroyed; we may be able to now connect remotely so kick off
             * a check.
             */

            SibTr.info(TRACE, "ME_DESTROYED_CWSIV0779", new Object[] {
                    messagingEngine.getName(),
                    _endpointConfiguration.getBusName() });

          try
          {
                clearTimer ();
                timerLoop ();
            }
          catch (final ResourceException exception)
          {

                FFDCFilter.processException(exception, CLASS_NAME + "."
                        + methodName, FFDC_PROBE_1, this);
                SibTr.error(TRACE, "MESSAGING_ENGINE_STOPPING_CWSIV0765",
                        new Object[] { exception, messagingEngine.getName(),
                                messagingEngine.getBusName() });
            }
        }
        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled())
        {
            SibTr.exit(this, TRACE, methodName);
        }
    }
63403
public SIMessageHandle getMessageHandle() {
        // If the transient is not set, build the handle from the values in the message and cache it.
        if (cachedMessageHandle == null) {
            byte[] b = (byte[]) jmo.getField(JsHdrAccess.SYSTEMMESSAGESOURCEUUID);
            if (b != null) {
                cachedMessageHandle = new JsMessageHandleImpl(new SIBUuid8(b), (Long) jmo.getField(JsHdrAccess.SYSTEMMESSAGEVALUE));
            }
            else {
                cachedMessageHandle = new JsMessageHandleImpl(null, (Long) jmo.getField(JsHdrAccess.SYSTEMMESSAGEVALUE));
            }
        }
        // Return the (possibly newly) cached value
        return cachedMessageHandle;
    }