use of org.guvnor.ala.exceptions.RuntimeOperationException in project kie-wb-common by kiegroup.
the class OpenShiftRuntimeManager method pause.
@Override
public void pause(RuntimeId runtimeId) throws RuntimeOperationException {
OpenShiftRuntime runtime = (OpenShiftRuntime) runtimeRegistry.getRuntimeById(runtimeId.getId());
try {
LOG.info("Pausing runtime: " + runtimeId.getId());
openshift.getOpenShiftClient(runtime.getProviderId()).pause(runtime.getId());
refresh(runtimeId);
LOG.info("Paused runtime: " + runtimeId.getId());
} catch (OpenShiftClientException ex) {
LOG.error("Error Pausing runtime: " + runtimeId.getId(), ex);
throw new RuntimeOperationException("Error Pausing runtime: " + runtimeId.getId(), ex);
}
}
use of org.guvnor.ala.exceptions.RuntimeOperationException in project kie-wb-common by kiegroup.
the class OpenShiftRuntimeExecExecutor method destroy.
@Override
public void destroy(final RuntimeId runtimeId) {
final Optional<OpenShiftProvider> _openshiftProvider = runtimeRegistry.getProvider(runtimeId.getProviderId(), OpenShiftProvider.class);
if (!_openshiftProvider.isPresent()) {
return;
}
OpenShiftProvider openshiftProvider = _openshiftProvider.get();
try {
LOG.info("Destroying runtime: " + runtimeId.getId());
openshift.getOpenShiftClient(openshiftProvider).destroy(runtimeId.getId());
LOG.info("Destroyed runtime: " + runtimeId.getId());
} catch (OpenShiftClientException ex) {
throw new RuntimeOperationException("Error Destroying runtime: " + runtimeId.getId(), ex);
}
runtimeRegistry.deregisterRuntime(runtimeId);
}
use of org.guvnor.ala.exceptions.RuntimeOperationException in project kie-wb-common by kiegroup.
the class WildflyRuntimeManager method restart.
@Override
public void restart(RuntimeId runtimeId) {
WildflyRuntime runtime = (WildflyRuntime) runtimeRegistry.getRuntimeById(runtimeId.getId());
try {
wildfly.getWildflyClient(runtime.getProviderId()).restart(runtime.getId());
refresh(runtimeId);
} catch (WildflyClientException ex) {
throw new RuntimeOperationException("Error Restarting container: " + runtimeId.getId() + "\n\t There as a problem with restarting your application, please check into the Wildfly Logs for more information.", ex);
}
}
use of org.guvnor.ala.exceptions.RuntimeOperationException in project kie-wb-common by kiegroup.
the class WildflyRuntimeManager method pause.
@Override
public void pause(RuntimeId runtimeId) throws RuntimeOperationException {
WildflyRuntime runtime = (WildflyRuntime) runtimeRegistry.getRuntimeById(runtimeId.getId());
try {
wildfly.getWildflyClient(runtime.getProviderId()).stop(runtime.getId());
refresh(runtimeId);
} catch (WildflyClientException ex) {
throw new RuntimeOperationException("Error Pausing container: " + runtimeId.getId() + "\n\t There as a problem with stopping your application, please check into the Wildfly Logs for more information.", ex);
}
}
use of org.guvnor.ala.exceptions.RuntimeOperationException in project kie-wb-common by kiegroup.
the class WildflyRuntimeManager method refresh.
@Override
public void refresh(RuntimeId runtimeId) throws RuntimeOperationException {
WildflyRuntime runtime = (WildflyRuntime) runtimeRegistry.getRuntimeById(runtimeId.getId());
try {
WildflyAppState appState = wildfly.getWildflyClient(runtime.getProviderId()).getAppState(runtime.getId());
WildflyRuntime newRuntime = new WildflyRuntime(runtime.getId(), runtime.getName(), runtime.getConfig(), runtime.getProviderId(), runtime.getEndpoint(), runtime.getInfo(), new WildflyRuntimeState(appState.getState(), runtime.getState().getStartedAt()));
runtimeRegistry.registerRuntime(newRuntime);
} catch (WildflyClientException ex) {
throw new RuntimeOperationException("Error Refreshing container: " + runtimeId.getId() + "\n\t There as a problem with refreshing your application, please check into the Wildfly Logs for more information.", ex);
}
}
Aggregations