// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3)
// Source File Name: FBInstance.java
package fb.rt;
import fb.datatype.ANY;
import fb.datatype.WSTRING;
import fb.rt.net.Debug_CLT;
import fb.xml.XMLException;
import fb.xml.mgt.*;
import java.io.PrintStream;
// Referenced classes of package fb.rt:
// AbstractAdapter, FBRManagementException, Device, Resource,
// EventServer
public abstract class FBInstance extends AbstractAdapter {
public FBInstance() {
eccState = 1;
id = 1;
name = "";
initDebugClient(localDebugHost);
}
public void initDebugClient(String debugHost) {
if (debugHost != null)
remoteClient = new Debug_CLT(debugHost, "");
else
remoteClient = new Debug_CLT(localDebugHost, "");
}
public void connectOV(String ovName, ANY iv) throws FBRManagementException {
throw FBRManagementException.NO_SUCH_OBJECT;
}
public void connectOVNoException(String ovName, ANY iv) {
try {
connectOV(ovName, iv);
} catch (FBRManagementException fbrmanagementexception) {
}
}
public Device getDevice() {
return (this instanceof Device) ? (Device) this : getResource()
.getDevice();
}
public String getName() {
return name;
}
public void setName(String s) {
name = s;
}
public Resource getResource() {
return resource;
}
public int getEccState() {
return eccState;
}
public void initialize(String fbName, Resource r)
throws FBRManagementException {
name = fbName;
resource = r;
initIDs(fbName);
}
public void initIDs(String fbname) {
try {
ANY idin;
idin = ivNamed("ID");
if (!(idin instanceof WSTRING))
return;
if (((WSTRING) idin).value.length() == 0)
((WSTRING) idin).value = fbname;
} catch (FBRManagementException fbrmanagementexception) {
}
return;
}
public void restart() {
}
public void serviceEvent(EventServer eventserver) {
System.out.println((new StringBuilder("=>")).append(
eventserver.getClass().getName()).toString());
}
public String toString() {
return name;
}
public String getFBType() {
return FBtype;
}
public void setType(String type) {
if (FBtype != null)
FBtype = (new StringBuilder(String.valueOf(type))).append(".")
.append(FBtype).toString();
else
FBtype = type;
}
public void updateEvent(String s) {
try {
FBMRequest text = new FBMRequest(String.valueOf(id++), "DEBUG",
new FBMEvent(s, FBtype, "true"));
remoteClient.setXML(text.toXMLString().toString());
remoteClient.setUpConnection();
remoteClient.writeOut();
remoteClient.tearDownConnection();
} catch (Exception ex) {
}
}
public void updateData(String s, String value) {
try {
FBMRequest text = new FBMRequest(String.valueOf(id++), "DEBUG",
new FBMData(s, FBtype, value));
remoteClient.setXML(text.toXMLString().toString());
remoteClient.setUpConnection();
remoteClient.writeOut();
remoteClient.tearDownConnection();
} catch (Exception ex) {
}
}
public void updateECC() {
try {
FBMRequest text = new FBMRequest(String.valueOf(id++), "DEBUG",
new FBMECC(name, FBtype, String.valueOf(eccState)));
remoteClient.setXML(text.toXMLString().toString());
remoteClient.setUpConnection();
remoteClient.writeOut();
remoteClient.tearDownConnection();
} catch (Exception ex) {
}
}
protected int eccState;
protected static int id;
protected Resource resource;
protected String name;
protected String FBtype;
protected Debug_CLT remoteClient;
protected static final String DEBUG = "DEBUG";
public static String localDebugHost = "localhost:61502";
}