[jboss-user] [Microcontainer] - Re: How do you override the source for configuration propert

alesj do-not-reply at jboss.com
Thu Jul 19 10:12:28 EDT 2007


"alesj" wrote : Aha, just remembered one ... one sec ;-)

XML:

  | <bean name="prop1" class="org.acme.LDAPPropProvider">
  | <constructor>
  |          <parameter replace="false">${somekey:somedefault} </parameter>                  
  | </constructor>
  | </bean>
  | 
  |    <bean name="NeedsOurSystemProperty" class="org.acme.PropWanna">
  |       <property name="someProp"><inject bean="prop1" property="provideProperty">/</property>
  |    </bean>
  | 

Where mock is now:

  | public class LDAPPropProvider
  |    {
  |       private String propKey;
  | 
  |       public LDAPPropProvider(String prop)
  |        {
  |            this.propKey = prop;
  |        }
  | 
  |       public String getProvideProperty()
  |       {
  |          return LDAP.lookup(propKey);
  |       }
  |    }
  | 
  |    public class PropWanna
  |    {
  |       public void setSomeProp(String prop)
  |       {
  |          ...
  |       }
  |    }
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4065805#4065805

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4065805



More information about the jboss-user mailing list