public void registerMessageListener ( MessageListenerDefinition messageListenerDefinition ) { checkNotNull ( messageListenerDefinition ) ; ConnectionDefinition connectionDefinition = connectionDefinitions . get ( messageListenerDefinition . getConnectionName ( ) ) ; if ( connectionDefinition . isJeeMode ( ) && messageListenerDefinition . getPoller ( ) == null ) { throw SeedException . createNew ( JmsErrorCode . MESSAGE_POLLER_REQUIRED_IN_JEE_MODE ) . put ( ERROR_CONNECTION_NAME , connectionDefinition . getName ( ) ) . put ( ERROR_MESSAGE_LISTENER_NAME , messageListenerDefinition . getName ( ) ) ; } try { createMessageConsumer ( messageListenerDefinition ) ; } catch ( JMSException e ) { throw SeedException . wrap ( e , JmsErrorCode . UNABLE_TO_CREATE_MESSAGE_CONSUMER ) . put ( ERROR_MESSAGE_LISTENER_NAME , messageListenerDefinition . getName ( ) ) ; } if ( messageListenerDefinitions . putIfAbsent ( messageListenerDefinition . getName ( ) , messageListenerDefinition ) != null ) { throw SeedException . createNew ( JmsErrorCode . DUPLICATE_MESSAGE_LISTENER_NAME ) . put ( ERROR_MESSAGE_LISTENER_NAME , messageListenerDefinition . getName ( ) ) ; } }
Register a message listener definition to be managed by the JMS plugin .