📄 containerfactory.java
字号:
/*
* Copyright 2003-2005 the original author or authors.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.jdon.container.factory;
import java.util.Iterator;
import java.util.Map;
import com.jdon.container.ContainerWrapper;
import com.jdon.container.config.ContainerComponents;
import com.jdon.container.config.ContainerComponentsXmlLoader;
import com.jdon.container.config.aspect.AopInterceptorsXmlLoader;
import com.jdon.container.pico.PicoContainerWrapper;
import com.jdon.controller.config.XmlParser;
import com.jdon.util.Debug;
/**
* Factory that creating the container and its basic components
*
* @author <a href="mailto:banqiao@jdon.com">banq</a>
*
*/
public class ContainerFactory {
public final static String module = ContainerFactory.class.getName();
public ContainerWrapper create(){
return new PicoContainerWrapper();
}
public ContainerComponents fetchBasicComponents(String configFile){
//load container.xml and parse it into BasicComponents
XmlParser xmlParser = new ContainerComponentsXmlLoader();
Map components = xmlParser.load(configFile);
Debug.logVerbose(" found components in "+ configFile + " size:" + components.size(), module);
ContainerComponents configComponents = new ContainerComponents(components);
return configComponents;
}
public ContainerComponents fetchAspectComponents(String configFile){
//load aspect.xml and parse it into Aspect Components
XmlParser xmlParser = new AopInterceptorsXmlLoader();
Map components = xmlParser.load(configFile);
Debug.logVerbose(" found aspect components in "+ configFile + " size:" + components.size(), module);
ContainerComponents configComponents = new ContainerComponents(components);
return configComponents;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -