public class EngineStub extends Object
The EngineStub class takes care of connecting to and disconnecting from the server. Connections can be local and remote. For local (aka. native) connections, the server process is started by the engine stub on the local machine and communication is handled via pipes. On disconnect the server process is killed. Remote connections do not start a server. Instead, the stub will try to connect to a running server.
The serverHost and serverPort properties determine which host and on which port to connect to the server for remote connections. The connectionMode is used to determine the kind of connection to establish. If connectionMode is BOTH, then the stub will first attempt to create a remote connection and if that fails create a local connection. The serverPath holds the name of the server executable to execute in local mode. After a successful connection has been established the port to which the connection has been established can be queried with getConnectedPort(). Notice that the serverPort property plays no role for local connections.
The server protocol is not state less, as there is a notion of uploading a model and certain operations are only valid after uploading a model. You most likely want to use the Engine class rather than the EngineStub.
Modifier and Type | Field and Description |
---|---|
static int |
BOTH
Try remote connection first, then local.
|
static String |
DEFAULT_HOST
The default host for remote connections.
|
static int |
DEFAULT_PORT
The default port for remote connections.
|
static int |
LOCAL
Local connections only.
|
static int |
SERVER
Remote connections only..
|
Constructor and Description |
---|
EngineStub()
Constructs an EngineStub in LOCAL connection mode.
|
EngineStub(int mode,
int port,
String host,
String path)
Constructs an EngineStub with the given mode, port, port and
server path values.
|
Modifier and Type | Method and Description |
---|---|
void |
connect()
Connect to the server.
|
void |
disconnect()
Disconnect from the server.
|
ConcreteState |
getConcreteInitial(UppaalSystem system)
Returns the initial concrete state for the system.
|
ConcreteSuccessor |
getConcreteSuccessor(UppaalSystem system,
ConcreteState state,
SystemEdgeSelect[] edges,
BigDecimal currentTime,
BigDecimal delay) |
int |
getConnectedPort()
Returns the port the engine is connected to.
|
int |
getConnectionMode()
Returns the current connection mode.
|
GanttChart |
getGanttChart(UppaalSystem system,
BigDecimal globalTime) |
String |
getOptionsInfo()
Returns information about available options.
|
String |
getServerHost()
Returns the current server host.
|
String |
getServerPath()
Returns the current server path.
|
int |
getServerPort()
Returns the current server port.
|
SymbolicState |
getSymbolicInitial(UppaalSystem system)
Returns the initial state for the system.
|
ArrayList<SymbolicTransition> |
getTransitions(UppaalSystem system,
SymbolicState state)
Returns the list of outgoing transitions for the state.
|
String |
getVersion()
Returns the version string of the server.
|
void |
handshake()
Performs a handshake with the server.
|
boolean |
isConnected()
Returns true if the engine is connected to a server.
|
boolean |
isRemoteConnection()
Returns true if the engine is connected to a remote server.
|
void |
kill()
Kill the server connection the hard way.
|
char |
query(UppaalSystem system,
String query,
QueryFeedback f)
Verify a query on an instantiated UPPAAL model.
|
void |
setConnectionMode(int mode)
Sets the connection mode.
|
void |
setOptions(String options)
Sets server options used for verification.
|
void |
setServerHost(String host)
Sets the server host.
|
void |
setServerPath(String path)
Sets the server path.
|
void |
setServerPort(int port)
Sets the server port.
|
UppaalSystem |
upload(Document document)
Upload the document to the server.
|
UppaalSystem |
upload(Document document,
ArrayList<Problem> problems)
Upload the document to the server.
|
LscProcess |
uploadLsc(Document document,
ArrayList<Problem> problems) |
public static int LOCAL
public static int SERVER
public static int BOTH
public static String DEFAULT_HOST
public static int DEFAULT_PORT
public EngineStub()
public int getServerPort()
public void setServerPort(int port)
public int getConnectionMode()
public void setConnectionMode(int mode)
public String getServerHost()
public void setServerHost(String host)
public String getServerPath()
public int getConnectedPort()
public void setServerPath(String path)
public boolean isConnected()
public boolean isRemoteConnection()
public void connect() throws EngineException, IOException
EngineException
IOException
public void disconnect()
public void kill()
public void handshake() throws IOException, EngineException
IOException
EngineException
public String getVersion() throws IOException, EngineException
IOException
EngineException
public String getOptionsInfo() throws EngineException, IOException
EngineException
IOException
public void setOptions(String options) throws EngineException, IOException
EngineException
IOException
public SymbolicState getSymbolicInitial(UppaalSystem system) throws EngineException, IOException
EngineException
IOException
public ConcreteState getConcreteInitial(UppaalSystem system) throws EngineException, IOException
EngineException
IOException
public ConcreteSuccessor getConcreteSuccessor(UppaalSystem system, ConcreteState state, SystemEdgeSelect[] edges, BigDecimal currentTime, BigDecimal delay) throws EngineException, IOException
EngineException
IOException
public GanttChart getGanttChart(UppaalSystem system, BigDecimal globalTime) throws EngineException, IOException
EngineException
IOException
public ArrayList<SymbolicTransition> getTransitions(UppaalSystem system, SymbolicState state) throws EngineException, IOException
EngineException
IOException
public UppaalSystem upload(Document document, ArrayList<Problem> problems) throws EngineException, IOException
EngineException
IOException
public LscProcess uploadLsc(Document document, ArrayList<Problem> problems) throws EngineException, IOException
EngineException
IOException
public UppaalSystem upload(Document document) throws EngineException, IOException
EngineException
IOException
public char query(UppaalSystem system, String query, QueryFeedback f) throws EngineException, IOException
EngineException
IOException
Copyright © 2012 Uppsala University and Aalborg University. All Rights Reserved.