private boolean isListenerRequired(final JsMessagingEngine messagingEngine)
            throws ResourceException {

        final String methodName = "isListenerRequired";
        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.entry(this, TRACE, methodName, messagingEngine);
        }

        boolean listenerRequired = false;

        /*
         * Determine the required messaging engines
         */

        final Set requiredMessagingEngines = getRequiredMessagingEngines(messagingEngine);

        if (requiredMessagingEngines.size() > 0) {

            /*
             * A particular set of messaging engines is required - create a
             * listener if this is one of them
             */

            if (requiredMessagingEngines.contains(messagingEngine.getUuid()
                    .toString())) {

                listenerRequired = true;

            }

        } else {

            /*
             * A connection to any one messaging engine is required - create a
             * listener if we don't already have a connection to another
             * messaging engine
             */

            if (_connections.size() == 0) {

                listenerRequired = true;

            }

        }

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.exit(this, TRACE, methodName, Boolean
                    .valueOf(listenerRequired));
        }
        return listenerRequired;

    }
private boolean isListenerRequired ( final JsMessagingEngine messagingEngine ) throws ResourceException { final String methodName = "isListenerRequired" ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , methodName , messagingEngine ) ; } boolean listenerRequired = false ; final Set requiredMessagingEngines = getRequiredMessagingEngines ( messagingEngine ) ; if ( requiredMessagingEngines . size ( ) > 0 ) { if ( requiredMessagingEngines . contains ( messagingEngine . getUuid ( ) . toString ( ) ) ) { listenerRequired = true ; } } else { if ( _connections . size ( ) == 0 ) { listenerRequired = true ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . exit ( this , TRACE , methodName , Boolean . valueOf ( listenerRequired ) ) ; } return listenerRequired ; }
Determines if a listener is required for the given messaging engine.

@param messagingEngine
the messaging engine
@return <code>true</code> if the messaging engine is in the required
set or the set is empty and there are currently no connections,
otherwise <code>false</code>
@throws ResourceException
if the required messaging engines could not be determined