|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.sling.event.impl.AbstractRepositoryEventHandler
org.apache.sling.event.impl.TimedJobHandler
@Service(value=TimedEventStatusProvider.class)
@Properties(value={@Property(name="event.topics",propertyPrivate=true,value={"org/osgi/framework/BundleEvent/UPDATED","org/osgi/framework/BundleEvent/STARTED","org/apache/sling/event/timed"}),@Property(name="repository.path",value="/var/eventing/timed-jobs",propertyPrivate=true)})
public class TimedJobHandlerAn event handler for timed events.
| Nested Class Summary | |
|---|---|
protected static class |
TimedJobHandler.ScheduleInfo
|
| Nested classes/interfaces inherited from class org.apache.sling.event.impl.AbstractRepositoryEventHandler |
|---|
AbstractRepositoryEventHandler.EventInfo |
| Field Summary |
|---|
| Fields inherited from class org.apache.sling.event.impl.AbstractRepositoryEventHandler |
|---|
CONFIG_PROPERTY_REPO_PATH, environment, logger, queue, repositoryPath, running, writeLock, writeQueue, writerSession |
| Fields inherited from interface org.apache.sling.event.TimedEventStatusProvider |
|---|
PROPERTY_EVENT_ID |
| Constructor Summary | |
|---|---|
TimedJobHandler()
|
|
| Method Summary | |
|---|---|
protected void |
addNodeProperties(javax.jcr.Node eventNode,
org.osgi.service.event.Event event)
Add properties when storing event in repository. |
void |
cancelTimedEvent(java.lang.String jobId)
Cancel this timed event. |
void |
execute(org.apache.sling.commons.scheduler.JobContext context)
|
protected java.lang.String |
getEventNodeType()
Return the node type for the event. |
org.osgi.service.event.Event |
getScheduledEvent(java.lang.String topic,
java.lang.String eventId,
java.lang.String jobId)
Return the scheduled event with the given id. |
java.util.Collection<org.osgi.service.event.Event> |
getScheduledEvents(java.lang.String topic,
java.util.Map<java.lang.String,java.lang.Object>... filterProps)
Return a list of currently schedulded events. |
void |
handleEvent(org.osgi.service.event.Event event)
|
protected void |
loadEvents()
Load all active timed events from the repository. |
void |
onEvent(javax.jcr.observation.EventIterator iter)
|
protected java.lang.String |
persistEvent(org.osgi.service.event.Event event,
TimedJobHandler.ScheduleInfo scheduleInfo)
|
protected boolean |
processEvent(org.osgi.service.event.Event event,
TimedJobHandler.ScheduleInfo scheduleInfo)
Process the event. |
protected void |
processWriteQueue()
|
protected void |
runInBackground()
|
protected void |
startWriterSession()
Start the repository session and add this handler as an observer for new events created on other nodes. |
| Methods inherited from class org.apache.sling.event.impl.AbstractRepositoryEventHandler |
|---|
activate, addEventProperties, deactivate, getWriterRootNode, ignoreException, readEvent, stopWriterSession, writeEvent |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TimedJobHandler()
| Method Detail |
|---|
protected void startWriterSession()
throws javax.jcr.RepositoryException
AbstractRepositoryEventHandler
startWriterSession in class AbstractRepositoryEventHandlerjavax.jcr.RepositoryExceptionAbstractRepositoryEventHandler.startWriterSession()protected void processWriteQueue()
processWriteQueue in class AbstractRepositoryEventHandlerAbstractRepositoryEventHandler.processWriteQueue()protected void runInBackground()
runInBackground in class AbstractRepositoryEventHandlerAbstractRepositoryEventHandler.runInBackground()
protected java.lang.String persistEvent(org.osgi.service.event.Event event,
TimedJobHandler.ScheduleInfo scheduleInfo)
protected boolean processEvent(org.osgi.service.event.Event event,
TimedJobHandler.ScheduleInfo scheduleInfo)
event - The incomming event.
public void onEvent(javax.jcr.observation.EventIterator iter)
onEvent in interface javax.jcr.observation.EventListenerEventListener.onEvent(javax.jcr.observation.EventIterator)public void handleEvent(org.osgi.service.event.Event event)
handleEvent in interface org.osgi.service.event.EventHandlerEventHandler.handleEvent(org.osgi.service.event.Event)public void execute(org.apache.sling.commons.scheduler.JobContext context)
execute in interface org.apache.sling.commons.scheduler.JobJob.execute(org.apache.sling.commons.scheduler.JobContext)protected void loadEvents()
javax.jcr.RepositoryException
protected void addNodeProperties(javax.jcr.Node eventNode,
org.osgi.service.event.Event event)
throws javax.jcr.RepositoryException
AbstractRepositoryEventHandler
addNodeProperties in class AbstractRepositoryEventHandlerjavax.jcr.RepositoryExceptionorg.apache.sling.engine.event.impl.JobPersistenceHandler#addNodeProperties(javax.jcr.Node, org.osgi.service.event.Event)protected java.lang.String getEventNodeType()
AbstractRepositoryEventHandler
getEventNodeType in class AbstractRepositoryEventHandlerAbstractRepositoryEventHandler.getEventNodeType()
public org.osgi.service.event.Event getScheduledEvent(java.lang.String topic,
java.lang.String eventId,
java.lang.String jobId)
TimedEventStatusProvider
getScheduledEvent in interface TimedEventStatusProviderTimedEventStatusProvider.getScheduledEvent(java.lang.String, java.lang.String, java.lang.String)
public java.util.Collection<org.osgi.service.event.Event> getScheduledEvents(java.lang.String topic,
java.util.Map<java.lang.String,java.lang.Object>... filterProps)
TimedEventStatusProvider
getScheduledEvents in interface TimedEventStatusProvidertopic - Topic can be used as a filter, if it is non-null, only jobs with this topic will be returned.filterProps - A list of filter property maps. Each map acts like a template. The searched event
must match the template (AND query). By providing several maps, different filters
are possible (OR query).
TimedEventStatusProvider.getScheduledEvents(java.lang.String, java.util.Map...)public void cancelTimedEvent(java.lang.String jobId)
TimedEventStatusProvider
cancelTimedEvent in interface TimedEventStatusProviderjobId - The unique identifer as found in the property TimedEventStatusProvider.PROPERTY_EVENT_ID.TimedEventStatusProvider.cancelTimedEvent(java.lang.String)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||