]> rtime.felk.cvut.cz Git - orte/eurobot.git/blob - orte/java/src/org/ocera/orte/types/DomainEvents.java
a4295cc780e245ce8bc0ac93b997572b3c17545a
[orte/eurobot.git] / orte / java / src / org / ocera / orte / types / DomainEvents.java
1 /* DomainEvents.java */
2
3 /**
4  * Class AppInfo. 
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.types;
25
26
27 public abstract class DomainEvents {
28   /* handler to C struct with default domain properties  */
29   private long handle = 0;
30
31
32  /* load native library 'libjorte.so' */
33   static {
34      System.loadLibrary("jorte");
35   }
36
37   public DomainEvents()
38   {
39         init();
40         System.out.println(":j: events created & initialized..");
41   }
42
43
44   /**
45    * Initializes DomainEvents and return their handle
46    * @return handle initialized DomainEvents
47    */
48   public void init()
49   {
50     this.handle = jORTEDomainInitEvents();
51         return;
52   }
53
54   
55   public long getHandle()
56   {
57         return this.handle;
58   }
59   
60   public abstract void onRegFail();
61   public abstract void onMgrNew(AppInfo appInfo);
62   public abstract void onMgrDelete(AppInfo appInfo);
63   public abstract void onAppRemoteNew(AppInfo appInfo);
64   public abstract void onAppDelete(AppInfo appInfo);
65   public abstract void onPubRemoteNew(AppInfo appInfo, PubInfo pubInfo);
66   public abstract void onPubRemoteChanged(AppInfo appInfo, PubInfo pubInfo);
67   public abstract void onPubDelete(AppInfo appInfo, PubInfo pubInfo);
68   public abstract void onSubRemoteNew(AppInfo appInfo, SubInfo subInfo);
69   public abstract void onSubRemoteChanged(AppInfo appInfo, SubInfo subInfo);
70   public abstract void onSubDelete(AppInfo appInfo, SubInfo subInfo);
71   
72  /* ****************************************************************** *
73   *                                                                    *
74   *                         native methods                             *
75   *                                                                    *
76   * ****************************************************************** */
77
78
79  /**
80   * jPropDefaultGet - returns handler to default properties of a domain,
81   * if occures some error return NULL.
82   *
83   * @return handler to default properties of a domain, NULL if error
84   */
85   private static native
86   long jORTEDomainInitEvents();
87
88
89
90 }