Class MSOfficeConverterPool
- java.lang.Object
-
- com.levigo.jadice.server.core.util.ManagedObjectPool<Class<? extends CommandReceiver>,CommandSender<? extends CommandReceiver>>
-
- com.levigo.jadice.server.msoffice.MSOfficeConverterPool
-
- All Implemented Interfaces:
SelfRegistering
,org.springframework.beans.factory.DisposableBean
,org.springframework.beans.factory.InitializingBean
,org.springframework.jmx.export.naming.SelfNaming
@ManagedResource(description="Microsoft Office Converter pool") public class MSOfficeConverterPool extends ManagedObjectPool<Class<? extends CommandReceiver>,CommandSender<? extends CommandReceiver>>
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_MAX_USAGE_COUNT
-
Constructor Summary
Constructors Constructor Description MSOfficeConverterPool(int maxActive, long maxWait, int maxIdle, int maxUsageCount, ExternalProcessReaper processReaper)
MSOfficeConverterPool(ExternalProcessReaper processReaper)
Initialize anMSOfficeConverterPool
with default parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected CommandSender<? extends CommandReceiver>
doBorrowObject(Class<? extends CommandReceiver> key)
protected void
doInvalidateObject(CommandSender<?> sender)
protected void
doReturnObject(CommandSender<? extends CommandReceiver> object)
protected org.jadice.util.log.Logger
getLogger()
int
getMaxUsageCount()
String
getName()
protected org.apache.commons.pool.impl.GenericKeyedObjectPool
getPool()
ExternalProcessReaper
getProcessReaper()
boolean
isDebug()
void
setDebug(boolean enable)
void
setMaxUsageCount(int maxUsageCount)
void
setName(String name)
void
setProcessReaper(ExternalProcessReaper processReaper)
-
Methods inherited from class com.levigo.jadice.server.core.util.ManagedObjectPool
afterPropertiesSet, borrowObject, clearOldest, clearPool, clearWaitingTimes, destroy, evictPool, getAvgWaitingTime, getMaxActive, getMaxIdle, getMinEvictableIdleTimeMillis, getMinIdle, getNumActive, getNumIdle, getNumInvalidated, getNumReturned, getObjectName, getRecentAvgWaitingTime, getRecentMaxWaitingTime, getRecentMinWaitingTime, getTimeBetweenEvictionRunsMillis, invalidateObject, returnObject, setMaxActive, setMaxIdle, setMinEvictableIdleTimeMillis, setMinIdle, setTimeBetweenEvictionRunsMillis
-
-
-
-
Field Detail
-
DEFAULT_MAX_USAGE_COUNT
public static final int DEFAULT_MAX_USAGE_COUNT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MSOfficeConverterPool
public MSOfficeConverterPool(ExternalProcessReaper processReaper) throws IOException
Initialize anMSOfficeConverterPool
with default parameters.- Throws:
IOException
-
MSOfficeConverterPool
public MSOfficeConverterPool(int maxActive, long maxWait, int maxIdle, int maxUsageCount, ExternalProcessReaper processReaper) throws IOException
- Throws:
IOException
-
-
Method Detail
-
doBorrowObject
protected CommandSender<? extends CommandReceiver> doBorrowObject(Class<? extends CommandReceiver> key) throws Exception
- Specified by:
doBorrowObject
in classManagedObjectPool<Class<? extends CommandReceiver>,CommandSender<? extends CommandReceiver>>
- Throws:
Exception
-
doReturnObject
protected void doReturnObject(CommandSender<? extends CommandReceiver> object) throws Exception
- Specified by:
doReturnObject
in classManagedObjectPool<Class<? extends CommandReceiver>,CommandSender<? extends CommandReceiver>>
- Throws:
Exception
-
doInvalidateObject
protected void doInvalidateObject(CommandSender<?> sender) throws Exception
- Specified by:
doInvalidateObject
in classManagedObjectPool<Class<? extends CommandReceiver>,CommandSender<? extends CommandReceiver>>
- Throws:
Exception
-
getName
public String getName()
- Specified by:
getName
in classManagedObjectPool<Class<? extends CommandReceiver>,CommandSender<? extends CommandReceiver>>
-
setName
public void setName(String name)
-
getPool
protected org.apache.commons.pool.impl.GenericKeyedObjectPool getPool()
- Specified by:
getPool
in classManagedObjectPool<Class<? extends CommandReceiver>,CommandSender<? extends CommandReceiver>>
-
getLogger
protected org.jadice.util.log.Logger getLogger()
- Specified by:
getLogger
in classManagedObjectPool<Class<? extends CommandReceiver>,CommandSender<? extends CommandReceiver>>
-
getProcessReaper
public ExternalProcessReaper getProcessReaper()
- Returns:
- the reaper that cares about any dangling MS Office instance
-
setProcessReaper
public void setProcessReaper(ExternalProcessReaper processReaper)
- Parameters:
processReaper
- the reaper that cares about any dangling MS Office instance
-
getMaxUsageCount
@ManagedAttribute(description="Maximum number of usages of an MS Office instance") public int getMaxUsageCount()
-
setMaxUsageCount
@ManagedAttribute(description="Maximum number of usages of an MS Office instance") public void setMaxUsageCount(int maxUsageCount)
-
isDebug
@ManagedAttribute(description="Enables DEBUG mode, i.e. disables background conversion. DO NOT USE IN A PRODUCTION ENVIRONMENT!") public boolean isDebug()
-
setDebug
@ManagedAttribute(description="Enables DEBUG mode, i.e. disables background conversion. DO NOT USE IN A PRODUCTION ENVIRONMENT!") public void setDebug(boolean enable)
-
-