|
|
|
|
@ -45,15 +45,14 @@ public class RestartApplicationListener
@@ -45,15 +45,14 @@ public class RestartApplicationListener
|
|
|
|
|
onApplicationStartingEvent((ApplicationStartingEvent) event); |
|
|
|
|
} |
|
|
|
|
if (event instanceof ApplicationPreparedEvent) { |
|
|
|
|
Restarter.getInstance() |
|
|
|
|
.prepare(((ApplicationPreparedEvent) event).getApplicationContext()); |
|
|
|
|
onApplicationPreparedEvent((ApplicationPreparedEvent) event); |
|
|
|
|
} |
|
|
|
|
if (event instanceof ApplicationReadyEvent |
|
|
|
|
|| event instanceof ApplicationFailedEvent) { |
|
|
|
|
Restarter.getInstance().finish(); |
|
|
|
|
if (event instanceof ApplicationFailedEvent) { |
|
|
|
|
Restarter.getInstance().remove(((ApplicationFailedEvent) event).getApplicationContext()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (event instanceof ApplicationFailedEvent) { |
|
|
|
|
onApplicationFailedEvent((ApplicationFailedEvent) event); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -72,6 +71,14 @@ public class RestartApplicationListener
@@ -72,6 +71,14 @@ public class RestartApplicationListener
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void onApplicationPreparedEvent(ApplicationPreparedEvent event) { |
|
|
|
|
Restarter.getInstance().prepare(event.getApplicationContext()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void onApplicationFailedEvent(ApplicationFailedEvent event) { |
|
|
|
|
Restarter.getInstance().remove(event.getApplicationContext()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public int getOrder() { |
|
|
|
|
return this.order; |
|
|
|
|
|