package jfun.yan.xfire;
import jfun.yan.factory.Factory;
import jfun.yan.factory.GlobalScope;
import jfun.yan.factory.Pool;
import jfun.yan.factory.PooledFactory;
import org.codehaus.xfire.MessageContext;
/**
* This scope policy implements one servant instance per service.
* <p>
* @author Ben Yu
* Feb 6, 2006 11:38:08 AM
*/
public class ApplicationScopePolicy implements ScopePolicy {
public Factory applyScope(Factory f, MessageContext ctxt) {
return new PooledFactory(f, pool);
}
public String toString(){
return "application scope";
}
private final Pool pool = new GlobalScope();
protected ApplicationScopePolicy(){}
/**
* To get an instance of application scope policy.
*/
public static ScopePolicy instance(){
return new ApplicationScopePolicy();
}
}