Class IntegrityRemotingServer
- java.lang.Object
-
- de.gebit.integrity.remoting.server.IntegrityRemotingServer
-
public class IntegrityRemotingServer extends Object
The server implementation.- Author:
- Rene Schneider - initial API and implementation
-
-
Constructor Summary
Constructors Constructor Description IntegrityRemotingServer(String aHostIP, int aPort, IntegrityRemotingServerListener aListener, ClassLoader aClassLoader, boolean anIsForkFlag)Creates a new server, listening on a specified port and a specified host IP.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcloseAll(boolean anEmptyOutputQueueFlag)Closes all connections to clients.voidconfirmBreakpointCreation(int anEntryReference)Notifies all clients about the creation of a breakpoint.voidconfirmBreakpointRemoval(int anEntryReference)Notifies all clients about the removal of a breakpoint.protected Map<Class<? extends AbstractMessage>,MessageProcessor<?>>createProcessors()Creates the processors for processing incoming messages.intgetPort()booleanisFork()voidsendAbortMessage(String anExceptionMessage, String anExceptionStackTrace)Transmits an abortion message.voidsendForkResultSummaryMessage(Integer aSuccessCount, Integer aFailureCount, Integer aTestExceptionCount, Integer aCallExceptionCount)Sends a fork result summary message.voidsendTestRunnerCallbackData(String aCallbackClassName, TestRunnerCallbackMethods aMethod, Serializable[] someData)Sends data from a test runner callback in a fork to the master, which will then forward it to the matching callback.voidsendTestTimeSyncRequest(Date aStartDate, List<org.eclipse.xtext.util.Pair<Long,TemporalUnit>> aDiffTime, BigDecimal aProgressionFactor, String[] someTargetedForks)Sends a test time sync message.voidsendTestTimeSyncResponse(TimeSyncResultMessage aResultMessage)Sends a response to a test time sync request.voidsendVariableUnset(String aVariableName)Transmits an unsetting of a variables' value to the master.voidsendVariableUpdate(String aVariableName, Serializable aValue)Transmits an update for a variables' value to the master.voidupdateExecutionState(ExecutionStates aNewState)Updates the execution state, broadcasting a message to all clients to notify them about that change.voidupdateSetList(Integer anEntryInExecution, SetListEntry... someUpdatedEntries)Transmits updates to someSetListEntryinstances to all clients.
-
-
-
Constructor Detail
-
IntegrityRemotingServer
public IntegrityRemotingServer(String aHostIP, int aPort, IntegrityRemotingServerListener aListener, ClassLoader aClassLoader, boolean anIsForkFlag) throws UnknownHostException, IOException
Creates a new server, listening on a specified port and a specified host IP.- Parameters:
aHostIP- the host IP to listen onaPort- the port to listen on (0 = auto-choose a free port)aListener- the listeneraClassLoader- the classloader to use when deserializing objectsanIsForkFlag- whether this remoting server is serving inside an Integrity fork process- Throws:
UnknownHostExceptionIOException
-
-
Method Detail
-
closeAll
public void closeAll(boolean anEmptyOutputQueueFlag)
Closes all connections to clients.- Parameters:
anEmptyOutputQueueFlag- whether the output message queue shall be emptied before closing the connection
-
updateExecutionState
public void updateExecutionState(ExecutionStates aNewState)
Updates the execution state, broadcasting a message to all clients to notify them about that change.- Parameters:
aNewState- the new state
-
updateSetList
public void updateSetList(Integer anEntryInExecution, SetListEntry... someUpdatedEntries)
Transmits updates to someSetListEntryinstances to all clients.- Parameters:
anEntryInExecution- the entry in execution (null if nothing changed)someUpdatedEntries- the updated entries
-
confirmBreakpointCreation
public void confirmBreakpointCreation(int anEntryReference)
Notifies all clients about the creation of a breakpoint.- Parameters:
anEntryReference- the entry at which the breakpoint was created
-
confirmBreakpointRemoval
public void confirmBreakpointRemoval(int anEntryReference)
Notifies all clients about the removal of a breakpoint.- Parameters:
anEntryReference- the entry at which the breakpoint was removed
-
sendTestRunnerCallbackData
public void sendTestRunnerCallbackData(String aCallbackClassName, TestRunnerCallbackMethods aMethod, Serializable[] someData)
Sends data from a test runner callback in a fork to the master, which will then forward it to the matching callback.- Parameters:
aCallbackClassName- the name of the callback classaMethod- the method being calledsomeData- the data
-
sendVariableUpdate
public void sendVariableUpdate(String aVariableName, Serializable aValue)
Transmits an update for a variables' value to the master.- Parameters:
aVariableName- the name of the variableaValue- the updated value
-
sendVariableUnset
public void sendVariableUnset(String aVariableName)
Transmits an unsetting of a variables' value to the master.- Parameters:
aVariableName- the name of the variable
-
sendAbortMessage
public void sendAbortMessage(String anExceptionMessage, String anExceptionStackTrace)
Transmits an abortion message.- Parameters:
anExceptionMessage-anExceptionStackTrace-
-
sendTestTimeSyncRequest
public void sendTestTimeSyncRequest(Date aStartDate, List<org.eclipse.xtext.util.Pair<Long,TemporalUnit>> aDiffTime, BigDecimal aProgressionFactor, String[] someTargetedForks)
Sends a test time sync message.- Parameters:
aStartDate-aProgressionFactor-
-
sendTestTimeSyncResponse
public void sendTestTimeSyncResponse(TimeSyncResultMessage aResultMessage)
Sends a response to a test time sync request.- Parameters:
anExceptionMessage-anExceptionStackTrace-
-
sendForkResultSummaryMessage
public void sendForkResultSummaryMessage(Integer aSuccessCount, Integer aFailureCount, Integer aTestExceptionCount, Integer aCallExceptionCount)
Sends a fork result summary message.- Parameters:
aSuccessCount- the number of successful testsaFailureCount- the number of failed testsaTestExceptionCount- the number of exceptions in testsaCallExceptionCount- the number of call exceptions in tests
-
createProcessors
protected Map<Class<? extends AbstractMessage>,MessageProcessor<?>> createProcessors()
Creates the processors for processing incoming messages.- Returns:
- a map of message classes to processors
-
getPort
public int getPort()
-
isFork
public boolean isFork()
-
-