handler.mustache 1.15 KB
Newer Older
1

2
aspect RagConnectHandler {
René Schöne's avatar
René Schöne committed
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{{#Handlers}}
  {{#InUse}}
  private {{ClassName}} {{rootNodeName}}.{{FieldName}} = {{{Construction}}};
  {{#rootTypeComponents}}
  {{#first}}inh {{ClassName}} ASTNode.{{AttributeName}}();{{/first}}
  eq {{rootNodeName}}.get{{name}}().{{AttributeName}}() = {{FieldName}};
  {{/rootTypeComponents}}
  syn {{ClassName}} {{rootNodeName}}.{{AttributeName}}() = {{FieldName}};
  {{/InUse}}
{{/Handlers}}
  public void {{rootNodeName}}.{{closeMethod}}() {
    {{#Handlers}}
    {{#InUse}}{{FieldName}}.close();{{/InUse}}
    {{/Handlers}}
  }
18
  class ConnectToken {
19
20
    //static java.util.concurrent.atomic.AtomicLong counter = new java.util.concurrent.atomic.AtomicLong(0);
    final String id;
21
    final java.net.URI uri;
22

23
    public ConnectToken(java.net.URI uri) {
24
      this.id = java.util.UUID.randomUUID().toString(); // counter.incrementAndGet();
25
26
27
      this.uri = uri;
    }

28
29
30
31
    public ConnectToken(java.net.URI uri, String uuid) {
        this.id = uuid; // counter.incrementAndGet();
        this.uri = uri;
    }
32
33
  }
  static java.util.Map<ASTNode, java.util.Map<java.net.URI, ConnectToken>> ASTNode.connectTokens = new java.util.HashMap<>();
34
}