热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

javolution.xml.XMLObjectReader.close()方法的使用及代码示例

本文整理了Java中javolution.xml.XMLObjectReader.close()方法的一些代码示例,展示了XMLObjectReader.c

本文整理了Java中javolution.xml.XMLObjectReader.close()方法的一些代码示例,展示了XMLObjectReader.close()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLObjectReader.close()方法的具体详情如下:
包路径:javolution.xml.XMLObjectReader
类名称:XMLObjectReader
方法名:close

XMLObjectReader.close介绍

[英]Closes this reader and its underlying input then #resetthis reader for potential reuse.
[中]关闭此读卡器及其底层输入,然后#重置此读卡器以进行潜在的重用。

代码示例

代码示例来源:origin: org.mobicents.protocols.ss7.m3ua/m3ua-impl

private void loadVer1(String fn) throws XMLStreamException, IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(fn)));
StringBuilder sb = new StringBuilder();
while (true) {
String s1 = br.readLine();
if (s1 == null)
break;
sb.append(s1);
sb.append("\n");
}
br.close();
String s2 = sb.toString();
s2 = s2.replace(" StringReader sr = new StringReader(s2);
XMLObjectReader reader = XMLObjectReader.newInstance(sr);
reader.setBinding(binding);
this.loadActualData(reader);
reader.close();
}

代码示例来源:origin: org.restcomm.protocols.ss7.m3ua/m3ua-impl

private void loadVer1(String fn) throws XMLStreamException, IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(fn)));
StringBuilder sb = new StringBuilder();
while (true) {
String s1 = br.readLine();
if (s1 == null)
break;
sb.append(s1);
sb.append("\n");
}
br.close();
String s2 = sb.toString();
s2 = s2.replace(" StringReader sr = new StringReader(s2);
XMLObjectReader reader = XMLObjectReader.newInstance(sr);
reader.setBinding(binding);
this.loadActualData(reader);
reader.close();
}

代码示例来源:origin: org.restcomm.protocols.ss7.m3ua/m3ua-impl

protected void loadVer2(String fn) throws XMLStreamException, IOException{
XMLObjectReader reader = XMLObjectReader.newInstance(new FileInputStream(fn));
reader.setBinding(binding);
this.loadActualData(reader);
reader.close();
}

代码示例来源:origin: org.mobicents.protocols.ss7.m3ua/m3ua-impl

private void loadVer2(String fn) throws XMLStreamException, IOException{
XMLObjectReader reader = XMLObjectReader.newInstance(new FileInputStream(fn));
reader.setBinding(binding);
this.loadActualData(reader);
reader.close();
}

代码示例来源:origin: org.mobicents.smsc/domain

public void load() throws FileNotFoundException {
XMLObjectReader reader = null;
try {
reader = XMLObjectReader.newInstance(new FileInputStream(persistFile.toString()));
reader.setBinding(binding);
this.mprocs = reader.read(MPROC_LIST, FastList.class);
reader.close();
} catch (XMLStreamException ex) {
logger.info("Error while re-creating MProcRule from persisted file", ex);
}
}

代码示例来源:origin: org.mobicents.protocols.ss7.oam.common/statistics-oam-impl

/**
* Load and create LinkSets and Link from persisted file
*
* @throws Exception
*/
private void load() {
try {
File f = new File(persistFile.toString());
if (f.exists()) {
XMLObjectReader reader = XMLObjectReader.newInstance(new FileInputStream(persistFile.toString()));
reader.setBinding(binding);
this.lstCounterCampaign = reader.read(COUNTER_CAMPAIGNS, CounterCampaignMap.class);
reader.close();
}
} catch (XMLStreamException ex) {
logger.error(String.format("Failed to load the CounterProvider configuration file. \n%s", ex.getMessage()));
} catch (FileNotFoundException e) {
logger.warn(String.format("Failed to load the CounterProvider configuration file. \n%s", e.getMessage()));
} catch (IOException e) {
logger.error(String.format("Failed to load the CounterProvider configuration file. \n%s", e.getMessage()));
}
}

代码示例来源:origin: org.restcomm.camelgw/xml

/**
* De-serialize the byte[] into {@link CAPDialog} object
*
* @param data
* @return de-serialized Dialog Object
* @throws XMLStreamException
* Exception if de-serialization fails
*/
public XmlCAPDialog deserialize(byte[] data) throws XMLStreamException {
final ByteArrayInputStream bais = new ByteArrayInputStream(data);
final XMLObjectReader reader = XMLObjectReader.newInstance(bais);
try {
reader.setBinding(binding);
XmlCAPDialog dialog = reader.read(DIALOG, XmlCAPDialog.class);
return dialog;
} finally {
reader.close();
}
}

代码示例来源:origin: org.restcomm.protocols.ss7.map/map-impl

private void load(XMLObjectReader reader) throws XMLStreamException {
Integer val = reader.read(SHORT_TIMER_VALUE, Integer.class);
if (val != null)
this.shortTimer = val;
val = reader.read(MEDIUM_TIMER_VALUE, Integer.class);
if (val != null)
this.mediumTimer = val;
val = reader.read(LONG_TIMER_VALUE, Integer.class);
if (val != null)
this.lOngTimer= val;
reader.close();
}

代码示例来源:origin: org.mobicents.ussd/domain

/**
* Load and create LinkSets and Link from persisted file
*
* @throws Exception
*/
public void load() throws FileNotFoundException {
XMLObjectReader reader = null;
try {
reader = XMLObjectReader.newInstance(new FileInputStream(persistFile.toString()));
reader.setBinding(binding);
this.scRoutingRuleList = reader.read(SC_ROUTING_RULE_LIST, FastList.class);
reader.close();
} catch (XMLStreamException ex) {
// this.logger.info(
// "Error while re-creating Linksets from persisted file", ex);
}
}

代码示例来源:origin: org.restcomm.camelgw/domain

/**
* Load and create LinkSets and Link from persisted file
*
* @throws Exception
*/
public void load() throws FileNotFoundException {
XMLObjectReader reader = null;
try {
reader = XMLObjectReader.newInstance(new FileInputStream(persistFile.toString()));
reader.setBinding(binding);
this.scRoutingRuleList = reader.read(SC_ROUTING_RULE_LIST, FastList.class);
reader.close();
} catch (XMLStreamException ex) {
// this.logger.info(
// "Error while re-creating Linksets from persisted file", ex);
}
}

代码示例来源:origin: org.mobicents.protocols.ss7.tools.simulator/simulator-core

private boolean load(File fn) {
XMLObjectReader reader = null;
try {
if (!fn.exists()) {
this.sendNotif(SOURCE_NAME, "Error while reading the Host state from file: file not found: " + persistFile, "",
Level.WARN);
return false;
}
reader = XMLObjectReader.newInstance(new FileInputStream(fn));
reader.setBinding(binding);
this.cOnfigurationData= reader.read(CONFIGURATION_DATA, ConfigurationData.class);
reader.close();
return true;
} catch (Exception ex) {
this.sendNotif(SOURCE_NAME, "Error while reading the Host state from file", ex, Level.WARN);
return false;
}
}

代码示例来源:origin: org.restcomm.camelgw/xml

/**
* De-serialize passed {@link InputStream} into {@link CAPDialog} object
*
* @param is
* @return de-serialized Dialog Object
* @throws XMLStreamException
* Exception if de-serialization fails
*/
public XmlCAPDialog deserialize(InputStream is) throws XMLStreamException {
final XMLObjectReader reader = XMLObjectReader.newInstance(is);
try {
reader.setBinding(binding);
XmlCAPDialog dialog = reader.read(DIALOG, XmlCAPDialog.class);
return dialog;
} finally {
reader.close();
}
}
}

代码示例来源:origin: org.mobicents.protocols.ss7.sccp/sccp-impl

private ResourcesSet loadVer2(String fn) throws XMLStreamException, FileNotFoundException {
XMLObjectReader reader = XMLObjectReader.newInstance(new FileInputStream(fn));
reader.setBinding(binding);
RemoteSubSystemMap remoteSsns = reader.read(REMOTE_SSN, RemoteSubSystemMap.class);
RemoteSignalingPointCodeMap remoteSpcs = reader.read(REMOTE_SPC, RemoteSignalingPointCodeMap.class);
ConcernedSignalingPointCodeMap cOncernedSpcs= reader.read(CONCERNED_SPC, ConcernedSignalingPointCodeMap.class);
reader.close();
return new ResourcesSet(remoteSpcs, remoteSsns, concernedSpcs);
}

代码示例来源:origin: org.mobicents.smsc/domain

public synchronized void loadCorrId() {
XMLObjectReader reader = null;
try {
reader = XMLObjectReader.newInstance(new FileInputStream(persistFileCorrId.toString()));
try {
reader.setBinding(binding);
correlatiOnId= reader.read(CC_CORR_ID, Long.class);
correlationId += CORR_ID_LAG;
loadedCorrelatiOnId= -1;
logger.info("Successfully loaded home routing corrId: " + persistFile);
} finally {
reader.close();
}
} catch (FileNotFoundException ex) {
logger.warn("home routing corrId value: file not found: " + persistFile.toString());
logger.warn("CcMccmnsCollection: file not found: " + persistFile.toString());
try {
this.storeCorrId();
} catch (Exception e) {
}
} catch (XMLStreamException ex) {
logger.error("Error while loading home routing corrId value from file" + persistFile.toString(), ex);
}
}

代码示例来源:origin: org.mobicents.protocols.ss7.sccp/sccp-impl

private ResourcesSet loadVer3(String fn) throws XMLStreamException, FileNotFoundException {
XMLObjectReader reader = XMLObjectReader.newInstance(new FileInputStream(fn));
reader.setBinding(binding);
RemoteSubSystemMap remoteSsns = reader.read(REMOTE_SSN, RemoteSubSystemMap.class);
RemoteSignalingPointCodeMap remoteSpcs = reader.read(REMOTE_SPC, RemoteSignalingPointCodeMap.class);
ConcernedSignalingPointCodeMap cOncernedSpcs= reader.read(CONCERNED_SPC, ConcernedSignalingPointCodeMap.class);
reader.close();
return new ResourcesSet(remoteSpcs, remoteSsns, concernedSpcs);
}

代码示例来源:origin: org.mobicents.smsc/domain

public synchronized void load() {
// if (ccMccmncCollection != null && ccMccmnsTableVersiOnLoaded== ccMccmnsTableVersionActual)
// return;
ccMccmncCollection = new CcMccmncCollection();
XMLObjectReader reader = null;
try {
reader = XMLObjectReader.newInstance(new FileInputStream(persistFile.toString()));
try {
reader.setBinding(binding);
ccMccmncCollection = reader.read(CC_MCCMNS_COLLECTION, CcMccmncCollection.class);
logger.info("Successfully loaded CcMccmnsCollection: " + persistFile);
} finally {
reader.close();
}
} catch (FileNotFoundException ex) {
logger.warn("CcMccmnsCollection: file not found: " + persistFile.toString());
try {
this.store();
} catch (Exception e) {
}
} catch (XMLStreamException ex) {
logger.error("Error while loading CcMccmnsCollection from file" + persistFile.toString(), ex);
}
// ccMccmnsTableVersiOnLoaded= ccMccmnsTableVersionActual;
}

代码示例来源:origin: org.restcomm.camelgw/domain

/**
* Load and create LinkSets and Link from persisted file
*
* @throws Exception
*/
public void load() throws FileNotFoundException {
XMLObjectReader reader = null;
try {
reader = XMLObjectReader.newInstance(new FileInputStream(persistFile.toString()));
reader.setBinding(binding);
try{
this.noActivityTimeoutSec = reader.read(NO_ACTIVITY_TIMEOUT_SEC, Integer.class);
}catch(NullPointerException npe){
//ignore
}

try{
this.updateAssignedInvokeIds = reader.read(UPDATE_ASSIGN_INVOKE_IDS, Boolean.class);
}catch(NullPointerException npe){
//ignore
}
this.route = reader.read(ROUTE, String.class);
reader.close();
} catch (XMLStreamException ex) {
// this.logger.info(
// "Error while re-creating Linksets from persisted file", ex);
}
}

代码示例来源:origin: org.mobicents.smsc/domain

/**
* Load and create LinkSets and Link from persisted file
*
* @throws Exception
*/
public void load() throws FileNotFoundException {
XMLObjectReader reader = null;
try {
reader = XMLObjectReader.newInstance(new FileInputStream(persistFile.toString()));
reader.setBinding(binding);
this.httpUsers = reader.read(USER_LIST, FastList.class);
reader.close();
for (FastList.Node n = httpUsers.head(), end = httpUsers.tail(); (n = n.getNext()) != end;) {
HttpUser httpUser = n.getValue();
httpUser.httpUsersManagement = this;
}
} catch (XMLStreamException ex) {
// this.logger.info(
// "Error while re-creating Linksets from persisted file", ex);
}
}

代码示例来源:origin: org.mobicents.gmlc/domain

/**
* Load and create LinkSets and Link from persisted file
*
* @throws Exception
*/
public void load() throws FileNotFoundException {
XMLObjectReader reader = null;
try {
reader = XMLObjectReader.newInstance(new FileInputStream(persistFile.toString()));
reader.setBinding(binding);
this.gmlcGt = reader.read(GMLC_GT, String.class);
this.gmlcSsn = reader.read(GMLC_SSN, Integer.class);
this.hlrSsn = reader.read(HLR_SSN, Integer.class);
this.mscSsn = reader.read(MSC_SSN, Integer.class);
this.maxMapVersion = reader.read(MAX_MAP_VERSION, Integer.class);
reader.close();
} catch (XMLStreamException ex) {
// this.logger.info(
// "Error while re-creating Linksets from persisted file", ex);
}
}

代码示例来源:origin: org.mobicents.protocols.ss7.sccp/sccp-impl

private void loadVer3(String fn) throws XMLStreamException, FileNotFoundException {
XMLObjectReader reader = XMLObjectReader.newInstance(new FileInputStream(fn));
reader.setBinding(binding);
rulesMap = reader.read(RULE, RuleMap.class);
routingAddresses = reader.read(ROUTING_ADDRESS, SccpAddressMap.class);
lOngMessageRules= reader.read(LONG_MESSAGE_RULE, LongMessageRuleMap.class);
saps = reader.read(MTP3_SERVICE_ACCESS_POINT, Mtp3ServiceAccessPointMap.class);
for (FastMap.Entry e = this.saps.head(), end = this.saps.tail(); (e = e.getNext()) != end;) {
Mtp3ServiceAccessPoint sap = e.getValue();
((Mtp3ServiceAccessPointImpl)sap).setStackName(name);
}
reader.close();
}
}

推荐阅读
  • 本文详细介绍了 `org.apache.tinkerpop.gremlin.structure.VertexProperty` 类中的 `key()` 方法,并提供了多个实际应用的代码示例。通过这些示例,读者可以更好地理解该方法在图数据库操作中的具体用途。 ... [详细]
  • 利用Node.js实现PSD文件的高效切图
    本文介绍了如何通过Node.js及其psd2json模块,快速实现PSD文件的自动化切图过程,以适应项目中频繁的界面更新需求。此方法不仅提高了工作效率,还简化了从设计稿到实际应用的转换流程。 ... [详细]
  • 1、编写一个Java程序在屏幕上输出“你好!”。programmenameHelloworld.javapublicclassHelloworld{publicst ... [详细]
  • 基于SSM框架的在线考试系统:随机组卷功能详解
    本文深入探讨了基于SSM(Spring, Spring MVC, MyBatis)框架构建的在线考试系统中,随机组卷功能的设计与实现方法。 ... [详细]
  • Hibernate全自动全映射ORM框架,旨在消除sql,是一个持久层的ORM框架1)、基础概念DAO(DataAccessorOb ... [详细]
  • td{border:1pxsolid#808080;}参考:和FMX相关的类(表)TFmxObjectIFreeNotification ... [详细]
  • 本文详细探讨了在Java中如何将图像对象转换为文件和字节数组(Byte[])的技术。虽然网络上存在大量相关资料,但实际操作时仍需注意细节。本文通过使用JMSL 4.0库中的图表对象作为示例,提供了一种实用的方法。 ... [详细]
  • 处理Android EditText中数字输入与parseInt方法
    本文探讨了如何在Android应用中从EditText组件安全地获取并解析用户输入的数字,特别是用于设置端口号的情况。通过示例代码和异常处理策略,展示了有效的方法来避免因非法输入导致的应用崩溃。 ... [详细]
  • 长期从事ABAP开发工作的专业人士,在面对行业新趋势时,往往需要重新审视自己的发展方向。本文探讨了几位资深专家对ABAP未来走向的看法,以及开发者应如何调整技能以适应新的技术环境。 ... [详细]
  • 本文深入探讨了Go语言中的接口型函数,通过实例分析其灵活性和强大功能,帮助开发者更好地理解和运用这一特性。 ... [详细]
  • Spring Security基础配置详解
    本文详细介绍了Spring Security的基础配置方法,包括如何搭建Maven多模块工程以及具体的安全配置步骤,帮助开发者更好地理解和应用这一强大的安全框架。 ... [详细]
  • 本文详细介绍了在 CentOS 系统中如何创建和管理 SWAP 分区,包括临时创建交换文件、永久性增加交换空间的方法,以及如何手动释放内存缓存。 ... [详细]
  • 本文介绍了如何通过C#语言调用动态链接库(DLL)中的函数来实现IC卡的基本操作,包括初始化设备、设置密码模式、获取设备状态等,并详细展示了将TextBox中的数据写入IC卡的具体实现方法。 ... [详细]
  • Java中如何判断一个对象是否为Long类型
    本文介绍了一种在Java中判断对象是否属于Long类型的方法,通过定义一个特定的方法来实现这一功能,该方法能够准确地识别并返回结果。 ... [详细]
  • Web动态服务器Python基本实现
    Web动态服务器Python基本实现 ... [详细]
author-avatar
凤凰花开清风自来_406
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有