KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > barracuda > core > event > EventPool


1 /*
2  * Copyright (C) 2003 Christian Cryder [christianc@granitepeaks.com]
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * $Id: EventPool.java,v 1.6 2004/02/01 05:16:28 christianc Exp $
19  */

20 package org.enhydra.barracuda.core.event;
21
22 import java.util.*;
23
24 /**
25  * This indterface defines the methods needed to implement an
26  * EventPool
27  */

28 public interface EventPool {
29
30     /**
31      * check out an event from the EventPool.
32      *
33      * @param event the class of event we are interested in checking out
34      * @return the checked out event
35      * @throws NoAvailableEventsException if there are no available events in the queue
36      * @throws InvalidClassException if the event class is not valid
37      */

38     public BaseEvent checkoutEvent(Class JavaDoc event) throws NoAvailableEventsException, InvalidClassException;
39
40     /**
41      * check the event back in, allowing someone
42      * else to have access to it.
43      *
44      * @param event the event we're releasing our lock on
45      */

46     public void releaseEvent(BaseEvent event);
47
48     /**
49      * Cleanup any locked events which weren't released
50      * (they should all be). You should not ever really need
51      * to run this method. It will get invoked automatically
52      * when the cleaner-upper runs
53      */

54     public void cleanupLockedEvents();
55
56     //lb_032801 - Added for patch submitted by Larry Brasfield
57
//[larry.brasfield@theplatform.com] so JVM can exit once
58
//the servlet's destroy() method is called.
59
/**
60      * Shutdown the event pool
61      */

62     public void shutdown();
63 }
64
Popular Tags