use of com.github.nagyesta.abortmission.strongback.base.StrongbackException in project abort-mission by nagyesta.
the class RmiBackedStageStatisticsCollector method doLogTimeMeasurement.
@Override
protected void doLogTimeMeasurement(final String contextName, final MissionHealthCheckMatcher matcher, final boolean countdown, final StageTimeMeasurement measurement) {
try {
final LaunchStatisticsService service = RmiServiceProvider.service(registry);
final RmiStageTimeMeasurement rmiMeasurement = new RmiStageTimeMeasurement(measurement);
service.insertStageTimeMeasurement(contextName, matcher.getName(), countdown, rmiMeasurement);
} catch (final RemoteException e) {
LOGGER.error("Failed to log measurement.", e);
throw new StrongbackException(e.getMessage(), e);
}
}
use of com.github.nagyesta.abortmission.strongback.base.StrongbackException in project abort-mission by nagyesta.
the class H2ServerManager method doStop.
private void doStop() {
try {
sendShutdownCommand();
Server.shutdownTcpServer(String.format(DEFAULT_TCP_URL_FORMAT, port), password, true, false);
} catch (final Exception ex) {
throw new StrongbackException("Server failed to stop.", ex);
}
}
use of com.github.nagyesta.abortmission.strongback.base.StrongbackException in project abort-mission by nagyesta.
the class RmiServerManager method startServer.
/**
* Starts the server if needed.
*/
public void startServer() {
try {
doStart();
Thread.currentThread().join();
} catch (final InterruptedException ex) {
// ignore
} catch (final Exception ex) {
throw new StrongbackException("Server startup failed.", ex);
}
}
use of com.github.nagyesta.abortmission.strongback.base.StrongbackException in project abort-mission by nagyesta.
the class AbstractInMemoryDataSourceIntegrationTest method setUp.
@BeforeEach
void setUp() throws Exception {
try {
service = new SingletonLaunchStatisticsService();
final Remote abortMissionService = UnicastRemoteObject.exportObject(service, port);
if (Arrays.asList(registry.list()).contains(RmiServerConstants.SERVICE_NAME)) {
registry.rebind(RmiServerConstants.SERVICE_NAME, abortMissionService);
} else {
registry.bind(RmiServerConstants.SERVICE_NAME, abortMissionService);
}
} catch (final Exception ex) {
throw new StrongbackException("Server startup failed.", ex);
}
}
Aggregations