Here's what I use. Both the factory as well as the ASO itself take a
constructor parameter.
<service-point id="UserCredentialFactory"
interface="org.apache.tapestry.engine.state.StateObjectFactory">
<invoke-factory>
<construct class="com.bmw.projector.aso.UserCredentialFactory" />
</invoke-factory>
</service-point>
<contribution configuration-id="tapestry.state.ApplicationObjects">
<state-object name="credential" scope="session">
<invoke-factory object="service:UserCredentialFactory" />
</state-object>
</contribution>
> -----Original Message-----
> From: Oscar Picasso [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, February 21, 2006 2:48 PM
> To: [email protected]
> Subject: State object and hivemind trouble
>
>
> Hi,
>
> I am still trying to understand how to configure an
> application state object in hivemind.
>
> I have an AccessManagerProvider class with a two parameters
> constructor. Currently it is configured as a service and
> injected into the pages that need it.
>
> It works fine.
>
> I find more appropriate to use this same class as an
> application state object but I am not able to find the right
> hivemind configuration.
> - if I use the same invoke-factory that I use with the
> service I get an Exception.
> - I have tried to implement a StateObjectFactory which create
> the object and configure it with:
> <invoke-factory
> service-id="org.jop.web.DaoManagerProviderStateObjectFactory">
> but I get another Exception:
> ...Attribute 'service-id' is not defined in the schema.
> Attribute 'object' is required but no value was provided.
>
> I am lost here.
>
> Can someone give me a complete example of how to configure an
> application state object with a constructor that takes (a)
> parameter(s)?
>
> Thanks.
>
> Oscar
>
> Below the service hivemind fragment that works fine.
>
> ...
> <service-point id="DaoManagerProvider"
> interface="org.jop.dao.DaoManagerProvider">
> <interceptor service-id="hivemind.LoggingInterceptor"/>
> </service-point>
>
> <implementation service-id="DaoManagerProvider">
> <invoke-factory>
> <construct class="org.jop.cayenne.access.AccessManagerProvider">
> <string>ProductionDomain</string>
> <int>10</int>
> </construct>
> </invoke-factory>
> </implementation>
> ...
>
>
>
> ---------------------------------
> Yahoo! Mail
> Use Photomail to share photos without annoying attachments.
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]