-
Notifications
You must be signed in to change notification settings - Fork 20
/
Startable.java
41 lines (36 loc) · 1.22 KB
/
Startable.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
* Made with all the love in the world
* by scireum in Remshalden, Germany
*
* Copyright by scireum GmbH
* http://www.scireum.de - [email protected]
*/
package sirius.kernel;
import sirius.kernel.di.std.AutoRegister;
import sirius.kernel.di.std.Priorized;
/**
* Classes implementing this interface get notified once the framework is started.
* <p>
* In contrast to {@link sirius.kernel.di.Initializable} this might be called a bit later, since the system is first
* initialized and then started up. However, one can assume that all annotations have been processed and dependent parts
* can be accessed.
* <p>
* The framework lifecycle is split into three phases:
* <ul>
* <li>{@link Startable}: Each startable component is invoked during startup.</li>
* <li>{@link Stoppable}: Each stoppable component is invoked during framework shutdown.</li>
* <li>{@link Killable}: The the shutdown process has to wait for a task to finish, this can be used to block until a
* task is completed.</li>
* </ul>
*/
@AutoRegister
public interface Startable extends Priorized {
@Override
default int getPriority() {
return DEFAULT_PRIORITY;
}
/**
* Invoked when the framework starts up.
*/
void started();
}