4 * Class DomainMgr provides methods for work with the ORTE manager domain.
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
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.
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.
24 package org.ocera.orte;
25 import org.ocera.orte.types.DomainEvents;
26 import org.ocera.orte.types.DomainProp;
27 import org.ocera.orte.types.ORTEConstant;
30 public class DomainMgr extends Domain
34 * Default constructor. Creates default Manager domain.
35 * (domain = ORTE_DEFAULT_DOMAI, suspended thread = false)
40 handle = jORTEDomainDefaultMgrCreate(ORTEConstant.ORTE_DEFAULT_DOMAIN,
46 * User constructor. Creates manager domain with user parameters.
48 * @param domain properties
49 * @param domain events
50 * @param specifies whether threads of thiss manager should be started as well (False) or stay suspended (True)
52 /* TODO dodelat instance 'props', 'events' */
53 public DomainMgr(int domain,
58 super(); // set Default Domain Properties
60 this.props = DomainProp.defaultPropsCreate();
72 handle = jORTEDomainMgrCreate(domain,
74 events==null ? 0 : events.getHandle(),
84 * destroy - destroy manager object
85 * @return boolean: False if bad publication handle, True if succesful
90 if(jORTEDomainMgrDestroy(this.handle) && this.props.destroy()) return true;
91 System.out.println(":j!: ORTEDomainMgrDestroy() fault..");
96 /* ****************************************************************** *
100 * ****************************************************************** */
102 * jORTEDomainMgrCreate - creates default Manager
103 * @param handle of the domain
104 * @return handle of the Manager
106 private static native
107 long jORTEDomainDefaultMgrCreate(int dhandle,boolean suspend);
111 * jORTEDomainMgrCreate - creates the Manager
112 * @param handle of the domain
113 * @param handle of the domain properties
114 * @param handle of the domain events
115 * @return handle of the Manager
117 private static native
118 long jORTEDomainMgrCreate(int dhandle,
124 * jORTEDomainMgrDestroy - destroy manager object
125 * @param hadle of the domain
126 * @return if some error occures return False, otherwise True
128 private static native
129 boolean jORTEDomainMgrDestroy(long dhandle);