public void addAndStartListener ( final ProcessorListener < ApiType > processorListener ) { lock . writeLock ( ) . lock ( ) ; try { addListenerLocked ( processorListener ) ; executorService . execute ( processorListener ) ; } finally { lock . writeLock ( ) . unlock ( ) ; } }
addAndStartListener first adds the specific processorListener then starts the listener with executor .