public void start ( boolean wait ) throws MessagingException { Thread connector = new JMSBrokerConnector ( ) ; connector . start ( ) ; if ( wait ) { int maxWait = RETRY_INTERVAL * MAX_RETRIES ; int waitTime = 0 ; while ( ! isConnected ( ) ) { if ( waitTime < maxWait ) { try { Thread . sleep ( 100 ) ; waitTime += 100 ; } catch ( InterruptedException ie ) { Thread . currentThread ( ) . interrupt ( ) ; } } else { throw new MessagingException ( "Timeout reached waiting " + "for messaging client to start." ) ; } } } }
Starts the MessagingClient . This method must be called in order to receive messages .