File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed
Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -128,16 +128,25 @@ import ocean.task.Task;
128128 Restarts the fake node, reopening the listening socket on the same port
129129 determined in the initial call to start().
130130
131- Notes:
132- 1. Restarting the node *does not* clear any data in its storage
133- engine. To do that, call clear().
134- 2. You must call stop() first, before calling restart().
131+ Note: Restarting the node *does not* clear any data in its storage
132+ engine. To do that, call clear().
135133
136134 ***************************************************************************/
137- // TODO: make this work without requiring stop first
135+
138136 public void restart ( )
139137 {
140- verify(this .state == State.Stopped, " Node has not been stopped" );
138+ with ( State ) switch ( this .state )
139+ {
140+ case Stopped:
141+ break ;
142+ case Running:
143+ this .stop();
144+ break ;
145+ case Init:
146+ default :
147+ verify(false , " Node has not been started yet" );
148+ break ;
149+ }
141150
142151 this .restartListeners();
143152 this .register(theScheduler.epoll);
You can’t perform that action at this time.
0 commit comments