io.odysz.semantic.syn.ExessionAct Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of semantic.DA Show documentation
Show all versions of semantic.DA Show documentation
JDBC Data Access with Semantics Support
package io.odysz.semantic.syn;
import java.lang.reflect.Field;
import io.odysz.common.Utils;
/**
* Action such as restore, ready, exchange, ...
*
* @author [email protected]
*
*/
public class ExessionAct {
public static final int restore = -2;
public static final int unexpected = -1;
public static final int ready = 0;
public static final int init = 1;
public static final int exchange = 2;
public static final int close = 3;
/** sign up */
public static final int signup = 4;
/** setup domain request */
public static final int setupDom = 5;
public static final int mode_server = 0;
public static final int mode_client = 1;
public int state;
int mode;
public ExessionAct(int serv_client, int ini) {
mode = serv_client;
state = ini;
}
public void go(int stat) {
state = stat;
}
public static String nameOf(int s) {
Field[] fs = ExessionAct.class.getFields();
for (Field f : fs) {
try {
Class> t = f.getType();
if(t == int.class) {
if (f.getInt(null) == s)
return f.getName();
}
}catch (Exception ex) {
Utils.warn("ExessionAct#name(): Can't find name of %d.", s);
}
}
return "NA";
}
public void onclose() {
this.state = ready;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy