Uploaded image for project: 'James Server'
  1. James Server
  2. JAMES-438

add GenericMailet.getInitParameter(name,default)

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 2.2.0, 2.3.0
    • Fix Version/s: 2.3.0
    • Labels:
      None

      Description

      GenericMailet is made to be a convenient basic Mailet implementation, so it may be useful for it to provide this standard form of convenience method:

      String getInitParameter(String name, String default) {
      String param = getInitParameter(name);
      return param != null ? param : default;
      }

      Another similar convenience method might verify that a given parameter exists and throw an appropriate standard exception if it does not.

      Same goes for a parameter accessor that parses and returns integers(or throws standard exception if invalid formatted number).

      Currently, handling init params requires doing these anyway, so it ay as well be in the generic implementation...

        Activity

        Hide
        bago Stefano Bagnara added a comment -

        added the suggested method. There is room for improvements on the whole "sharable" code between mailets, but I would like to keep this for another issue.

        Show
        bago Stefano Bagnara added a comment - added the suggested method. There is room for improvements on the whole "sharable" code between mailets, but I would like to keep this for another issue.
        Hide
        danny@apache.org Danny Angus added a comment -

        Closing issue fixed in released version.

        Show
        danny@apache.org Danny Angus added a comment - Closing issue fixed in released version.

          People

          • Assignee:
            bago Stefano Bagnara
            Reporter:
            amichai Amichai Rothman
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development