use of org.apache.dubbo.rpc.protocol.thrift.ext.MultiServiceProcessor in project dubbo by alibaba.
the class AbstractTest method getProcessor.
protected TProcessor getProcessor() {
MultiServiceProcessor result = new MultiServiceProcessor();
result.addProcessor(org.apache.dubbo.rpc.gen.dubbo.Demo.class, new $__DemoStub.Processor(getServiceImpl()));
return result;
}
use of org.apache.dubbo.rpc.protocol.thrift.ext.MultiServiceProcessor in project dubbo by alibaba.
the class ServiceMethodNotFoundTest method init.
protected void init() throws Exception {
TServerTransport serverTransport = new TServerSocket(PORT);
DubboDemoImpl impl = new DubboDemoImpl();
$__DemoStub.Processor processor = new $__DemoStub.Processor(impl);
// for test
Field field = processor.getClass().getSuperclass().getDeclaredField("processMap");
ReflectUtils.makeAccessible(field);
Object obj = field.get(processor);
if (obj instanceof Map) {
((Map) obj).remove("echoString");
}
// ~
TBinaryProtocol.Factory bFactory = new TBinaryProtocol.Factory();
MultiServiceProcessor wrapper = new MultiServiceProcessor();
wrapper.addProcessor(Demo.class, processor);
server = new TThreadPoolServer(new TThreadPoolServer.Args(serverTransport).inputProtocolFactory(bFactory).outputProtocolFactory(bFactory).inputTransportFactory(getTransportFactory()).outputTransportFactory(getTransportFactory()).processor(wrapper));
Thread startTread = new Thread() {
@Override
public void run() {
server.serve();
}
};
startTread.start();
while (!server.isServing()) {
Thread.sleep(100);
}
}
Aggregations