org.apache.hivemind.impl.servicemodel
Class PooledServiceModel

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

public class PooledServiceModel
extends AbstractServiceModelImpl

Similar to the threaded service model, except that, once created, services are pooled for later use.

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
PooledServiceModel(ConstructableServicePoint servicePoint)
           
 
Method Summary
 java.lang.Object getService()
          Invoked by the service extension point to obtain the service implementation.
 java.lang.Object getServiceImplementationForCurrentThread()
           
 void instantiateService()
          Invokes getServiceImplementationForCurrentThread() to instantiate an instance of the service.
 
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

PooledServiceModel

public PooledServiceModel(ConstructableServicePoint servicePoint)
Method Detail

getService

public java.lang.Object getService()
Description copied from interface: ServiceModel
Invoked by the service extension point to obtain the service implementation. The model may return the actual service implementation or some form of proxy.

This method is only invoked once; the returned value is used from that point on (in all threads, by all callers). Most models return a proxy that takes care of realizing the service (actually creating the service, configuring it, and wrapping it with interceptors) only when needed.


getServiceImplementationForCurrentThread

public java.lang.Object getServiceImplementationForCurrentThread()

instantiateService

public void instantiateService()
Invokes getServiceImplementationForCurrentThread() to instantiate an instance of the service.



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