Uploaded image for project: 'Avalon Castle'
  1. Avalon Castle
  2. AVNSHARP-3

Create a Java like Proxy/InvocationHandler

    XMLWordPrintableJSON

Details

    • Task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • beta 1
    • beta 1
    • Castle Container
    • None

    Description

      CLI's Proxies are a bit different from Java proxies. Proxiable objects need to extends MarshalByRefObject or ContextBoundObject. Proxy definition goes through attributes.

      This proposal is to create a component that emits the necessary IL to generate a proxy for a set of interfaces and uses a invocation handler implementation to dispatch methods.

      Something like:

      object myproxy = DynamicProxy.create( new Type[]

      { typeof(interface1) }

      , new InvoHandlerImpl());

      // At this point myproxy implements interface1 and will dispatch
      // method invocation to InvoHandlerImpl

      Seems simple but will use reflection.emit to generate IL code, and this is like writing ASM

      Attachments

        Activity

          People

            Unassigned Unassigned
            hammett Hamilton Verissimo DeOliveira
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: