Uploaded image for project: 'mdsal'
  1. mdsal
  2. MDSAL-774

Do not use proxies for Action/Rpc adapter

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Medium Medium
    • 14.0.0
    • None
    • Binding runtime

      We are currently using a java.lang.reflect.Proxy to implement Action instances and route them towards a backend. While this works, it also adds quite a bit of ceremony to the invocation, as we could very easily follow CodecDataObject layout to create these proxies.

      The key thing to understand here is that yang.binding.Action covers the invocation surface and therefore we can quite sensibly route it through codecs. The only thing we need to generate dynamically is a subclass which ties the (hypothetical) AdapterAction abstract base class and the concrete Binding Action interface – everything else is just default methods and generics (which fizzle at runtime).

      This also extends to Rpc adapters.

      In order to do this, we will need to factor out the ByteBuddy loading machinery from mdsal-binding-dom-codec, so that it can be reused by mdsal-binding-dom-adapter. That artifact should be named mdsal-binding-loader.

            Unassigned Unassigned
            rovarga Robert Varga
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: