|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.uppaal.engine.EngineStub
public class EngineStub
A thin stub for the server protocol.
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.
| Field Summary | |
|---|---|
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 Summary | |
|---|---|
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. |
|
| Method Summary | |
|---|---|
void |
connect()
Connect to the server. |
void |
disconnect()
Disconnect from the server. |
int |
getConnectedPort()
Returns the port the engine is connected to. |
int |
getConnectionMode()
Returns the current connection mode. |
SystemState |
getInitial(UppaalSystem system)
Returns the initial state for the system. |
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. |
ArrayList<Transition> |
getTransitions(UppaalSystem system,
SystemState 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 guery on an instantiated UPPAAL model. |
char |
query(UppaalSystem system,
SystemState state,
String query,
QueryFeedback f)
Verify a guery on an instantiated UPPAAL model with custom initial state. |
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)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static int LOCAL
public static int SERVER
public static int BOTH
public static String DEFAULT_HOST
public static int DEFAULT_PORT
| Constructor Detail |
|---|
public EngineStub()
public EngineStub(int mode,
int port,
String host,
String path)
| Method Detail |
|---|
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
IOExceptionpublic 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 SystemState getInitial(UppaalSystem system)
throws EngineException,
IOException
EngineException
IOException
public ArrayList<Transition> getTransitions(UppaalSystem system,
SystemState 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
public char query(UppaalSystem system,
SystemState state,
String query,
QueryFeedback f)
throws EngineException,
IOException
EngineException
IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||