org.apache.hivemind.impl.servicemodel
Class ThreadedServiceModel

java.lang.Object
  extended by org.apache.hivemind.impl.servicemodel.AbstractServiceModelImpl
      extended by org.apache.hivemind.impl.servicemodel.ThreadedServiceModel
All Implemented Interfaces:
ServiceModel

public final class ThreadedServiceModel
extends AbstractServiceModelImpl

Like SingletonServiceModel, this method returns a proxy (implementing the service interface); unlike SingletonServiceModel, it always returns the proxy. Invoking a service method on the proxy constructs a service implementation and binds it to the current thread.

Author:
Howard Lewis Ship

Field Summary
protected static java.lang.String SERVICE_ACCESSOR_METHOD_NAME
          Name of a method in the deferred proxy that is used to obtain the constructed service.
 
Fields inherited from class org.apache.hivemind.impl.servicemodel.AbstractServiceModelImpl
_log
 
Fields inherited from interface org.apache.hivemind.internal.ServiceModel
POOLED, PRIMITIVE, SINGLETON, THREADED
 
Constructor Summary
ThreadedServiceModel(ConstructableServicePoint servicePoint)
           
 
Method Summary
 java.lang.Object getService()
          Always returns the service proxy.
 java.lang.Object getServiceImplementationForCurrentThread()
          Invoked by the proxy to return the active service impl for this thread, constructing it as necessary.
 void instantiateService()
          Invokes getServiceImplementationForCurrentThread() to force the creation of the service implementation.
 
Methods inherited from class org.apache.hivemind.impl.servicemodel.AbstractServiceModelImpl
addInterceptors, constructBridgeProxy, constructCoreServiceImplementation, constructNewServiceImplementation, constructServiceImplementation, getServicePoint, registerWithShutdownCoordinator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SERVICE_ACCESSOR_METHOD_NAME

protected static final java.lang.String SERVICE_ACCESSOR_METHOD_NAME
Name of a method in the deferred proxy that is used to obtain the constructed service.

See Also:
Constant Field Values
Constructor Detail

ThreadedServiceModel

public ThreadedServiceModel(ConstructableServicePoint servicePoint)
Method Detail

getService

public java.lang.Object getService()
Always returns the service proxy.


getServiceImplementationForCurrentThread

public java.lang.Object getServiceImplementationForCurrentThread()
Invoked by the proxy to return the active service impl for this thread, constructing it as necessary.


instantiateService

public void instantiateService()
Invokes getServiceImplementationForCurrentThread() to force the creation of the service implementation.



Copyright © 2003-2007 Apache Software Foundation. All Rights Reserved.