hivemind-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hensley, Richard" <Richard.Hens...@McKesson.com>
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"
interface="services.ApplicationVisitContext">
        <interceptor service-id="adept.TimerInterceptor" />
        <interceptor service-id="adept.LoggerInterceptor" />
    </service-point>

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

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

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.

Richard


---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org


Mime
View raw message