Package org.fto.jthink.config

Examples of org.fto.jthink.config.Configuration


   */
  public static LogFactory getLogFactory(){
    if(logFactory!=null){
      return logFactory;
    }
    Configuration config = null;
    try{
      config = Configuration.getConfiguration();
    }catch(Exception e){}
    if(config==null){
      return new DefaultLogFactory(null);
View Full Code Here


import org.fto.jthink.util.XMLHelper;

public class ResourceManagerInitialization {
  public ResourceManager initResourceManager() throws Exception{
    /* 初始化配置文件 */
    Configuration config =
      new Configuration(
          XMLHelper.load(
               new PackageResourceReader(this.getClass()).getResource("/fto-jthink.xml").openStream()));
 
    /* 初始化日志管理器 */
    LogManager.configure(config);
View Full Code Here

    /* 加入应用程序全局资源容器 */
    setResourceContainer(ApplicationContext.class.getName(), ApplicationContext.getApplicationContext());

    /* 事务 */
    if(getResource(TransactionManager.class.getName())==null){
      Configuration config = Configuration.getConfiguration();
      /* 设置资源, 初始化事务管理器, 将TransactionManager加入到ResourceManager中 */
      TransactionManager transactionManager = new DefaultTransactionManager(this, config);
      setResource(TransactionManager.class.getName(), transactionManager);
     
      /* 设置资源,初始化事务工厂 */
      Element transactions = config.getConfig().getChild("transactions");
      if(transactions!=null){
        Iterator transactionsIT = transactions.getChildren().iterator();
        while(transactionsIT.hasNext()){
          Element transaction = (Element)transactionsIT.next();
          /* 创建事务工厂 */
 
View Full Code Here

    logger.debug("初始化JavaBean.");
   
    /* 返回资源管理器 */
    ResourceManager resManager = (ResourceManager)req.getAttribute(ResourceManager.class.getName());
   
    Configuration jthinkConfig = (Configuration)resManager.getResource(WEBApplicationContext.class.getName(), Configuration.class.getName());
   
    if(resManager.getResource(TransactionManager.class.getName())==null){
      /* 设置资源, 初始化事务管理器, 将TransactionManager加入到ResourceManager中 */
      logger.debug("初始化事务管理器, TransactionManager.");
      TransactionManager transactionManager = new DefaultTransactionManager(resManager, jthinkConfig);
View Full Code Here

    /*
     * 装入fto-jthink.xml文件,
     * 在资源管理器(ResourceManager)中可以通过getResource方法返回fto-jthink.xml配置
     */
    String jthinkConfig = webContext.getRealPath(webContext.getInitParameter("jthink-config-file"));
    Configuration config = new Configuration(jthinkConfig);
    webContext.setAttribute(Configuration.class.getName(), config);

    /*
     * 初始化日志, LogManager
     */
 
View Full Code Here

TOP

Related Classes of org.fto.jthink.config.Configuration

Copyright © 2018 www.massapicom. 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.