Package one.microstream.functional
Class ParallelProcedure.LogicProvider.SingletonLogic<S,P extends Consumer<? super S>>
- java.lang.Object
- 
- one.microstream.functional.ParallelProcedure.LogicProvider.SingletonLogic<S,P>
 
- 
- All Implemented Interfaces:
- ParallelProcedure.LogicProvider<S,P>
 - Enclosing interface:
- ParallelProcedure.LogicProvider<S,P extends Consumer<? super S>>
 
 public static final class ParallelProcedure.LogicProvider.SingletonLogic<S,P extends Consumer<? super S>> extends Object implements ParallelProcedure.LogicProvider<S,P> 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface one.microstream.functional.ParallelProcedure.LogicProviderParallelProcedure.LogicProvider.SingletonLogic<S,P extends Consumer<? super S>>
 
- 
 - 
Constructor SummaryConstructors Constructor Description SingletonLogic(P logic)
 - 
Method SummaryModifier and Type Method Description voiddisposeLogic(P logic, Throwable cause)Signals the provider instance that the passed logic instance is no longer used and provides the cause for its disposal (e.g.PprovideLogic()Provides the actual logicConsumerto be applied to the elements enountered by aParallelProcedure.
 
- 
- 
- 
Constructor Detail- 
SingletonLogicpublic SingletonLogic(P logic) 
 
- 
 - 
Method Detail- 
provideLogicpublic P provideLogic() Description copied from interface:ParallelProcedure.LogicProviderProvides the actual logicConsumerto be applied to the elements enountered by aParallelProcedure.This method always gets called by the actual worker thread that will use the provided logic, so that a call of Thread.currentThread()inside the method will always return the logic executing thread. The intention is to give complex provider implementations a chance to get to know the executing thread before the logic is executed. It is however stronly discouraged to try and control the worker thread activity from outside as it can disturb or disrupt the actual thread management. E.g. any explicit interruption can cause the worker thread to be abolished and killed and the logic instance to be disposed.- Specified by:
- provideLogicin interface- ParallelProcedure.LogicProvider<S,P extends Consumer<? super S>>
- Returns:
- the logic instance to be used by a worker thread.
 
 - 
disposeLogicpublic void disposeLogic(P logic, Throwable cause) Description copied from interface:ParallelProcedure.LogicProviderSignals the provider instance that the passed logic instance is no longer used and provides the cause for its disposal (e.g. anInterruptedExceptionbecause the executing worker has been abolished)An implementation of this method can be anything from a no-op to complex resource clean up. - Specified by:
- disposeLogicin interface- ParallelProcedure.LogicProvider<S,P extends Consumer<? super S>>
- Parameters:
- logic- the not longer used logic that shall be disposed.
- cause- the cause for the disposal.
 
 
- 
 
-