1 Reply Latest reply on Oct 4, 2006 12:21 PM by Scott Stark

    System property substitution on all metadata

    Brian Stansberry Master

      AFAK we currently only do system property substitution when we parse XML config files. As part of creating the metadata for a deployment, shouldn't we do it for any applicable type of metadata, e.g. annotation attributes of type String?

      There have been requests for property substitution on annotations (see http://jira.jboss.com/jira/browse/EJBTHREE-424). I'd like to be able to do something like this:

      @Target(ElementType.TYPE)
      @Retention(RetentionPolicy.RUNTIME)
      public @interface Clustered
      {
       Class loadBalancePolicy() default LoadBalancePolicy.class;
      
       String partition() default "${jboss.partition.name:DefaultPartition}";
      }
      


      Right now I can search the code for any uses of the annotation and pass the value through something like StringPropertyReplacer, but it's easy to miss things, the conversion happens every time the property is used and it only deals with this one attribute. Since we're going to start pulling metadata from a runtime metadata model, it seems we could just do the substitution once when we populate the model.