Uploaded image for project: 'Synapse'
  1. Synapse
  2. SYNAPSE-377

Improve MediatorDeployer to support Startups and embedded JARs

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.2
    • Fix Version/s: None
    • Component/s: Deployment
    • Labels:
      None
    • Environment:
      N/A

      Description

      The MediatorDeployer could be improved to support
      (1) embedded JARs (under the lib folder inside the archive) in the same way as for Axis2 service and module archives: this would allow to bundle extension mediators together with their dependency JARs.
      (2) startups: the deployer should discover and register StartupFactory implementations in the same way as MediatorFactory implementations. While startups are not good candidates for hot deployment, this would still be useful in conjunction with the first improvement.

      Note that if (1) is implemented it would be useful to define a standard file extension for this kind of archive (to distinguish them from normal JARs). Maybe .sxar (Synapse eXtension ARchive)?

        Issue Links

          Activity

          Hide
          ruwan Ruwan Linton added a comment -

          This sounds interesting, but please note that you need to turn on hot deployment in the axis2.xml to activate this feature which is deactivated by default.

          With this change I propose to change the class name from MediatorDeployer to more meaning full one. May be we can use SynapseExtensionDeployer.

          +1 for the "sxar" extension and also we can write a maven arch type and a maven-sxar plugin as tools for these.

          Show
          ruwan Ruwan Linton added a comment - This sounds interesting, but please note that you need to turn on hot deployment in the axis2.xml to activate this feature which is deactivated by default. With this change I propose to change the class name from MediatorDeployer to more meaning full one. May be we can use SynapseExtensionDeployer. +1 for the "sxar" extension and also we can write a maven arch type and a maven-sxar plugin as tools for these.
          Hide
          veithen Andreas Veithen added a comment -

          Some updates on this issue:

          • Startups and embedded JARs are now supported.
          • After discussion on the dev and user lists (see http://www.nabble.com/File-suffix-for-Synapse-extension-archives-td18132506.html), a majority was in favor of "xar" for the file suffix.
          • A XAR Maven plugin is now available.
          • MediatorDeployer has been renamed to ExtensionDeployer (with an empty MediatorDeployer extending ExtensionDeployer still in place for compatibility).

          Things still to do:

          • Update documentation.
          • Provide a Maven archetype (project template) for easy creation of new XAR projects.
          • Clean up the code in ExtensionDeployer, MediatorFactoryFinder, MediatorSerializerFinder and StartupFinder.

          With respect to the last point, one can indeed identify the following issues:

          • MediatorFactoryFinder, MediatorSerializerFinder and StartupFinder depend on sun.misc.Service. While this class is probably present in the majority of JREs it is nevertheless bad practice to depend on classes in Sun's internal packages. On the other hand ExtensionDeployer has code that is more or less equivalent to what is provided by sun.misc.Service. We should reuse this code.
          • There is an asymmetry between mediator and startup factories/serializers (e.g. there is no service lookup for startup serializers). Given that initialization of startups had a bug that was only solved recently (see http://svn.apache.org/viewvc?view=rev&revision=670781) we can assume that there are not many existing startup implementations outside the Synapse project itself and it is thus safe to modify the startup factory/serialization mechanism to align it with the approach used for mediators.
          • Creation and serialization of mediators and startups are quite similar: there should be code that can be reused for both types of extensions.
          Show
          veithen Andreas Veithen added a comment - Some updates on this issue: Startups and embedded JARs are now supported. After discussion on the dev and user lists (see http://www.nabble.com/File-suffix-for-Synapse-extension-archives-td18132506.html ), a majority was in favor of "xar" for the file suffix. A XAR Maven plugin is now available. MediatorDeployer has been renamed to ExtensionDeployer (with an empty MediatorDeployer extending ExtensionDeployer still in place for compatibility). Things still to do: Update documentation. Provide a Maven archetype (project template) for easy creation of new XAR projects. Clean up the code in ExtensionDeployer, MediatorFactoryFinder, MediatorSerializerFinder and StartupFinder. With respect to the last point, one can indeed identify the following issues: MediatorFactoryFinder, MediatorSerializerFinder and StartupFinder depend on sun.misc.Service. While this class is probably present in the majority of JREs it is nevertheless bad practice to depend on classes in Sun's internal packages. On the other hand ExtensionDeployer has code that is more or less equivalent to what is provided by sun.misc.Service. We should reuse this code. There is an asymmetry between mediator and startup factories/serializers (e.g. there is no service lookup for startup serializers). Given that initialization of startups had a bug that was only solved recently (see http://svn.apache.org/viewvc?view=rev&revision=670781 ) we can assume that there are not many existing startup implementations outside the Synapse project itself and it is thus safe to modify the startup factory/serialization mechanism to align it with the approach used for mediators. Creation and serialization of mediators and startups are quite similar: there should be code that can be reused for both types of extensions.
          Hide
          veithen Andreas Veithen added a comment -

          See also the discussion here: http://markmail.org/message/j3b3t7ltqiimekhm

          Show
          veithen Andreas Veithen added a comment - See also the discussion here: http://markmail.org/message/j3b3t7ltqiimekhm
          Hide
          hiranya Hiranya Jayathilaka added a comment -

          Andreas,

          What is the status of this issue? Can we resolve this while keeping SYNAPSE-485 open for the moment? SYNAPSE-485 needs to be fixed soon. But it's too late for 2.0 IMO. But this particular issue seems to be fixed in the trunk. Please confirm.

          -Hiranya

          Show
          hiranya Hiranya Jayathilaka added a comment - Andreas, What is the status of this issue? Can we resolve this while keeping SYNAPSE-485 open for the moment? SYNAPSE-485 needs to be fixed soon. But it's too late for 2.0 IMO. But this particular issue seems to be fixed in the trunk. Please confirm. -Hiranya

            People

            • Assignee:
              veithen Andreas Veithen
              Reporter:
              veithen Andreas Veithen
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development