Class IntegrityRemotingServer


  • public class IntegrityRemotingServer
    extends Object
    The server implementation.
    Author:
    Rene Schneider - initial API and implementation
    • 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 on
        aPort - the port to listen on (0 = auto-choose a free port)
        aListener - the listener
        aClassLoader - the classloader to use when deserializing objects
        anIsForkFlag - whether this remoting server is serving inside an Integrity fork process
        Throws:
        UnknownHostException
        IOException
    • 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 some SetListEntry instances 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 class
        aMethod - the method being called
        someData - 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 variable
        aValue - 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 tests
        aFailureCount - the number of failed tests
        aTestExceptionCount - the number of exceptions in tests
        aCallExceptionCount - 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()