org.apache.sling.commons.threads.impl
Class DefaultThreadPoolManager.Entry
java.lang.Object
org.apache.sling.commons.threads.impl.DefaultThreadPoolManager.Entry
- Enclosing class:
- DefaultThreadPoolManager
protected static final class DefaultThreadPoolManager.Entry
- extends Object
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultThreadPoolManager.Entry
public DefaultThreadPoolManager.Entry(String pid,
ThreadPoolConfig config,
String name,
org.osgi.framework.BundleContext bundleContext)
getPid
public String getPid()
shutdown
public void shutdown()
incUsage
public ThreadPoolFacade incUsage()
- Increments a usage counter and gets the ThreadPoolFacade inside the Entry.
Note this method is not thread safe and must at all time be protected from
multiple threads accessing it at the same time. The counter is volatile and
hence not atomic in updates.
- Returns:
- the thread pool Facade instance after reference counting the usage.
decUsage
public void decUsage()
- Decrement the usage counter, and if its zero initiate a shutdown the entry (and the thread pool).
Note: this method is not thread safe and must at all time be protected from multiple threads
accessing it at the same time. The counter is volatile and hence not atomic in updates.
update
public void update(ThreadPoolConfig config,
String name,
String pid)
getName
public String getName()
isUsed
public boolean isUsed()
getConfig
public ThreadPoolConfig getConfig()
getExecutor
public ThreadPoolExecutor getExecutor()
unregisterMBean
protected void unregisterMBean()
registerMBean
protected void registerMBean()
Copyright © 2007-2013 The Apache Software Foundation. All Rights Reserved.