01: /*
02: * Copyright (C) The DNA Group. All rights reserved.
03: *
04: * This software is published under the terms of the DNA
05: * Software License version 1.1, a copy of which has been included
06: * with this distribution in the LICENSE.txt file.
07: */
08: package org.codehaus.dna;
09:
10: /**
11: * Components should implement this interface if they need to
12: * be initialize resources at startup or deallocate resources
13: * during shutdown.
14: *
15: * <p>If the {@link #initialize()} method is invoked upon a
16: * component then the container must invoke the
17: * {@link #dispose()} even if the {@link #initialize()} throws
18: * an Exception.</p>
19: *
20: * @version $Revision: 1.2 $ $Date: 2004/05/01 09:51:48 $
21: */
22: public interface Active {
23: /**
24: * Initialialize the component.
25: * This method gives the component the ability to
26: * perform processing or allocate any resources
27: * before the component becomes operational.
28: *
29: * @throws Exception if unable to initialize component.
30: */
31: void initialize() throws Exception;
32:
33: /**
34: * Dispose the component.
35: * This method gives the component the ability to
36: * perform processing or deallocate any resources
37: * before the component is destroyed.
38: *
39: * @throws Exception if unable to dispose component.
40: */
41: void dispose() throws Exception;
42: }
|