Package jfun.yan.xfire

Source Code of jfun.yan.xfire.ApplicationScopePolicy

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();
  }
}
TOP

Related Classes of jfun.yan.xfire.ApplicationScopePolicy

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.