01: /*****************************************************************************
02: * Copyright (C) PicoContainer Organization. All rights reserved. *
03: * ------------------------------------------------------------------------- *
04: * The software in this package is published under the terms of the BSD *
05: * style license a copy of which has been included with this distribution in *
06: * the LICENSE.txt file. *
07: * *
08: * Original code by Paul Hammant *
09: *****************************************************************************/package org.picocontainer;
10:
11: /**
12: * Behaviors modify the components created by a Injector with additional behaviors
13: *
14: * @author Paul Hammant
15: * @author Jörg Schaible
16: * @author Mauro Talevi
17: * @see LifecycleStrategy
18: */
19: public interface Behavior<T> extends ComponentAdapter<T> {
20:
21: /**
22: * Invoke the "start" method on the component.
23: * @param container the container to "start" the component
24: */
25: void start(PicoContainer container);
26:
27: /**
28: * Invoke the "stop" method on the component.
29: * @param container the container to "stop" the component
30: */
31: void stop(PicoContainer container);
32:
33: /**
34: * Invoke the "dispose" method on the component.
35: * @param container the container to "dispose" the component
36: */
37: void dispose(PicoContainer container);
38:
39: /**
40: * Test if a component honors a lifecycle.
41: * @return <code>true</code> if the component has a lifecycle
42: */
43: boolean componentHasLifecycle();
44:
45: }
|