Skip to content

Commit 1d0c274

Browse files
committed
Polish ServiceLifecycle interface
1 parent 2b3fe3d commit 1d0c274

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

openmessaging-api/src/main/java/io/openmessaging/ServiceLifeState.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ public enum ServiceLifeState {
2323
*/
2424
STARTED,
2525

26+
/**
27+
* Service is stopping.
28+
*/
29+
STOPING,
30+
2631
/**
2732
* Service has been shutdown.
2833
*/

openmessaging-api/src/main/java/io/openmessaging/ServiceLifecycle.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,17 @@ public interface ServiceLifecycle {
3737
* Used for startup or initialization of a service endpoint. A service endpoint instance will be in a ready state
3838
* after this method has been completed.
3939
*/
40-
void startup();
40+
void start();
4141

4242
/**
4343
* Notify a service instance of the end of its life cycle. Once this method completes, the service endpoint could be
4444
* destroyed and eligible for garbage collection.
4545
*/
46-
void shutdown();
46+
void stop();
4747

4848
/**
4949
* Used for get service current state, for execution of some operations is dependent on the current service state.
50+
*
5051
* @return This service current state {@link ServiceLifeState}
5152
*/
5253
ServiceLifeState currentState();

0 commit comments

Comments
 (0)