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.types;
27 public class DomainProp {
29 /* load native library 'libjorte.so' */
31 System.loadLibrary("jorte");
35 /* handler to C struct with default domain properties */
36 private long handle = 0;
37 private String mgrs = null;
39 public long getHandle() {
44 * setProps - sets DomainProp
46 public void setProps(String[] mgrs) {
48 for (String item : mgrs) {
49 this.mgrs += item + ":";
51 this.mgrs = this.mgrs.substring(0, this.mgrs.length()-1);
53 if(!jORTEDomainPropSet(this.handle,this.mgrs))
54 System.out.println(":j: DomainProp not set !!!");
58 * defaultPropsCreate - create DomainProp with handle to default
61 * @return an object with handle to default domain properties
64 DomainProp defaultPropsCreate() {
65 DomainProp prop = new DomainProp();
66 long handle = jORTEDomainPropDefaultGet();
71 public boolean destroy() {
72 System.out.println(":j: DomainProp destroy called..");
74 if(!jORTEDomainPropDestroy(this.handle,this.mgrs)) {
75 System.out.println(":j: DomainProp destroy fault!");
79 System.out.println(":j: DomainProp destroy successful..");
85 /* ****************************************************************** *
89 * ****************************************************************** */
93 * jPropDefaultGet - returns handler to default properties of a domain,
94 * if occures some error return NULL.
96 * @return handler to default properties of a domain, NULL if error
99 long jORTEDomainPropDefaultGet();
102 boolean jORTEDomainPropSet(long prophandle, String mgrs);
105 boolean jORTEDomainPropDestroy(long prophandle, String mgrs);