cz.cuni.amis.dash
Class ServerManager

Package class diagram package ServerManager
java.lang.Object
  extended by cz.cuni.amis.dash.ServerManager

public final class ServerManager
extends Object

Tool for pausing/resuming the UT environment that happens when YaposhEngine encounters node breakpoint. Basically, every time a node breakpoint is encountered by the engine, we want to stop the UT and when the engine is running again, we want to resume the UT.

That presents few problems: 1)How to detect that engine is running again? 2) What about multiple engines of one UT environment, freeze, resume...What to do? 3) How to get host:port of the UT for the logic?

Basically it is something like semaphor.

Author:
HonzaH

Constructor Summary
ServerManager()
           
 
Method Summary
static void clear(IDebugEngine engine)
          Clear all frozen servers that have as initiator passed engine.
static void pause(IDebugEngine blockingEngine, InetSocketAddress serverAddress)
          Pause a UT server at specified address.
static void resume(IDebugEngine resumingEngine, InetSocketAddress serverAddress)
          A UT server is blocked, until all engines that are asking for it to be paused say, that it may resume execution.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServerManager

public ServerManager()
Method Detail

pause

public static void pause(IDebugEngine blockingEngine,
                         InetSocketAddress serverAddress)
                  throws IOException,
                         UnexpectedMessageException
Pause a UT server at specified address.

Parameters:
blockingEngine - Engine that is requesting the pause state of UT.
serverAddress - Address and port of the UT server
Throws:
IOException
UnexpectedMessageException

resume

public static void resume(IDebugEngine resumingEngine,
                          InetSocketAddress serverAddress)
                   throws IOException
A UT server is blocked, until all engines that are asking for it to be paused say, that it may resume execution. By calling this method, engine is saying that it is no longer requesting for a UT server to be paused.

Parameters:
resumingEngine - Engine that is no longer requesting a pause (nothing wrong happens if called many times over or if engine hasn't even requested pause).
serverAddress - Address of UT server the engine is using.
Throws:
IOException

clear

public static void clear(IDebugEngine engine)
                  throws IOException
Clear all frozen servers that have as initiator passed engine.

Parameters:
engine -
Throws:
IOException


Copyright © 2014 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.