hivemind-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hensley, Richard" <>
Subject A question about ServicePropertyFactory
Date Mon, 11 Apr 2005 23:47:09 GMT
After reading through the Hivemind documentation, I think the following
configuration is correct because the ApplicationVisitContext object is
created new for each thread, and the property get method is called each time
a method is called on the User service.

    <service-point id="ApplicationVisitContext"
        <interceptor service-id="adept.TimerInterceptor" />
        <interceptor service-id="adept.LoggerInterceptor" />

    <implementation service-id="services.ApplicationVisitContext">
        <create-instance class="services.impl.ApplicationVisitContext"
model="threaded" />

	<service-point id="User" interface="security.User">
        <invoke-factory model="singleton"
            <construct service=id="services.ApplicationVisitContext"
property="user" />

The only part I'm questioning is the model for the User service-point.
Should it be singleton or threaded? I started with threaded but after
reading the documentation, this seemed to be unnecessary.

The basic use I have for this is to use some initialization methods of
ApplicationVisitContext at the top of my web request, and let the HiveMind
filter clean up the thread at the end. This should allow me to inject my
user right into the services that need it, and each service should have the
"right" user for the thread.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message