Uses of Class
org.silverpeas.core.thread.ManagedThreadPool.ExecutionConfig
-
Packages that use ManagedThreadPool.ExecutionConfig Package Description org.silverpeas.core.thread Provides an engine to manage multi-threaded treatments in Silverpeas. -
-
Uses of ManagedThreadPool.ExecutionConfig in org.silverpeas.core.thread
Methods in org.silverpeas.core.thread that return ManagedThreadPool.ExecutionConfig Modifier and Type Method Description static ManagedThreadPool.ExecutionConfig
ManagedThreadPool.ExecutionConfig. defaultConfig()
Gets an instance of a default execution configuration.ManagedThreadPool.ExecutionConfig
ManagedThreadPool.ExecutionConfig. killThreadsAfterTimeout()
By default the caller get again the control after the timeout whileRunnable
threads continue to run.static ManagedThreadPool.ExecutionConfig
ManagedThreadPool.ExecutionConfig. maxThreadPoolSizeOf(int maxThreadPoolSize)
Gets an instance of an execution configuration with a specified maximum pool of thread.
This is only useful when invokingCallable
instances.static ManagedThreadPool.ExecutionConfig
ManagedThreadPool.ExecutionConfig. timeoutOf(long timeout)
Gets an instance of an execution configuration with a specified timeout in milliseconds.ManagedThreadPool.ExecutionConfig
ManagedThreadPool.ExecutionConfig. withMaxThreadPoolSizeOf(int maxThreadPoolSize)
Sets a maximum size of the pool of threads.
This is only useful when invokingCallable
instances.ManagedThreadPool.ExecutionConfig
ManagedThreadPool.ExecutionConfig. withTimeoutOf(long timeout)
Sets a timeout in milliseconds after that the invocation process will give back hand.ManagedThreadPool.ExecutionConfig
ManagedThreadPool.ExecutionConfig. withTimeoutOf(long timeout, TimeUnit timeUnit)
Sets a timeout after that the invocation process will give back hand.Methods in org.silverpeas.core.thread with parameters of type ManagedThreadPool.ExecutionConfig Modifier and Type Method Description <V> Future<V>
ManagedThreadPool. invoke(Callable<V> callable, ManagedThreadPool.ExecutionConfig config)
Invokes the givenCallable
instance into a managed thread.
If the application server has no more thread to supply, then the execution will wait until it exists one again available.<V> List<Future<V>>
ManagedThreadPool. invoke(List<? extends Callable<V>> callables, ManagedThreadPool.ExecutionConfig config)
Invokes the givenCallable
instances into managed threads.
EachCallable
instance will be used one managed thread.
If the application server has no more thread to supply, then the execution will wait until it exists one again available.
A difference with invokingRunnable
instances is that if a timeout is set the caller will get back the hand after the successful execution of all threads or after the timeout, but never before.void
ManagedThreadPool. invokeAndAwaitTermination(List<? extends Runnable> runnables, ManagedThreadPool.ExecutionConfig config)
void
ManagedThreadPool. invokeAndAwaitTermination(Stream<? extends Runnable> runnables, ManagedThreadPool.ExecutionConfig config)
Invokes the given stream ofRunnable
instances into a managed thread and waiting for the end of execution of all of it.
EachRunnable
instance in the stream will be used one managed thread.
If the application server has no more thread to supply, then the execution will wait until it exists one again available.
-