本文整理汇总了Java中org.apache.xmlrpc.XmlRpcHandler类的典型用法代码示例。如果您正苦于以下问题:Java XmlRpcHandler类的具体用法?Java XmlRpcHandler怎么用?Java XmlRpcHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XmlRpcHandler类属于org.apache.xmlrpc包,在下文中一共展示了XmlRpcHandler类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: PyUnitServer
import org.apache.xmlrpc.XmlRpcHandler; //导入依赖的package包/类
/**
* As we need to be able to relaunch, we store the configuration and launch here (although the relaunch won't be
* actually done in this class, this is the place to get information on it).
*
* @param config used to get the configuration of the launch.
* @param launch the actual launch
* @throws IOException
*/
public PyUnitServer(PythonRunnerConfig config, ILaunch launch) throws IOException {
initializeDispatches();
port = SocketUtil.findUnusedLocalPorts(1)[0];
this.webServer = new WebServer(port);
XmlRpcServer serverToHandleRawInput = this.webServer.getXmlRpcServer();
serverToHandleRawInput.setHandlerMapping(new XmlRpcHandlerMapping() {
@Override
public XmlRpcHandler getHandler(String handlerName) throws XmlRpcNoSuchHandlerException, XmlRpcException {
return handler;
}
});
this.webServer.start();
ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
launchManager.addLaunchListener(this.launchListener);
this.launch = launch;
this.configuration = config.getLaunchConfiguration();
}
示例2: getHandler
import org.apache.xmlrpc.XmlRpcHandler; //导入依赖的package包/类
@Override
public XmlRpcHandler getHandler(String method) throws XmlRpcNoSuchHandlerException, XmlRpcException {
ModelService model = null;
try {
model = dispatcher.getDispatchContext().getModelService(method);
} catch (GenericServiceException e) {
Debug.logWarning(e, module);
}
if (model == null) {
throw new XmlRpcNoSuchHandlerException("No such service [" + method + "]");
}
return this;
}
示例3: startServer
import org.apache.xmlrpc.XmlRpcHandler; //导入依赖的package包/类
private Process startServer(int client_port, int port, boolean python) throws IOException {
File f = new File(TestDependent.TEST_PYDEV_PLUGIN_LOC + "pysrc/pydevconsole.py");
String[] cmdLine;
if (python) {
cmdLine = new String[] { TestDependent.PYTHON_EXE, "-u", FileUtils.getFileAbsolutePath(f), "" + port,
"" + client_port };
} else {
cmdLine = new String[] { TestDependent.JAVA_LOCATION, "-classpath", TestDependent.JYTHON_JAR_LOCATION,
"org.python.util.jython", FileUtils.getFileAbsolutePath(f), "" + port, "" + client_port };
}
Process process = Runtime.getRuntime().exec(cmdLine);
err = new ThreadStreamReader(process.getErrorStream());
out = new ThreadStreamReader(process.getInputStream());
err.start();
out.start();
this.webServer = new WebServer(client_port);
XmlRpcServer serverToHandleRawInput = this.webServer.getXmlRpcServer();
serverToHandleRawInput.setHandlerMapping(new XmlRpcHandlerMapping() {
@Override
public XmlRpcHandler getHandler(String handlerName) throws XmlRpcNoSuchHandlerException, XmlRpcException {
return new XmlRpcHandler() {
@Override
public Object execute(XmlRpcRequest request) throws XmlRpcException {
return "input_request";
}
};
}
});
this.webServer.start();
return process;
}
示例4: PydevConsoleCommunication
import org.apache.xmlrpc.XmlRpcHandler; //导入依赖的package包/类
/**
* Initializes the xml-rpc communication.
*
* @param port the port where the communication should happen.
* @param process this is the process that was spawned (server for the XML-RPC)
*
* @throws MalformedURLException
*/
public PydevConsoleCommunication(int port, final Process process, int clientPort, String[] commandArray,
String[] envp, String encoding)
throws Exception {
this.commandArray = commandArray;
this.envp = envp;
finishedExecution = new ConditionEvent(new ICallback0<Boolean>() {
@Override
public Boolean call() {
try {
process.exitValue();
return true; // already exited
} catch (Exception e) {
return false;
}
}
}, 200);
//start the server that'll handle input requests
this.webServer = new WebServer(clientPort);
XmlRpcServer serverToHandleRawInput = this.webServer.getXmlRpcServer();
serverToHandleRawInput.setHandlerMapping(new XmlRpcHandlerMapping() {
@Override
public XmlRpcHandler getHandler(String handlerName) throws XmlRpcNoSuchHandlerException, XmlRpcException {
return PydevConsoleCommunication.this;
}
});
this.webServer.start();
this.stdStreamsThread = new StdStreamsThread(process, encoding);
this.stdStreamsThread.start();
IXmlRpcClient client = new ScriptXmlRpcClient(process);
client.setPort(port);
this.client = client;
}
示例5: getHandler
import org.apache.xmlrpc.XmlRpcHandler; //导入依赖的package包/类
public XmlRpcHandler getHandler(String arg0) throws XmlRpcNoSuchHandlerException, XmlRpcException {
return XmlRpcDHTServer.this.handler;
}