Override the implementation of the tapestry.state.ApplicationStateManager
service point:

<implementation service-id="tapestry.state.ApplicationStateManager">
  <invoke-factory service-id="hivemind.BuilderFactory" model="pooled" >
        <construct 
class="com.icoserve.aim.web.commons.HibernateApplicationStateManager">
            <set-object property="factory" 
value="service:WebAccessFactory" />
            <set-service property="registry" 
service-id="tapestry.state.StateObjectManagerRegistry" />               
        </construct>
    </invoke-factory>
</implementation>

-----Original Message-----
From: Robert Binna [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 26, 2006 9:07 AM
To: [email protected]
Subject: Custom Application State Manager

Hi.

I am now developing no with tapestry for some month, and i must say it 
is a great thing. I think I am not a newbie anymore but I am far away 
from beeing an advanced user.

My problem is as follows:

I have developed a custom ApplicationStateManager that is responsible 
for dealing with Hibernate Objects.

I registered it with the following hivemind entries:

<service-point id="HibernateApplicationStateManager" 
interface="org.apache.tapestry.engine.state.ApplicationStateManager">
    <invoke-factory service-id="hivemind.BuilderFactory" model="pooled" >
        <construct 
class="com.icoserve.aim.web.commons.HibernateApplicationStateManager">
            <set-object property="factory" 
value="service:WebAccessFactory" />
            <set-service property="registry" 
service-id="tapestry.state.StateObjectManagerRegistry" />               
        </construct>
    </invoke-factory>
</service-point>
   
<contribution configuration-id="tapestry.InfrastructureOverrides">
    <property name="applicationStateManager" 
object="service:HibernateApplicationStateManager"/>
</contribution>

If I am now retrievin an ASO like this all works well and the 
HibernateApplicationStateManager is used:
  
return (MyState) getEngine().getInfrastructure()
                    .getApplicationStateManager().get("myState");

if i am doing it like this I am into troubles:

@InjectState("myState")
public abstracct MyStategetState()

It seems that the InjectStateWorker is hardwired to the service 
tapestry.state.ApplicationStateManager

Is there any way to override it with my custom AppliationStateManager or 
to set it to infrastructure:applicationStateManager

My development platform is:
       jdk: 1.5.0_05
       tomcat: 5.5.10
       tapestry: 4.0
       os: windows xp

I hope someone can help me.

Kind regards,
             Robert

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



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

Reply via email to