Skip to content

Commit

Permalink
fixed codeblocks
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamZsofi committed Mar 15, 2018
1 parent c893acd commit e76d7b0
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion docs/technical_documentation/dds/dds_java_lib.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,24 @@ For a simple implementation look at the project in the `standalone_project` fold
* For both Compiling and Running

* Run `release.com` from inside your OpenSplice installation folder

``` bash
. ./path/to/release.com
```

* Add to classpath: `$OSPL_HOME/jar/dcpssaj5.jar`, `lib/hu.bme.mit.gamma.ddslib.jar`

* Both Subscription and Publishing
* Import `hu.bme.mit.gamma.ddslib.model.*`, `hu.bme.mit.gamma.ddslib.opensplice.*`, `hu.bme.mit.gamma.ddslib.threads.*`

* Initialize the Service Environment:

``` java
DDSLib.init();
```

* Create a Topic<sup>1</sup>:

``` java
Topics exampleTopic = new Topics("exPart", "exTopic");
```
Expand All @@ -61,16 +66,22 @@ For a simple implementation look at the project in the `standalone_project` fold
}
}
```

* Instantiate the above mentioned Listener class:

``` java
MyListener myListener = new MyListener();
```

* Register the Listener instance:

``` java
exampleTopic.addSubscriptionListener(myListener);
```
* Don't forget to unregister & close
``` java

``` java
exampleTopic.removeSubscriptionListener(myListener);
exampleTopic.closeTopic();
```
Expand All @@ -88,7 +99,9 @@ For a simple implementation look at the project in the `standalone_project` fold
e.printStackTrace();
}
```

* close topic

``` java
exampleTopic.closeTopic();
```
Expand Down

0 comments on commit e76d7b0

Please sign in to comment.