public class ExecutorQueueService extends AbstractQueueService implements LifecycleQueueService, org.osgi.service.cm.ManagedService
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
EXECUTOR_QUEUE_SERVICE_PID
Service PID used to identify service with ConfigAdmin.
|
static java.lang.String |
THREADPOOL_SIZE_PROPERTY
Property name used to configure this ThreadPool's size (usable as System Property or ConfigAdmin property).
|
m_listenersm_bundleContextASYNCHRONOUS_QUEUE_MODE, GLOABL_QUEUE_SCOPE, PREFERENCE_QUEUE_MODE, QUEUE_MODE_PROPERTY, QUEUE_SCOPE_PROPERTY, SYNCHRONOUS_QUEUE_MODE| Constructor and Description |
|---|
ExecutorQueueService(org.osgi.framework.BundleContext bundleContext)
Creates the queue service using the default pool size.
|
ExecutorQueueService(org.osgi.framework.BundleContext bundleContext,
int size)
Creates the queue service.
|
ExecutorQueueService(org.osgi.framework.BundleContext bundleContext,
int size,
java.util.concurrent.ThreadFactory threadFactory)
Creates the queue service.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getCurrents() |
int |
getFinished() |
protected java.util.Dictionary<java.lang.String,?> |
getServiceProperties() |
int |
getWaiters() |
java.util.List<JobInfo> |
getWaitersInfo() |
protected org.osgi.framework.ServiceRegistration<?> |
registerService() |
void |
stop()
Stops the service.
|
<T> java.util.concurrent.Future<T> |
submit(Job<T> callable)
Submits a job to the queue service.
|
<T> java.util.concurrent.Future<T> |
submit(Job<T> callable,
Callback<T> callback,
java.lang.String description)
Submits a job to the queue.
|
<T> java.util.concurrent.Future<T> |
submit(Job<T> callable,
java.lang.String description)
Submits a job to the queue service.
|
void |
updated(java.util.Dictionary properties) |
addQueueListener, fireEnlistedJobInfo, fireExecutedJobInfo, fireFailedJobInfo, fireStartedJobInfo, removeQueueListenergetBundleContext, getRegistration, isRegistered, startclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddQueueListener, removeQueueListenerpublic static final java.lang.String THREADPOOL_SIZE_PROPERTY
public static final java.lang.String EXECUTOR_QUEUE_SERVICE_PID
public ExecutorQueueService(org.osgi.framework.BundleContext bundleContext)
bundleContext - the bundle context.public ExecutorQueueService(org.osgi.framework.BundleContext bundleContext,
int size)
bundleContext - the bundle context.size - the thread pool size.public ExecutorQueueService(org.osgi.framework.BundleContext bundleContext,
int size,
java.util.concurrent.ThreadFactory threadFactory)
bundleContext - the bundle context.size - the thread pool sizethreadFactory - the thread factoryprotected org.osgi.framework.ServiceRegistration<?> registerService()
registerService in class AbstractServicepublic void stop()
stop in interface Lifecyclestop in class AbstractServiceprotected java.util.Dictionary<java.lang.String,?> getServiceProperties()
getServiceProperties in class AbstractServicepublic int getFinished()
getFinished in interface QueueServicepublic int getWaiters()
getWaiters in interface QueueServicepublic int getCurrents()
getCurrents in interface QueueServicepublic java.util.List<JobInfo> getWaitersInfo()
getWaitersInfo in interface QueueServicepublic <T> java.util.concurrent.Future<T> submit(Job<T> callable, Callback<T> callback, java.lang.String description)
JobInfoCallable to collect the
statistics.submit in interface QueueServicecallable - the jobcallback - callback called when the job is processeddescription - a description of the jobpublic <T> java.util.concurrent.Future<T> submit(Job<T> callable, java.lang.String description)
QueueServicesubmit in interface QueueServicecallable - the jobdescription - a description of the jobpublic <T> java.util.concurrent.Future<T> submit(Job<T> callable)
QueueServicesubmit in interface QueueServicecallable - the jobpublic void updated(java.util.Dictionary properties)
throws org.osgi.service.cm.ConfigurationException
updated in interface org.osgi.service.cm.ManagedServiceorg.osgi.service.cm.ConfigurationExceptionCopyright © 2006-2014 The Apache Software Foundation. All Rights Reserved.