graph.claim(relation, b.SubrelationOf, b.IsRelatedTo);
graph.claim(relation, b.InverseOf, relation);
- graph.forObjectSet(graph.getRootLibrary(), relation, new AsyncSetListener<Resource>() {
-
- @Override
- public void add(AsyncReadGraph graph, Resource result) {
- synchronized(this) {
- adds++;
- }
- }
-
- @Override
- public void remove(AsyncReadGraph graph, Resource result) {
- synchronized(this) {
- removes++;
- }
- }
-
- @Override
- public void exception(AsyncReadGraph graph, Throwable t) {
- exception = t;
- }
-
- @Override
- public boolean isDisposed() {
- return false;
- }
-
- });
+ session.syncRequest(new TestAsyncReadRequest() {
+
+ @Override
+ public void run(AsyncReadGraph graph) throws Throwable {
+
+ graph.forObjectSet(graph.getRootLibrary(), relation, new AsyncSetListener<Resource>() {
+
+ @Override
+ public void add(AsyncReadGraph graph, Resource result) {
+ synchronized(this) {
+ adds++;
+ }
+ }
+
+ @Override
+ public void remove(AsyncReadGraph graph, Resource result) {
+ synchronized(this) {
+ removes++;
+ }
+ }
+
+ @Override
+ public void exception(AsyncReadGraph graph, Throwable t) {
+ exception = t;
+ }
+
+ @Override
+ public boolean isDisposed() {
+ return false;
+ }
+
+ });
+
+ }
+
+ });
+
}
});