org.apache.hivemind.internal
Interface ServiceModel

All Known Implementing Classes:
AbstractServiceModelImpl, PooledServiceModel, PrimitiveServiceModel, SingletonServiceModel, ThreadedServiceModel

public interface ServiceModel

A service model is associated with a ServicePoint to supply rules for the lifecycle of the service. This concerns when the service is first created and whether it is pooled, etc. Each service extension point will have a unique instance of ServiceModel.

Author:
Howard Lewis Ship

Field Summary
static java.lang.String POOLED
           
static java.lang.String PRIMITIVE
           
static java.lang.String SINGLETON
           
static java.lang.String THREADED
           
 
Method Summary
 java.lang.Object getService()
          Invoked by the service extension point to obtain the service implementation.
 void instantiateService()
          Forces the core service implementation (and any interceptors) to be fully instantiated immediately, rather than waiting for the first service method invocation.
 

Field Detail

PRIMITIVE

static final java.lang.String PRIMITIVE
See Also:
Constant Field Values

SINGLETON

static final java.lang.String SINGLETON
See Also:
Constant Field Values

THREADED

static final java.lang.String THREADED
See Also:
Constant Field Values

POOLED

static final java.lang.String POOLED
See Also:
Constant Field Values
Method Detail

getService

java.lang.Object getService()
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.


instantiateService

void instantiateService()
Forces the core service implementation (and any interceptors) to be fully instantiated immediately, rather than waiting for the first service method invocation. This is used when a service needs to be "eagerly loaded" rather than "lazy loaded".



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