public static MessageBatcher createBatcher ( String name , MessageProcessor processor ) { MessageBatcher batcher = batcherMap . get ( name ) ; if ( batcher == null ) { synchronized ( BatcherFactory . class ) { batcher = batcherMap . get ( name ) ; if ( batcher == null ) { batcher = new MessageBatcher ( name , processor ) ; batcherMap . put ( name , batcher ) ; } } } return batcher ; }
Creates the batcher . The user needs to make sure another batcher already exists before they create one .