Uploaded image for project: 'Qpid'
  1. Qpid
  2. QPID-1786

Java QMF Agent with Support for Nonmanaged objects

    Details

      Description

      The feature (with patches) is for a Java agent which supports the encoding and decoding of complex object types. The patches provided are based off of patches provided by Ted Ross (pythonConsole.pactch) and Rafael Schloming (javaAgent.patch).

      The Java agent is an IOC friendly class which can be configured to connect to an AMQP broker. It allows for classes to be bound to QMF either by registering a managed object, or by directly registering the classes. Complex input and output types (including custom objects, lists, enumerations) are marshalled into and out of QMF Object types (type 20). Annotations can be used to control the class and package naming of the objects.

      The python console has been extended to work with the java agent. The supplied test program (muppet.py) exercises much of the functionality of the Java Agent and complex object marshalling.

      Open issues right now with this initial patch include:

      • Type Inheritance: How to show in the schema that one type extends another (See Pikelet and Crumpet)?
      • Do we allow operator overloading? (currently we do not). Right now a managed object can only have a single method with a single name
      • Enumerations: Do we should the value values in the schema?
      • Do we show in the schema that one type is unmanaged?
      • If the Qpid deamon dies, the agent does not reconnect
      • Maps: The current ftables type only passes Native QPID types. Should a new map be created which sends complex objects?
      1. muppet.py
        2 kB
        Bryan Kearney
      2. pythonPatch4.patch
        32 kB
        Bryan Kearney
      3. javaPatch4.patch
        112 kB
        Bryan Kearney
      4. cppPatch4.patch
        3 kB
        Bryan Kearney
      5. javaAgent.patch
        88 kB
        Bryan Kearney
      6. muppet.py
        2 kB
        Bryan Kearney
      7. pythonConsole.patch
        27 kB
        Bryan Kearney

        Activity

        Hide
        bkearney@redhat.com Bryan Kearney added a comment -

        New muppet.py file. The old file can not be replaced.

        Show
        bkearney@redhat.com Bryan Kearney added a comment - New muppet.py file. The old file can not be replaced.
        Hide
        bkearney@redhat.com Bryan Kearney added a comment -

        The *Patch4.patch files replace the previous patch files. The main changes to the previous patches are:

        1) Lists, Arrays, and Maps are encoded as variable lenght binary fields. This is consistent with the qpid codec.
        2) Schema responses send across a boolean to say if they have a super type, and the class key for that supertype.
        3) Item (2) required a change to the C++ broker code as well as the code generation facility. Therefore, the cpp patch must be applied as well.

        Show
        bkearney@redhat.com Bryan Kearney added a comment - The *Patch4.patch files replace the previous patch files. The main changes to the previous patches are: 1) Lists, Arrays, and Maps are encoded as variable lenght binary fields. This is consistent with the qpid codec. 2) Schema responses send across a boolean to say if they have a super type, and the class key for that supertype. 3) Item (2) required a change to the C++ broker code as well as the code generation facility. Therefore, the cpp patch must be applied as well.
        Hide
        bkearney@redhat.com Bryan Kearney added a comment -

        I will upload a third patch set (*3) which adds map support to the agent and the python console. As with lists, the the codec code for marshalling is pulled up into the console. In addition, these new patches add schema ahsh valued based on the method and property signatures.

        Show
        bkearney@redhat.com Bryan Kearney added a comment - I will upload a third patch set (*3) which adds map support to the agent and the python console. As with lists, the the codec code for marshalling is pulled up into the console. In addition, these new patches add schema ahsh valued based on the method and property signatures.
        Hide
        bkearney@redhat.com Bryan Kearney added a comment -

        I am going to update a new set of patches (*2.patch) which replaces the older ones. The new patches provide the following enhancements:

        • Events: Added the raiseEvent method for parity with the CPP agent.
        • Thread Safety: You should be able to recieve messages and send events at the same time.
        • Object return types which actually contain native types: This one is a bit tricky. I added the encoding for Objects (type 20) to also contain the real type. The use case is if I have a paraemeter which is marked as an obejct but is actually sent a native type (i.e. pass in a string). We could save space by encoding somethign interesting in the classname/packagename but until then I added the actual type.
        • New annotations to say a class is an Event (@QMFEvent) and an annotation to hide certain behaviour (@QMFHide)
        Show
        bkearney@redhat.com Bryan Kearney added a comment - I am going to update a new set of patches (*2.patch) which replaces the older ones. The new patches provide the following enhancements: Events: Added the raiseEvent method for parity with the CPP agent. Thread Safety: You should be able to recieve messages and send events at the same time. Object return types which actually contain native types: This one is a bit tricky. I added the encoding for Objects (type 20) to also contain the real type. The use case is if I have a paraemeter which is marked as an obejct but is actually sent a native type (i.e. pass in a string). We could save space by encoding somethign interesting in the classname/packagename but until then I added the actual type. New annotations to say a class is an Event (@QMFEvent) and an annotation to hide certain behaviour (@QMFHide)
        Hide
        bryan.kearney Bryan Kearney added a comment -

        Pacth for the java agent. Effects the java branch, to be run from the root. You will also need to download the jms-1.1.jar file and place it into the lib directory for this to work.

        Show
        bryan.kearney Bryan Kearney added a comment - Pacth for the java agent. Effects the java branch, to be run from the root. You will also need to download the jms-1.1.jar file and place it into the lib directory for this to work.
        Hide
        bryan.kearney Bryan Kearney added a comment -

        Test program. Once you have applied the patches you can run the agent with the test classes with the following command:

        build/bin/qpid-run -cp build/lib/qpid-all.jar:build/lib/qpid-agent-tests-05.jar org.apache.qpid.agenAgent localhost agent org.apache.qpid.agent.Muppet

        Show
        bryan.kearney Bryan Kearney added a comment - Test program. Once you have applied the patches you can run the agent with the test classes with the following command: build/bin/qpid-run -cp build/lib/qpid-all.jar:build/lib/qpid-agent-tests-05.jar org.apache.qpid.agenAgent localhost agent org.apache.qpid.agent.Muppet
        Hide
        bryan.kearney Bryan Kearney added a comment -

        Java Agent Patch. Effects the java tree, to be executed from root.

        Show
        bryan.kearney Bryan Kearney added a comment - Java Agent Patch. Effects the java tree, to be executed from root.
        Hide
        bryan.kearney Bryan Kearney added a comment -

        Patch to the python console. To be imported form the root.

        Show
        bryan.kearney Bryan Kearney added a comment - Patch to the python console. To be imported form the root.

          People

          • Assignee:
            tedross Ted Ross
            Reporter:
            bryan.kearney Bryan Kearney
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development