public void start() throws JMSException {
  if (destination == null && destinationName == null)   throw new JMSException("MessageDrivenContainer: destination not specified");
  if (connectionFactoryBean == null)   throw new JMSException("MessageDrivenContainer: factory not set");
  if (messageListener == null)   throw new JMSException("MessageDrivenContainer: messageListener not set");
  for (int i=0; i < poolSize; i++) {
    MessageConsumerSession s=createSession();
    s.setMessageListener(messageListener);
    s.setPassword(password);
    s.setUser(user);
    s.setDestination(destination);
    s.setDestinationName(destinationName);
    s.setAtomikosConnectionFactoryBean(connectionFactoryBean);
    s.setDaemonThreads(daemonThreads);
    s.setNotifyListenerOnClose(notifyListenerOnClose);
    s.setMessageSelector(getMessageSelector());
    s.setExceptionListener(exceptionListener);
    s.setNoLocal(noLocal);
    s.setSubscriberName(subscriberName);
    if (getSubscriberName() != null)     s.setSubscriberName(getSubscriberName() + "-" + i);
    s.setNoLocal(getNoLocal());
    s.setClientID(clientID);
    try {
      s.startListening();
    }
 catch (    Exception e) {
      LOGGER.logFatal("Error starting pool",e);
    }
    sessions.add(s);
  }
  setMessageListener(messageListener);
}

public void start ( ) throws JMSException { if ( destination == null && destinationName == null ) throw new JMSException ( "MessageDrivenContainer: destination not specified" ) ; if ( connectionFactoryBean == null ) throw new JMSException ( "MessageDrivenContainer: factory not set" ) ; if ( messageListener == null ) throw new JMSException ( "MessageDrivenContainer: messageListener not set" ) ; for ( int i = 0 ; i < poolSize ; i ++ ) { MessageConsumerSession s = createSession ( ) ; s . setMessageListener ( messageListener ) ; s . setPassword ( password ) ; s . setUser ( user ) ; s . setDestination ( destination ) ; s . setDestinationName ( destinationName ) ; s . setAtomikosConnectionFactoryBean ( connectionFactoryBean ) ; s . setDaemonThreads ( daemonThreads ) ; s . setNotifyListenerOnClose ( notifyListenerOnClose ) ; s . setMessageSelector ( getMessageSelector ( ) ) ; s . setExceptionListener ( exceptionListener ) ; s . setNoLocal ( noLocal ) ; s . setSubscriberName ( subscriberName ) ; if ( getSubscriberName ( ) != null ) s . setSubscriberName ( getSubscriberName ( ) + "-" + i ) ; s . setNoLocal ( getNoLocal ( ) ) ; s . setClientID ( clientID ) ; try { s . startListening ( ) ; } catch ( Exception e ) { LOGGER . logFatal ( "Error starting pool" , e ) ; } sessions . add ( s ) ; } setMessageListener ( messageListener ) ; }
start listening for messages .
