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 Object
constructAsyncClientInstance
(String packageName, String serviceName, org.apache.thrift.transport.TNonblockingTransport transport, ThriftExchangeProtocol exchangeProtocol, org.apache.camel.CamelContext context) static Object
constructClientInstance
(String packageName, String serviceName, org.apache.thrift.transport.TTransport transport, ThriftExchangeProtocol exchangeProtocol, ThriftNegotiationType negotiationType, ThriftCompressionType compressionType, org.apache.camel.CamelContext context) static Object
constructServerProcessor
(String packageName, String serviceName, Object serverImplementation, boolean isSyncProcessor, org.apache.camel.CamelContext context) static String
extractServiceName
(String service) static String
extractServicePackage
(String service) static Class
findMethodReturnType
(Class clazz, String name) The function find onComplete method inside interface implementation and get fist parameter (but not Object.class) as return typestatic Class
getServerInterface
(String packageName, String serviceName, boolean isSyncInterface, org.apache.camel.CamelContext context) static void
invokeAsyncMethod
(Object asyncClient, String invokeMethod, Object request, AsyncClientMethodCallback methodCallback) static Object
invokeSyncMethod
(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
-