📄 locationstub.java
字号:
import hp.chaiserver.*;
import java.io.*;
public final class LocationStub extends Worker implements IWorker {
private final String DISCOVERPROPS = new String("__DISCOVERPROPS");
public final String WORKER_VERSION = "ChaiServer.3.0.0.0";
private final static String locationRetrieve = new String("locationRetrieve");
// Helper methods for worker protected Object createObject() {
return (Object) new LocationImpl();
}
protected String getObjectClassName() {
return new String("LocationImpl");
}
protected boolean invokeMethod(Object obj, String method, String format)
throws Exception {
LocationImpl cs_obj = (LocationImpl) obj;
if(method.equalsIgnoreCase(DISCOVERPROPS)) {
webProtocol.sendToClient("HTTP/1.1 200 OK\r\n");
webProtocol.sendToClient("MIME-Version: 1.0\r\n");
webProtocol.sendToClient("Server: HP/ChaiServer 3.0\r\n");
webProtocol.sendToClient("Content-type: text/plain\r\n\n");
webProtocol.sendToClient("locationRetrieve");
return true;
}
if (method.equalsIgnoreCase(locationRetrieve))
cs_obj.locationRetrieve(format, args, reqEnv);
else
return false;
return true;
}
protected boolean isObjectInstance(Object obj) {
return (obj instanceof LocationImpl);
}
// Methods callable outside of worker
public String getVersion() {
return WORKER_VERSION;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -