... | ... | @@ -20,7 +20,7 @@ Let's take an example with two applications registered: |
|
|
</application>
|
|
|
<application name="App2">
|
|
|
<start executable="/users/ics/app2"/>
|
|
|
<stop executable="kill" args="-2 $PID"/>
|
|
|
<stop executable="kill" args="-2"/>
|
|
|
<error executable="bash" args="/users/ics/error.sh -debug"/>
|
|
|
</application>
|
|
|
<applications>
|
... | ... | @@ -110,7 +110,7 @@ Usually to benefit from the Cameo services inside an application, the *This* obj |
|
|
int main(int argc, char *argv[]) {
|
|
|
|
|
|
// Initialize This.
|
|
|
cameo::application::This::init(argc, argv);
|
|
|
cameo::This::init(argc, argv);
|
|
|
```
|
|
|
|
|
|
In Java:
|
... | ... | @@ -138,14 +138,14 @@ Once *This* is initialized it can be used for example to get a reference to the |
|
|
```
|
|
|
$ /users/ics/app1 "{\"name\":\"App1\", \"server\":\"tcp://localhost:10000\"}"
|
|
|
```
|
|
|
Then if the informations are correct, *This* will initialize and the application will become **attached** to the Cameo server referenced by the endpoint in the *server* member.
|
|
|
Then if the passed arguments are correct, *This* will initialize and the application will become **attached** to the Cameo server referenced by the endpoint in the *server* member.
|
|
|
|
|
|
## *This* initialized with explicit arguments
|
|
|
|
|
|
It is not mandatory to initialize *This* with the program arguments. It is possible to pass an explicit endpoint.
|
|
|
In C++:
|
|
|
```cpp
|
|
|
cameo::application::This::init("App1", "tcp://localhost:10000");
|
|
|
cameo::This::init("App1", "tcp://localhost:10000");
|
|
|
```
|
|
|
In Java:
|
|
|
```java
|
... | ... | @@ -159,7 +159,7 @@ In that case, the application shall **not** be **registered**. |
|
|
|
|
|
## *This* not initialized
|
|
|
|
|
|
If you have a black box application i.e. that you cannot compile or modify, then you cannot initialize *This* inside but you still can **register** the application in the configuration file. However it is recommended in that special case to set *info_arg* to *no*. Otherwise the additional argument may not be supported by the app when it parses the arguments.
|
|
|
If you have a black box application i.e. that you cannot compile or modify, then you cannot initialize *This* inside but you can still **register** the application in the configuration file. However it is recommended in that special case to set *info_arg* to *no*. Otherwise the additional argument may not be supported by the app when it parses the arguments.
|
|
|
|
|
|
## Registered vs unregistered
|
|
|
|
... | ... | @@ -177,10 +177,10 @@ If you want to register a script e.g. a Bash script or a Python script, it is hi |
|
|
<config host="gamma-machine">
|
|
|
<applications>
|
|
|
<application name="Script1">
|
|
|
<start executable="bash" args="/users/ics/app1.sh"/>
|
|
|
<start executable="/usr/bin/bash" args="/users/ics/app1.sh"/>
|
|
|
</application>
|
|
|
<application name="Script2">
|
|
|
<start executable="python" args="-u /users/ics/app2.py"/>
|
|
|
<start executable="/usr/bin/python3" args="-u /users/ics/app2.py"/>
|
|
|
</application>
|
|
|
<applications>
|
|
|
</config>
|
... | ... | |