1 package jfun.yan.xfire; 2 3 import jfun.yan.factory.Factory; 4 import jfun.yan.factory.GlobalScope; 5 import jfun.yan.factory.Pool; 6 import jfun.yan.factory.PooledFactory; 7 8 import org.codehaus.xfire.MessageContext; 9 10 16 public class ApplicationScopePolicy implements ScopePolicy { 17 public Factory applyScope(Factory f, MessageContext ctxt) { 18 return new PooledFactory(f, pool); 19 } 20 public String toString(){ 21 return "application scope"; 22 } 23 private final Pool pool = new GlobalScope(); 24 protected ApplicationScopePolicy(){} 25 28 public static ScopePolicy instance(){ 29 return new ApplicationScopePolicy(); 30 } 31 } 32 | Popular Tags |