org.alfresco.bm.event
Interface EventProcessor

All Known Implementing Classes:
AbstractEventProcessor, AuthenticatedHttpEventProcessor, CreateUser, CreateUsers, DoNothingEventProcessor, PrepareUsers, RaiseEventsEventProcessor, ResultBarrier

public interface EventProcessor

Basic interface that test runner code needs to implement in order to be processed by the Benchmark Server framework.

Notes

Implementations must be stateless.

The result of event processing does not have to contain any further events. However, it is better to publish a 'finished' event as it allows more flexibility in wiring test scenarios together.

    start -> doA -> doB -> doB.done
 
It is possible to remap doB.done above back into doA and thereby create an test that never ends, for example.

Javadoc Good Practice

Document the input (what type of data the input event must the event contain), likely actions and the possible output e.g.
INPUT: An HTTP session (Apache HttpClient} that has been authenticated against the live system and displaying the user's dashboard.
ACTIONS: A random action next action will be chosen from the available screen.
OUTPUT: The next user event will be sheduled e.g. 'click on advanced search box' using event 'share.advancedSearch' ... etc.

Since:
1.0
Author:
Derek Hulley

Method Summary
 long getWarnDelay()
          Provide a hint for the processing framework on how much time should elapse before the warnings need to be issued over the delay
 EventResult processEvent(Event event)
          Process an event.
 

Method Detail

getWarnDelay

long getWarnDelay()
Provide a hint for the processing framework on how much time should elapse before the warnings need to be issued over the delay

Returns:
the maximum event processing time before warnings get issued

processEvent

EventResult processEvent(Event event)
                         throws Exception
Process an event.

NOTE: All errors are treated as terminal i.e. there will be no follow-up events published. The event and result services are provided to allow event processing to be aware of previous and future work. If the service is used to modify queues, the results could be unexpected e.g. clearing the queue will not always mean that no more events will be processed.

Parameters:
event - the event (along with associated data)
Returns:
the result of the process (includes errors and next events)
Throws:
Exception


Copyright © 2012. All Rights Reserved.