Commit c4581e73 authored by ics's avatar ics
Browse files

manage server stops

parent f3db0ae2
/*
* Nomad Instrument Control Software
*
* Copyright 2011 Institut Laue-Langevin
*
* Licensed under the EUPL, Version 1.1 only (the "License");
* You may not use this work except in compliance with the Licence.
* You may obtain a copy of the Licence at:
*
* http://joinup.ec.europa.eu/software/page/eupl
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the Licence is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Licence for the specific language governing permissions and
* limitations under the Licence.
*/
package fr.ill.ics.bridge.events;
import fr.ill.ics.cameo.Application;
public class ServerEndedEvent {
private int state;
public ServerEndedEvent(int state) {
this.state = state;
}
public int getState() {
return state;
}
public String getMessage() {
String messageKey = "";
// Switch depending on the real state of the server.
switch (getState()) {
case (Application.State.ERROR):
messageKey = "serverEndedOnErrorMessage";
case (Application.State.KILLED):
messageKey = "serverEndedOnKilledMessage";
case Application.State.SUCCESS:
messageKey = "serverEndedOnSuccessMessage";
case (Application.State.STOPPED):
messageKey = "serverEndedOnStoppedMessage";
}
return messageKey;
}
}
\ No newline at end of file
/*
* Nomad Instrument Control Software
*
* Copyright 2011 Institut Laue-Langevin
*
* Licensed under the EUPL, Version 1.1 only (the "License");
* You may not use this work except in compliance with the Licence.
* You may obtain a copy of the Licence at:
*
* http://joinup.ec.europa.eu/software/page/eupl
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the Licence is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Licence for the specific language governing permissions and
* limitations under the Licence.
*/
package fr.ill.ics.bridge.listeners;
import fr.ill.ics.bridge.events.ServerEndedEvent;
public interface ServerEndedListener {
public void serverEnded(ServerEndedEvent anEvent);
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment