Class ThriftUtils
java.lang.Object
org.apache.camel.component.thrift.ThriftUtils
ThriftUtils helpers are working with dynamic methods via Camel and Java reflection utilities
-
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectconstructAsyncClientInstance(String packageName, String serviceName, org.apache.thrift.transport.TNonblockingTransport transport, ThriftExchangeProtocol exchangeProtocol, org.apache.camel.CamelContext context) static ObjectconstructClientInstance(String packageName, String serviceName, org.apache.thrift.transport.TTransport transport, ThriftExchangeProtocol exchangeProtocol, ThriftNegotiationType negotiationType, ThriftCompressionType compressionType, org.apache.camel.CamelContext context) static ObjectconstructServerProcessor(String packageName, String serviceName, Object serverImplementation, boolean isSyncProcessor, org.apache.camel.CamelContext context) static StringextractServiceName(String service) static StringextractServicePackage(String service) static ClassfindMethodReturnType(Class clazz, String name) The function find onComplete method inside interface implementation and get fist parameter (but not Object.class) as return typestatic ClassgetServerInterface(String packageName, String serviceName, boolean isSyncInterface, org.apache.camel.CamelContext context) static voidinvokeAsyncMethod(Object asyncClient, String invokeMethod, Object request, AsyncClientMethodCallback methodCallback) static ObjectinvokeSyncMethod(Object syncClient, String invokeMethod, Object request)
-
Method Details
-
extractServiceName
-
extractServicePackage
-
constructClientInstance
public static Object constructClientInstance(String packageName, String serviceName, org.apache.thrift.transport.TTransport transport, ThriftExchangeProtocol exchangeProtocol, ThriftNegotiationType negotiationType, ThriftCompressionType compressionType, org.apache.camel.CamelContext context) throws org.apache.thrift.transport.TTransportException - Throws:
org.apache.thrift.transport.TTransportException
-
constructAsyncClientInstance
public static Object constructAsyncClientInstance(String packageName, String serviceName, org.apache.thrift.transport.TNonblockingTransport transport, ThriftExchangeProtocol exchangeProtocol, org.apache.camel.CamelContext context) -
invokeSyncMethod
-
invokeAsyncMethod
public static void invokeAsyncMethod(Object asyncClient, String invokeMethod, Object request, AsyncClientMethodCallback methodCallback) -
getServerInterface
-
constructServerProcessor
-
findMethodReturnType
The function find onComplete method inside interface implementation and get fist parameter (but not Object.class) as return type
-