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.html file. *
07: * *
08: * Idea by Rachel Davies, Original code by Aslak Hellesoy and Paul Hammant *
09: *****************************************************************************/package org.picocontainer;
10:
11: /**
12: * <p>An interface which is implemented by components that can be started and stopped. The {@link Startable#start()}
13: * must be called at the begin of the component lifecycle. It can be called again only after a call to
14: * {@link Startable#stop()}. The {@link Startable#stop()} method must be called at the end of the component lifecycle,
15: * and can further be called after every {@link Startable#start()}. If a component implements the {@link Disposable}
16: * interface as well, {@link Startable#stop()} should be called before {@link Disposable#dispose()}.</p>
17: * <p/>
18: * <p>For more advanced and pluggable lifecycle support, see the functionality offered by picocontainer-gems
19: * subproject.</p>
20: * @see org.picocontainer.Disposable the Disposable interface if you need to <code>dispose()</code> semantics.
21: * @author Paul Hammant
22: * @author Aslak Hellesøy
23: */
24: public interface Startable {
25: /**
26: * Start this component. Called initially at the begin of the lifecycle. It can be called again after a stop.
27: */
28: void start();
29:
30: /**
31: * Stop this component. Called near the end of the lifecycle. It can be called again after a further start. Implement
32: * {@link Disposable} if you need a single call at the definite end of the lifecycle.
33: */
34: void stop();
35: }
|