public final class AgentIndexRunner extends java.lang.Object implements AgentIndexRunnerMBean, javax.management.NotificationListener, javax.management.MBeanRegistration, java.lang.Runnable, IndexChangedListener, javax.management.NotificationEmitter
| Modifier and Type | Method and Description |
|---|---|
void |
addNotificationListener(javax.management.NotificationListener notiflistener,
javax.management.NotificationFilter notfilt,
java.lang.Object obj) |
void |
disable()
Disables indexer
|
void |
enable()
Enables the indexer
|
void |
fileAdded(java.lang.String path,
java.lang.String analyzer)
A file is added to the index database
|
void |
fileRemoved(java.lang.String path)
A file is being removed from the index database
|
void |
fileUpdated(java.lang.String path) |
java.lang.Exception |
getExceptions()
Get Exception from last run
|
static AgentIndexRunner |
getInstance(boolean enabledParam)
Static factory method to get an instance of AgentIndexRunner.
|
javax.management.MBeanNotificationInfo[] |
getNotificationInfo()
Method that the subclass can override, but doesn't have to
|
void |
handleNotification(javax.management.Notification n,
java.lang.Object hb)
Handle timer notifications to the purgatory.
|
void |
index(boolean waitForFinished)
The index method starts a thread that will
start indexing part of the opengrok agent.
|
long |
lastIndexTimeFinished()
Last index time in System.currentmillis
of successful index update
|
long |
lastIndexTimeStarted()
Last index time in System.currentmillis
|
long |
lastIndexTimeUsed()
Last index time usage for successful indexing (no exceptions)
|
void |
postDeregister() |
void |
postRegister(java.lang.Boolean registrationDone) |
void |
preDeregister() |
javax.management.ObjectName |
preRegister(javax.management.MBeanServer serverParam,
javax.management.ObjectName name) |
void |
removeNotificationListener(javax.management.NotificationListener notiflistener) |
void |
removeNotificationListener(javax.management.NotificationListener notiflistener,
javax.management.NotificationFilter filt,
java.lang.Object obj) |
void |
run() |
public static AgentIndexRunner getInstance(boolean enabledParam)
enabledParam - if true, the initial instance should be running or notpublic javax.management.ObjectName preRegister(javax.management.MBeanServer serverParam,
javax.management.ObjectName name)
preRegister in interface javax.management.MBeanRegistrationpublic void postRegister(java.lang.Boolean registrationDone)
postRegister in interface javax.management.MBeanRegistrationpublic void preDeregister()
preDeregister in interface javax.management.MBeanRegistrationpublic void postDeregister()
postDeregister in interface javax.management.MBeanRegistrationpublic void run()
run in interface java.lang.Runnablepublic void disable()
disable in interface AgentIndexRunnerMBeanpublic void enable()
enable in interface AgentIndexRunnerMBeanpublic void handleNotification(javax.management.Notification n,
java.lang.Object hb)
handleNotification in interface javax.management.NotificationListenerpublic void index(boolean waitForFinished)
index in interface AgentIndexRunnerMBeanwaitForFinished - if false the command returns immediately, if true
it will return when the indexing is done.public void fileAdded(java.lang.String path,
java.lang.String analyzer)
IndexChangedListenerfileAdded in interface IndexChangedListenerpath - The path to the file (absolute from source root)analyzer - The analyzer being used to analyze the filepublic void fileRemoved(java.lang.String path)
IndexChangedListenerfileRemoved in interface IndexChangedListenerpath - The path to the file (absolute from source root)public void fileUpdated(java.lang.String path)
public long lastIndexTimeFinished()
AgentIndexRunnerMBeanlastIndexTimeFinished in interface AgentIndexRunnerMBeanpublic long lastIndexTimeStarted()
AgentIndexRunnerMBeanlastIndexTimeStarted in interface AgentIndexRunnerMBeanpublic long lastIndexTimeUsed()
AgentIndexRunnerMBeanlastIndexTimeUsed in interface AgentIndexRunnerMBeanpublic java.lang.Exception getExceptions()
AgentIndexRunnerMBeangetExceptions in interface AgentIndexRunnerMBeanpublic void addNotificationListener(javax.management.NotificationListener notiflistener,
javax.management.NotificationFilter notfilt,
java.lang.Object obj)
throws java.lang.IllegalArgumentException
addNotificationListener in interface javax.management.NotificationBroadcasterjava.lang.IllegalArgumentExceptionpublic void removeNotificationListener(javax.management.NotificationListener notiflistener)
throws javax.management.ListenerNotFoundException
removeNotificationListener in interface javax.management.NotificationBroadcasterjavax.management.ListenerNotFoundExceptionpublic void removeNotificationListener(javax.management.NotificationListener notiflistener,
javax.management.NotificationFilter filt,
java.lang.Object obj)
throws javax.management.ListenerNotFoundException
removeNotificationListener in interface javax.management.NotificationEmitterjavax.management.ListenerNotFoundExceptionpublic javax.management.MBeanNotificationInfo[] getNotificationInfo()
getNotificationInfo in interface javax.management.NotificationBroadcaster