River
  1. River
  2. RIVER-313

Provide mechanism to swap in alternatives to Java DSL for service configuration

    Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:

      All

      Description

      There has been some talk on the dev mailing list about providing alternative or additional methods of describing service configurations, rather than the stock Java DSL currently in use. This might include;

      • XML descriptions
      • Groovy classes
      • Scala classes
      • Other

      The Configuration mechanism could be extended to allow services to accept any kind of configuration (as identified above) and used in conjunction with any other type of configuration.

      See message at following link for the pointer to the thread;

      http://mail-archives.apache.org/mod_mbox/incubator-river-dev/200907.mbox/%3cE099BB07-376A-4357-9920-7D2C77F57927@gmail.com%3e

      1. GroovyConfig.groovy
        14 kB
        Dennis Reedy
      2. Component.java
        1 kB
        Dennis Reedy

        Activity

        Tom Hobbs created issue -
        Hide
        Tom Hobbs added a comment -

        Corrected wrong link to mailing list

        Show
        Tom Hobbs added a comment - Corrected wrong link to mailing list
        Tom Hobbs made changes -
        Field Original Value New Value
        Description There has been some talk on the dev mailing list about providing alternative or additional methods of describing service configurations, rather than the stock Java DSL currently in use. This might include;

        - XML descriptions
        - Groovy classes
        - Scala classes
        - Other

        The Configuration mechanism could be extended to allow services to accept any kind of configuration (as identified above) and used in conjunction with any other type of configuration.

        See message at following link for the pointer to the thread;
        http://mail-archives.apache.org/mod_mbox/incubator-river-dev/200907.mbox/%3c93890df00907142331h24885effp59803db4c71c14d9@mail.gmail.com%3e
        There has been some talk on the dev mailing list about providing alternative or additional methods of describing service configurations, rather than the stock Java DSL currently in use. This might include;

        - XML descriptions
        - Groovy classes
        - Scala classes
        - Other

        The Configuration mechanism could be extended to allow services to accept any kind of configuration (as identified above) and used in conjunction with any other type of configuration.

        See message at following link for the pointer to the thread;

        http://mail-archives.apache.org/mod_mbox/incubator-river-dev/200907.mbox/%3cE099BB07-376A-4357-9920-7D2C77F57927@gmail.com%3e
        Hide
        Dennis Reedy added a comment -

        How would you like to proceed with Groovy configuration support? Do you want to use what I have developed over in the Rio project? If so I will be glad to donate it.

        Show
        Dennis Reedy added a comment - How would you like to proceed with Groovy configuration support? Do you want to use what I have developed over in the Rio project? If so I will be glad to donate it.
        Hide
        Peter Firmstone added a comment -

        Yes Please.

        Show
        Peter Firmstone added a comment - Yes Please.
        Hide
        Dennis Reedy added a comment -

        Attached are the following files:

        GroovyConfig.groovy: Implements net.jini.config.Configuration, provides support for parsing Groovy classes and creating
        Component.java: Annotation used in a Groovy class to indicate what configuration component the class is to be used for.

        Show
        Dennis Reedy added a comment - Attached are the following files: GroovyConfig.groovy: Implements net.jini.config.Configuration, provides support for parsing Groovy classes and creating Component.java: Annotation used in a Groovy class to indicate what configuration component the class is to be used for.
        Dennis Reedy made changes -
        Attachment Component.java [ 12413687 ]
        Attachment GroovyConfig.groovy [ 12413688 ]
        Hide
        Gregg Wonderly added a comment -

        I think that this is already possible using the SPI that is designed into the ConfigurationProvider.
        -------------
        ConfigurationProvider Provides a standard means for obtaining Configuration instances, using a configurable provider. This class cannot be instantiated. The configuration provider can be specified by providing a resource named "META-INF/services/net.jini.config.Configuration" containing the name of the provider class. If multiple resources with that name are available, then the one used will be the last one returned by ClassLoader.getResources. If the resource is not found, the ConfigurationFile class is used.

        Show
        Gregg Wonderly added a comment - I think that this is already possible using the SPI that is designed into the ConfigurationProvider. ------------- ConfigurationProvider Provides a standard means for obtaining Configuration instances, using a configurable provider. This class cannot be instantiated. The configuration provider can be specified by providing a resource named "META-INF/services/net.jini.config.Configuration" containing the name of the provider class. If multiple resources with that name are available, then the one used will be the last one returned by ClassLoader.getResources. If the resource is not found, the ConfigurationFile class is used.
        Hide
        Dennis Reedy added a comment -

        @Gregg This is what is done with Rio. The META-INF/services/net.jini.config.Configuration file has the following contents:

        org.rioproject.config.GroovyConfig

        The GroovyConfig class I provided works as per the spec above.

        Show
        Dennis Reedy added a comment - @Gregg This is what is done with Rio. The META-INF/services/net.jini.config.Configuration file has the following contents: org.rioproject.config.GroovyConfig The GroovyConfig class I provided works as per the spec above.

          People

          • Assignee:
            Unassigned
            Reporter:
            Tom Hobbs
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:

              Development