public abstract class OMCInterface
extends java.lang.Object
connect and until a call to
disconnect.
Note: Java's CORBA-API uses the java.util.logging framework.
If you use another logging framework (for example Logback) you should supress
logging from java.util.logging. It's not possible to control the JUC framework from another logging
framework. SLF4J has an
adapter
to route JUC logging into SLF4J. Note that this adapter has performance issues!
A typical workflow with implementations is:
OMCInterface client = new OMCClient();
client.connect();
//client is connected; start using it
client.sendExpression("model test end test;");
...
client.disconnect();
//client disconnected; stop using it
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
fallbackLocale |
static java.lang.String |
GET_ERRORS |
static java.lang.String |
localeEnvVariable |
protected org.slf4j.Logger |
log |
static int |
maxSleep |
static int |
maxTrys |
| Constructor and Description |
|---|
OMCInterface() |
OMCInterface(org.slf4j.Logger log) |
| Modifier and Type | Method and Description |
|---|---|
Result |
call(java.lang.String functionName,
java.lang.Object... args)
Calls the function `functionName` with the given arguments.
|
Result |
cd(java.nio.file.Path path) |
java.lang.String |
checkAllModelsRecursive(java.lang.String modelName)
Checks the model `modelName` with the scripting function checkModelsRecursive().
|
java.lang.String |
checkModel(java.lang.String modelName)
Checks the model `modelName` with the scripting function checkModel().
|
abstract void |
connect()
Connects this client to omc.
|
abstract void |
disconnect()
Disconnects this client from omc.
|
java.util.Optional<java.lang.String> |
getClassInformation(java.lang.String className)
Returns the class informations about `className`.
|
java.util.List<java.lang.String> |
getList(java.lang.String functionName,
java.lang.Object... args)
Calls the function `functionName` with the given arguments,
converting the result into a List of Strings.
|
Version |
getVersion() |
boolean |
is_(java.lang.String type,
java.lang.String className)
Tests wether the `className` is a `type`.
|
abstract Result |
sendExpression(java.lang.String expression)
Sends the given expression to omc & returning the result from omc.
|
public static java.lang.String GET_ERRORS
public static java.lang.String fallbackLocale
public static java.lang.String localeEnvVariable
public static final int maxTrys
public static final int maxSleep
protected final org.slf4j.Logger log
public OMCInterface()
public OMCInterface(org.slf4j.Logger log)
public abstract Result sendExpression(java.lang.String expression)
expression - a modelica-expressionpublic abstract void connect()
throws java.io.IOException
java.io.IOException - if an io-error occursdisconnect()public abstract void disconnect()
throws java.io.IOException
java.io.IOException - if an io-error occursconnect()public Result call(java.lang.String functionName, java.lang.Object... args)
public boolean is_(java.lang.String type,
java.lang.String className)
public java.util.List<java.lang.String> getList(java.lang.String functionName,
java.lang.Object... args)
Note: If an error occurs the result is an empty list.
public java.lang.String checkModel(java.lang.String modelName)
public java.lang.String checkAllModelsRecursive(java.lang.String modelName)
public java.util.Optional<java.lang.String> getClassInformation(java.lang.String className)
Note: If an error occurs the result is empty.
public Result cd(java.nio.file.Path path)
public Version getVersion()