Jeff Lubetkin <jefflub <at> zillow.com> writes:

> I’d like to remove the “client” related
> persistence strategies from the PersistenceStrategy configuration point. 

Why do that?

> The only way I’ve figured out how to do this is to effectively recreate a
> bunch of the tapestry configuration so that I can construct a new instance of
> the RequestCycleFactory that has my persistence config, then contribute that 
> to InfrastructureOverrides.  It just feels like there must be a simpler way
> to do this, but I can’t figure it out.  Is there any way for a
> downstream config file to remove config items from a configuration point, or
> override the list entirely?

Have you tried overriding the PropertyPersistenceStrategySource implementation:

<implementation 
  service-point="tapestry.persist.PropertyPersistenceStrategySource">
  <invoke-factory service-id="hivemind.BuilderFactory" model="singleton" >
    <construct class="MyPropertyPersistenceStrategySource" >
       <set-configuration configuration-id="PersistenceStrategy" 
            property="contributions" />
    </construct>
  </invoke-factory>
</implementation>

class MyPropertyPersistenceStrategySource 
  extends PropertyPersistenceStrategySourceImpl {

    public void setContributions(List contributions)
    {
        List adjustedContributions = new ArrayList(contributions);
        //remove the PropertyPersistenceStrategyContribution whose
        //getName() returns a string starting with "client".
        super.setContributions(adjustedContributions);
    }
}

--
Author of a book for learning Tapestry (http://www.agileskills2.org/EWDT)


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to