]> rtime.felk.cvut.cz Git - orte.git/blob - orte/java/src/org/ocera/orte/Domain.java
Add shell.nix
[orte.git] / orte / java / src / org / ocera / orte / Domain.java
1 /* Domain.java */
2
3 /**
4   * Class Domain provides methods for work with the ORTE domain.
5   *
6   * @author Lukas Pokorny (lukas_pokorny@centrum.cz)
7   * @author CTU FEE Prague - Department of Control Engineering (dce.felk.cvut.cz)
8   * @author Project ORTE - OCERA Real Time Ethernet (www.ocera.org)
9   * @author dedication to Kj
10   * @version 0.1
11   *
12   * This program is free software; you can redistribute it and/or modify
13   * it under the terms of the GNU General Public License as published by
14   * the Free Software Foundation; either version 2 of the License, or
15   * (at your option) any later version.
16   *
17   * This program is distributed in the hope that it will be useful,
18   * but WITHOUT ANY WARRANTY; without even the implied warranty of
19   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20   * GNU General Public License for more details.
21   *
22   */
23
24 package org.ocera.orte;
25 import  org.ocera.orte.types.*;
26
27
28 public abstract class Domain {
29
30    /** load native library 'libjorte.so' */
31    static {
32       System.loadLibrary("jorte");
33    }
34
35    /* domain fields */
36    protected long                       handle;
37    protected long                       domainEventsContextHandle = 0;
38    protected DomainProp                 props;
39    protected DomainEvents               events;
40
41
42    /* constructor */
43    public Domain()
44    {
45      // initialization of ORTE layer
46      JOrte.init();
47      //System.out.println(":j: instance of 'Domain' created ..");
48    }
49
50
51   /**
52    * Get handle of the Domain.
53    * @return Handle of the Domain.
54    */
55    public long getHandle()
56    {
57      return this.handle;
58    }
59
60    /**
61     * Destroy domain.
62     * @return Handle of the Domain.
63     */
64     public abstract boolean destroy();
65    
66    
67   /* ****************************************************************** *
68    *                                                                    *
69    *                         native methods                             *
70    *                                                                    *
71    * ****************************************************************** */
72
73   /**
74    * jORTEDomainStart -
75    *
76    * @param dhandle handler to domain
77    * @param
78    * @param
79    * @return
80    */
81    private static native
82    void jORTEDomainStart(long dhandle,
83                          boolean recvMetatrafficThread,
84                          boolean recvUserDataThread,
85                              boolean sendThread);
86
87 }