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,
61 this.handle = jORTEDomainMgrCreate(domain,
62 props==null ? 0 : this.props.getHandle(),
63 events==null ? 0 : this.events.getHandle(),
69 * destroy - destroy manager object
70 * @return boolean: False if bad publication handle, True if succesful
76 if(jORTEDomainMgrDestroy(this.handle)
77 && (this.props == null || this.props.destroy())
78 && (this.events == null || this.events.destroy())) return true;
79 System.out.println(":j!: ORTEDomainMgrDestroy() fault..");
84 /* ****************************************************************** *
88 * ****************************************************************** */
90 * jORTEDomainMgrCreate - creates default Manager
91 * @param handle of the domain
92 * @return handle of the Manager
95 long jORTEDomainDefaultMgrCreate(int dhandle,boolean suspend);
99 * jORTEDomainMgrCreate - creates the Manager
100 * @param handle of the domain
101 * @param handle of the domain properties
102 * @param handle of the domain events
103 * @return handle of the Manager
106 long jORTEDomainMgrCreate(int dhandle,
113 * jORTEDomainMgrDestroy - destroy manager object
114 * @param hadle of the domain
115 * @return if some error occures return False, otherwise True
118 boolean jORTEDomainMgrDestroy(long dhandle);