groovy
  1. groovy
  2. GROOVY-3944

Add a META-INF/services mechanism (similar to global ast transformations) that allows custom ExpandoMetaClass code to be run when a class is loaded

    Details

    • Type: Improvement Improvement
    • Status: Open Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 2.x
    • Component/s: groovy-runtime
    • Labels:
      None
    • Number of attachments :
      0

      Description

      Currently there isn't really a way to hook ExpandoMetaClass logic into class loading. There was a similar JIRA to this raised by James I believe, but I think its important we come up with a solution to this for 1.8

        Issue Links

          Activity

          Hide
          Merlyn Albery-Speyer added a comment -

          GROOVY-1721 appears to suggest an approach to this.

          Show
          Merlyn Albery-Speyer added a comment - GROOVY-1721 appears to suggest an approach to this.
          Hide
          Roshan Dawrani added a comment -

          Both current JIRA and GROOVY-1721 seem to be about the same thing. Maybe they should be linked and one of them closed as duplicate.

          Show
          Roshan Dawrani added a comment - Both current JIRA and GROOVY-1721 seem to be about the same thing. Maybe they should be linked and one of them closed as duplicate.
          Hide
          Paul King added a comment -

          Possibly related

          Show
          Paul King added a comment - Possibly related
          Hide
          Merlyn Albery-Speyer added a comment -

          How about this:

          We place the EMC code in static initializers on classes following a convention so that referencing the class leads to running the EMC code. Next we add a mechanism whereby we can list a number of classes in the manifest of a jar file. When we detect the first use of that jar we can then Class.forName each of those classes. Finally, we provide a groovy jar tool that will scan all groovy classes for use of the EMC code convention and automatically compile the list of classes to list in the manifest.

          Show
          Merlyn Albery-Speyer added a comment - How about this: We place the EMC code in static initializers on classes following a convention so that referencing the class leads to running the EMC code. Next we add a mechanism whereby we can list a number of classes in the manifest of a jar file. When we detect the first use of that jar we can then Class.forName each of those classes. Finally, we provide a groovy jar tool that will scan all groovy classes for use of the EMC code convention and automatically compile the list of classes to list in the manifest.

            People

            • Assignee:
              Unassigned
              Reporter:
              Graeme Rocher
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: