Class AbstractApiProducer<E extends Enum<E> & ApiName,​T>

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected Object doInvokeMethod​(ApiMethod method, Map<String,​Object> properties)
      Invoke the API method.
      protected ApiMethod findMethod​(org.apache.camel.Exchange exchange, Map<String,​Object> properties)  
      void interceptProperties​(Map<String,​Object> properties)
      Intercept method invocation arguments used to find and invoke API method.
      void interceptResult​(Object methodResult, org.apache.camel.Exchange resultExchange)
      Do additional result exchange processing, for example, adding custom headers.
      boolean process​(org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback callback)  
      Object splitResult​(Object result)
      Split a complex result into result elements.
      • Methods inherited from class org.apache.camel.support.service.BaseService

        build, doBuild, doFail, doInit, doLifecycleChange, doResume, doShutdown, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
      • Methods inherited from interface org.apache.camel.EndpointAware

        getEndpoint
      • Methods inherited from interface org.apache.camel.IsSingleton

        isSingleton
      • Methods inherited from interface org.apache.camel.Service

        build, close, init, start, stop
      • Methods inherited from interface org.apache.camel.ShutdownableService

        shutdown
      • Methods inherited from interface org.apache.camel.StatefulService

        getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspending
      • Methods inherited from interface org.apache.camel.SuspendableService

        isSuspended, resume, suspend
    • Method Detail

      • process

        public boolean process​(org.apache.camel.Exchange exchange,
                               org.apache.camel.AsyncCallback callback)
        Specified by:
        process in interface org.apache.camel.AsyncProcessor
      • interceptProperties

        public void interceptProperties​(Map<String,​Object> properties)
        Description copied from interface: PropertiesInterceptor
        Intercept method invocation arguments used to find and invoke API method. Can be overridden to add custom/hidden method arguments.
        Specified by:
        interceptProperties in interface PropertiesInterceptor
        Parameters:
        properties - method invocation arguments.
      • doInvokeMethod

        protected Object doInvokeMethod​(ApiMethod method,
                                        Map<String,​Object> properties)
                                 throws org.apache.camel.RuntimeCamelException
        Invoke the API method. Derived classes can override, but MUST call super.doInvokeMethod().
        Parameters:
        method - API method to invoke.
        properties - method arguments from endpoint properties and exchange In headers.
        Returns:
        API method invocation result.
        Throws:
        org.apache.camel.RuntimeCamelException - on error. Exceptions thrown by API method are wrapped.
      • splitResult

        public final Object splitResult​(Object result)
        Description copied from interface: ResultInterceptor
        Split a complex result into result elements.
        Specified by:
        splitResult in interface ResultInterceptor
        Parameters:
        result - API method invocation result
        Returns:
        either the same result if it cannot be split, an array or collection object with split results
      • interceptResult

        public void interceptResult​(Object methodResult,
                                    org.apache.camel.Exchange resultExchange)
        Description copied from interface: ResultInterceptor
        Do additional result exchange processing, for example, adding custom headers.
        Specified by:
        interceptResult in interface ResultInterceptor
        Parameters:
        methodResult - result of API method invocation.
        resultExchange - result as a Camel exchange, may be a split result from Arrays or Collections.
      • findMethod

        protected ApiMethod findMethod​(org.apache.camel.Exchange exchange,
                                       Map<String,​Object> properties)