public MessageBroker processBeforeStartup ( MessageBroker broker ) { Service service = broker . getServiceByType ( getServiceClassName ( ) ) ; if ( service == null ) { service = broker . createService ( getServiceId ( ) , getServiceClassName ( ) ) ; if ( getServiceAdapterId ( ) . equals ( this . defaultAdapterId ) ) { service . registerAdapter ( getServiceAdapterId ( ) , getServiceAdapterClassName ( ) ) ; } else { Assert . isAssignable ( ServiceAdapter . class , this . beanFactory . getType ( this . defaultAdapterId ) , "A custom default adapter id must refer to a valid Spring bean that " + "is a subclass of " + ServiceAdapter . class . getName ( ) + ". " ) ; service . registerAdapter ( this . defaultAdapterId , CustomSpringAdapter . class . getName ( ) ) ; } service . setDefaultAdapter ( this . defaultAdapterId ) ; if ( ! ObjectUtils . isEmpty ( this . defaultChannels ) ) { addDefaultChannels ( broker , service ) ; } else { findDefaultChannel ( broker , service ) ; } } return broker ; }
The MessageBroker is checked to see if the Service has already been configured via the BlazeDS XML config . If no existing Service is found one will be installed using the defined configuration properties of this class .