01: /*
02: * This file is part of the QuickServer library
03: * Copyright (C) 2003-2005 QuickServer.org
04: *
05: * Use, modification, copying and distribution of this software is subject to
06: * the terms and conditions of the GNU Lesser General Public License.
07: * You should have received a copy of the GNU LGP License along with this
08: * library; if not, you can download a copy from <http://www.quickserver.org/>.
09: *
10: * For questions, suggestions, bug-reports, enhancement-requests etc.
11: * visit http://www.quickserver.org
12: *
13: */
14:
15: package org.quickserver.net;
16:
17: import org.quickserver.net.server.QuickServer;
18:
19: /**
20: * This interface is for any class that would like to become
21: * a server hook. These are event listeners to the QuickServer.
22: * <p>Following types of Server hooks are currently supported.
23: * pre-startup, post-startup, pre-shutdown, post-shutdown.
24: * These classes should have a default constructor. </p>
25: * @see org.quickserver.util.xmlreader.ServerHooks
26: * @see org.quickserver.net.InitServerHook
27: * @author Akshathkumar Shetty
28: * @since 1.3.3
29: */
30: public interface ServerHook {
31: //--types of hooks supported
32: public final static int PRE_STARTUP = 100;
33: public final static int POST_STARTUP = 101;
34: public final static int PRE_SHUTDOWN = 201;
35: public final static int POST_SHUTDOWN = 202;
36:
37: /**
38: * Information about the server hook.
39: */
40: public String info();
41:
42: /**
43: * Method called to perform any initialisation
44: * @param quickserver is the server to which hook belongs to.
45: */
46: public void initHook(QuickServer quickserver);
47:
48: /**
49: * Invoked pre/post server event. If the hook is doing some
50: * action for the even passed it should return true indicating the same.
51: * @see #PRE_STARTUP
52: * @see #POST_STARTUP
53: * @see #PRE_SHUTDOWN
54: * @see #POST_SHUTDOWN
55: */
56: public boolean handleEvent(int event);
57: }
|