KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > async > api > EventHandler


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tc.async.api;
5
6 import java.util.Collection JavaDoc;
7
8 /**
9  * @author steve Interface for handling either single events or multiple events at one time. For more information of
10  * this kind of stuff google SEDA -Staged Event Driven Architecure
11  */

12 public interface EventHandler {
13
14   /**
15    * Handle one event at a time. Called by the StageController
16    *
17    * @param context
18    * @throws EventHandlerException
19    */

20   public void handleEvent(EventContext context) throws EventHandlerException;
21
22   /**
23    * Handle multiple events at once in a batch. This can be more performant because it avoids context switching
24    *
25    * @param context
26    * @throws EventHandlerException
27    */

28   public void handleEvents(Collection JavaDoc context) throws EventHandlerException;
29
30   /**
31    * Initialize the state of the EventHandler
32    *
33    * @param context
34    */

35   public void initialize(ConfigurationContext context);
36
37   /**
38    * Shut down the stage
39    */

40   public void destroy();
41
42   public void logOnEnter(EventContext context);
43   
44   public void logOnExit(EventContext context);
45 }
Popular Tags