Class LambdasPooling
- java.lang.Object
-
- AbstractPooling
-
- LambdasPooling
-
- All Implemented Interfaces:
OnThreadCompletedListener
public class LambdasPooling extends AbstractPooling
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
LambdasPooling.HeavyLoadClass
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
FIRST_DIVIDE
private static java.lang.String
HEAVY_OPERATIONS
private static int
MAXF
private LambdasPooling.HeavyLoadClass
mHeavyLoadClass
private java.util.concurrent.atomic.AtomicReference<java.lang.Double>
mHeavyOperationResult
private java.util.concurrent.atomic.AtomicReference<java.util.List<java.lang.String>>
mPrimeFactorsResult
private static java.lang.String
PRIME_FACTORS
private static java.lang.String
SECON_DIVIDE
-
Constructor Summary
Constructors Constructor Description LambdasPooling()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
after()
void
before()
void
onThreadCompletedListener(java.lang.Thread thread, java.lang.Throwable exception)
When a thread finish its execution, if using aNotifyingThread
and the class is subscribed, this method is called, with theRunnable
which corresponds the just finished thread, and theThrowable
containing the exception (if any exception has benn thrown).void
test()
-
Methods inherited from class AbstractPooling
getThreadsPooling, target
-
-
-
-
Field Detail
-
HEAVY_OPERATIONS
private static final java.lang.String HEAVY_OPERATIONS
- See Also:
- Constant Field Values
-
FIRST_DIVIDE
private static final java.lang.String FIRST_DIVIDE
- See Also:
- Constant Field Values
-
SECON_DIVIDE
private static final java.lang.String SECON_DIVIDE
- See Also:
- Constant Field Values
-
PRIME_FACTORS
private static final java.lang.String PRIME_FACTORS
- See Also:
- Constant Field Values
-
MAXF
private static final int MAXF
- See Also:
- Constant Field Values
-
mHeavyOperationResult
private java.util.concurrent.atomic.AtomicReference<java.lang.Double> mHeavyOperationResult
-
mPrimeFactorsResult
private java.util.concurrent.atomic.AtomicReference<java.util.List<java.lang.String>> mPrimeFactorsResult
-
mHeavyLoadClass
private LambdasPooling.HeavyLoadClass mHeavyLoadClass
-
-
Method Detail
-
before
public void before()
- Overrides:
before
in classAbstractPooling
-
test
public void test()
- Overrides:
test
in classAbstractPooling
-
after
public void after() throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
onThreadCompletedListener
public void onThreadCompletedListener(@NotNull java.lang.Thread thread, @Nullable java.lang.Throwable exception)
Description copied from class:AbstractPooling
When a thread finish its execution, if using aNotifyingThread
and the class is subscribed, this method is called, with theRunnable
which corresponds the just finished thread, and theThrowable
containing the exception (if any exception has benn thrown).Refer to
NotifyingThread.addOnThreadCompletedListener(OnThreadCompletedListener)
for getting more information about subscribing classes.- Specified by:
onThreadCompletedListener
in interfaceOnThreadCompletedListener
- Overrides:
onThreadCompletedListener
in classAbstractPooling
- Parameters:
thread
- the thread that has just finished its execution.exception
- the exception if happened, elsenull
.
-
-