What does the method that fetches the domain object look like?  Does
it cache its results or does it call the IDomainSource every time?

On 2/9/07, Tobias Marx <[EMAIL PROTECTED]> wrote:
Hi there!

I am using Hivemind to generate a Map of Domain name related objects as a 
singleton on startup, called HibernateDomainSource.

Then I am constructing a threaded services that uses this data
together with the servletRequest. This service is called DomainManager.

I am now injecting the DomainManager into my base component in order to access 
a domain object from the HibernateDomainSource that corresponds to the domain 
name from the servlet Request.

<service-point id="HibernateDomainSource" 
interface="tm.framework.services.interfaces.IDomainSource">
                <invoke-factory model="singleton">
                        <construct 
class="tm.framework.services.HibernateDomainSource">
                                <set-service property="templatePersistenceService" 
service-id="TemplatePersistenceService"/>
                        </construct>
                </invoke-factory>

        </service-point>

        <service-point id="DomainManager" 
interface="tm.framework.services.interfaces.DomainManager">
                <invoke-factory model="threaded">
                        <construct 
class="tm.framework.services.DomainManagerImpl">
                                <set-service property="domainSource" 
service-id="HibernateDomainSource"/>
                                <set-service property="servletRequest"  
service-id="tapestry.globals.HttpServletRequest" />
                        </construct>
                </invoke-factory>
        </service-point>

The "problem" now is, that the DomainManager method that fetches the domain 
object from the map is called several times during a single page request.

Is there a way to force it to only fetch it once per page request?

Thanks!

Toby

---------------------------------------------------------------------
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