public void registerConnection ( Connection connection , ConnectionDefinition connectionDefinition ) { checkNotNull ( connection ) ; checkNotNull ( connectionDefinition ) ; if ( this . connectionDefinitions . putIfAbsent ( connectionDefinition . getName ( ) , connectionDefinition ) != null ) { throw SeedException . createNew ( JmsErrorCode . DUPLICATE_CONNECTION_NAME ) . put ( ERROR_CONNECTION_NAME , connectionDefinition . getName ( ) ) ; } if ( this . connections . putIfAbsent ( connectionDefinition . getName ( ) , connection ) != null ) { throw SeedException . createNew ( JmsErrorCode . DUPLICATE_CONNECTION_NAME ) . put ( ERROR_CONNECTION_NAME , connectionDefinition . getName ( ) ) ; } if ( shouldStartConnections . get ( ) ) { try { connection . start ( ) ; } catch ( JMSException e ) { throw SeedException . wrap ( e , JmsErrorCode . UNABLE_TO_START_JMS_CONNECTION ) . put ( ERROR_CONNECTION_NAME , connectionDefinition . getName ( ) ) ; } } }
Register an existing JMS connection to be managed by the JMS plugin .