📄 targetmetadefxmlloader.java
字号:
/**
* Copyright 2005 Jdon.com
* 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.bussinessproxy.config;
import java.util.*;
import com.jdon.bussinessproxy.*;
import com.jdon.controller.config.*;
import com.jdon.util.*;
/**
* 从配置文件中获得EJB Service 和POJO Service
* 并这些Service保存到metaDefs中。
* PojoService有两种方式:
* (1) 以Meta形式保存(可实现AOP 拦截),待实现
* (2) 以单例注册直接注册到微容器中
* (3) 以对象池形式直接注册到微容器中,待实现
* 本类是注册到微容器中
*
* <p>Copyright: Jdon.com Copyright (c) 2005</p>
* <p></p>
* @author banq
* @version JdonFramework 2005 v1.0
*/
public class TargetMetaDefXmlLoader implements org.picocontainer.Startable,
TargetMetaDefLoader {
private final static String module = TargetMetaDefXmlLoader.class.getName();
private Collection configList;
/**
* 以ejbName为key, EJBTargetMetaDef为value
*/
private Map metaDefs = new HashMap();
private Map pojoClasses = new HashMap();
public TargetMetaDefXmlLoader() {
configList = new ArrayList();
}
public TargetMetaDefXmlLoader(Collection configList) {
this.configList = configList;
}
public TargetMetaDef getTargetMetaDef(String name){
return (TargetMetaDef)metaDefs.get(name);
}
public void start() {
Debug.logVerbose("EJBDefinitionLoader start .....", module);
XmlParser xmlParser = new XmlParser();
Iterator iter = configList.iterator();
while (iter.hasNext()) {
String configFileName = (String) iter.next();
Map mps = xmlParser.parseServices(configFileName);
metaDefs.putAll(mps);
Map pojoMps = xmlParser.parsePOJOServices(configFileName);
pojoClasses.putAll(pojoMps);
}
}
public void stop() {
metaDefs.clear();
configList = null;
}
public Map getMetaDefs() {
return metaDefs;
}
public Map getPojoClasses() {
return pojoClasses;
}
public void setMetaDefs(Map metaDefs) {
this.metaDefs = metaDefs;
}
public void setPojoClasses(Map pojoClasses) {
this.pojoClasses = pojoClasses;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -