Class IMAPAgent
- java.lang.Object
-
- com.levigo.jadice.server.agent.email.imap.IMAPAgent
-
- All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean
,org.springframework.context.Lifecycle
,org.springframework.jmx.export.naming.SelfNaming
@ManagedResource(description="IMAP Agent") public class IMAPAgent extends Object implements org.springframework.jmx.export.naming.SelfNaming, org.springframework.context.Lifecycle, org.springframework.beans.factory.InitializingBean
-
-
Constructor Summary
Constructors Constructor Description IMAPAgent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
acquireLock()
Acquire the permission to start an email conversion.void
afterPropertiesSet()
List<IMAPPickupConfiguration>
getConfigurations()
int
getMaxConcurrentJobCount()
int
getNumberOfWaitingThreads()
Number of threads waiting for a lock to acquire.ObjectName
getObjectName()
boolean
isRunning()
void
jmxStart()
void
jmxStop()
void
releaseLock()
Must be called the an email conversion has finished (whether successful or not)void
setConfigurations(List<IMAPPickupConfiguration> configurations)
void
setMaxConcurrentJobCount(int maxConcurrentJobCount)
void
start()
void
stop()
-
-
-
Method Detail
-
start
public void start()
- Specified by:
start
in interfaceorg.springframework.context.Lifecycle
-
jmxStart
@ManagedOperation(description="Start the IMAP Agent") public void jmxStart()
-
stop
public void stop()
- Specified by:
stop
in interfaceorg.springframework.context.Lifecycle
-
jmxStop
@ManagedOperation(description="Stop the IMAP Agent") public void jmxStop()
-
afterPropertiesSet
public void afterPropertiesSet() throws Exception
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
Exception
-
isRunning
@ManagedAttribute(description="Check if the IMAP Agent is up and running") public boolean isRunning()
- Specified by:
isRunning
in interfaceorg.springframework.context.Lifecycle
-
getNumberOfWaitingThreads
@ManagedAttribute(description="Number of waiting threads. Should usually be zero") public int getNumberOfWaitingThreads()
Number of threads waiting for a lock to acquire. This number should usually be zero; else the performance of jadice server too low to handle the amount of incoming mails.- Returns:
- an estimate number of waiting threads.
- See Also:
getNumberOfWaitingThreads()
-
getObjectName
public ObjectName getObjectName() throws MalformedObjectNameException
- Specified by:
getObjectName
in interfaceorg.springframework.jmx.export.naming.SelfNaming
- Throws:
MalformedObjectNameException
-
getConfigurations
public List<IMAPPickupConfiguration> getConfigurations()
-
setConfigurations
public void setConfigurations(List<IMAPPickupConfiguration> configurations)
-
getMaxConcurrentJobCount
public int getMaxConcurrentJobCount()
-
setMaxConcurrentJobCount
public void setMaxConcurrentJobCount(int maxConcurrentJobCount)
-
acquireLock
public void acquireLock() throws InterruptedException
Acquire the permission to start an email conversion.- Throws:
InterruptedException
- if the current thread is interrupted- See Also:
getMaxConcurrentJobCount()
-
releaseLock
public void releaseLock()
Must be called the an email conversion has finished (whether successful or not)
-
-