filestub.java
来自「JdbcProxy 可以理解为 JDBC 代理」· Java 代码 · 共 39 行
JAVA
39 行
/*
* Created on 2007-12-27
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/
package nl.griffelservices.proxy.stub;
/**
* @author xufangbj@cn.ibm.com
*
* This stub gets the responses from a File in local.
* Window - Preferences - Java - Code Style - Code Templates
*/
public class FileStub extends FileClient implements Stub{
/** the request encoder */
private static final RequestEncoder encoder = new RequestEncoder();
/** the response decoder */
private static final ResponseDecoder decoder = new ResponseDecoder();
/**
* Constructs a HttpStub object.
*
* @param host the hostname of the HTTP server that provides the stub information
* @param port the port of the HTTP server that provides the stub information
* @param timeout the timeout that will be used for HTTP requests to the HTTP server that provides the stub information
*/
public FileStub(String filename)
{
super(filename);
}
public Response invoke(Request request) throws Exception
{
return decoder.decode(invoke(encoder.encode(request)));
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?