Class ThriftUtils
- java.lang.Object
-
- org.apache.camel.component.thrift.ThriftUtils
-
public final class ThriftUtils extends Object
ThriftUtils helpers are working with dynamic methods via Camel and Java reflection utilities
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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 Detail
-
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
public static Object invokeSyncMethod(Object syncClient, String invokeMethod, Object request)
-
invokeAsyncMethod
public static void invokeAsyncMethod(Object asyncClient, String invokeMethod, Object request, AsyncClientMethodCallback methodCallback)
-
getServerInterface
public static Class getServerInterface(String packageName, String serviceName, boolean isSyncInterface, org.apache.camel.CamelContext context)
-
constructServerProcessor
public static Object constructServerProcessor(String packageName, String serviceName, Object serverImplementation, boolean isSyncProcessor, org.apache.camel.CamelContext context)
-
-