Class RestServiceWrapperInvocationHandler

  • All Implemented Interfaces:
    java.lang.reflect.InvocationHandler

    public class RestServiceWrapperInvocationHandler
    extends java.lang.Object
    implements java.lang.reflect.InvocationHandler
    Create a new web service wrapper invocation handler. Creates an 'rest service invocation agent' for each method invocation. Lets this invocation agent call the web service by using the mapping data to determine details about the service call. The invocation agent returns the result and terminates itself after the call. todo: - path parameter support - fix import problem: expressions are evaluated in other agent so that imports are missing
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected IInternalAccess agent
      The agent.
      static java.lang.String[] defaultimports  
      protected java.lang.Class<?> iface
      The annotated service interface.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object invoke​(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)
      Called when a wrapper method is invoked.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • defaultimports

        public static java.lang.String[] defaultimports
      • iface

        protected java.lang.Class<?> iface
        The annotated service interface.
    • Constructor Detail

      • RestServiceWrapperInvocationHandler

        public RestServiceWrapperInvocationHandler​(IInternalAccess agent,
                                                   java.lang.Class<?> iface)
        Create a new service wrapper invocation handler.
        Parameters:
        agent - The internal access of the agent.
    • Method Detail

      • invoke

        public java.lang.Object invoke​(java.lang.Object proxy,
                                       java.lang.reflect.Method method,
                                       java.lang.Object[] args)
                                throws java.lang.Throwable
        Called when a wrapper method is invoked. Uses the cms to create a new invocation agent and lets this agent call the web service. The result is transferred back into the result future of the caller.
        Specified by:
        invoke in interface java.lang.reflect.InvocationHandler
        Throws:
        java.lang.Throwable