Fail safe import fixes made by Antti
[simantics/platform.git] / bundles / org.simantics.db.impl / src / org / simantics / db / impl / ForEachObjectContextProcedure.java
1 package org.simantics.db.impl;
2
3 import org.simantics.db.AsyncReadGraph;
4 import org.simantics.db.RelationInfo;
5 import org.simantics.db.Resource;
6 import org.simantics.db.impl.query.QueryProcessor;
7 import org.simantics.db.procedure.AsyncContextMultiProcedure;
8
9 public final class ForEachObjectContextProcedure<C> implements AsyncContextMultiProcedure<C, Resource> {
10
11         public final int predicateKey;
12         public final int[] clusterKey;
13         public final int[] predicateReference;
14         public final RelationInfo info;
15         public final QueryProcessor processor;
16         public final ClusterI.CompleteTypeEnum completeType;
17         private final AsyncContextMultiProcedure<C, Resource> user;
18         
19         public ForEachObjectContextProcedure(int predicateKey, RelationInfo info, QueryProcessor processor, AsyncContextMultiProcedure<C, Resource> user) {
20                 this.predicateKey = predicateKey;
21                 this.completeType = ClusterTraitsBase.getCompleteTypeFromResourceKey(predicateKey); 
22                 this.info = info;
23                 this.user = user;
24                 this.processor = processor;
25                 this.clusterKey = new int[32*8];
26                 this.predicateReference = new int[32*8];
27         }
28         
29         @Override
30         public void execute(AsyncReadGraph graph, C context, Resource result) {
31                 user.execute(graph, context, result);
32         }
33
34         @Override
35         public void finished(AsyncReadGraph graph, C context) {
36                 user.finished(graph, context);
37         }
38
39         @Override
40         public void exception(AsyncReadGraph graph, Throwable throwable) {
41                 user.exception(graph, throwable);
42         }
43         
44 }