Class ThriftUtils


  • public final class ThriftUtils
    extends Object
    ThriftUtils helpers are working with dynamic methods via Camel and Java reflection utilities
    • Method Detail

      • extractServiceName

        public static String extractServiceName​(String service)
      • extractServicePackage

        public static String extractServicePackage​(String service)
      • 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)
      • 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)
      • findMethodReturnType

        public 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 type