热门标签 | 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();
}
}

推荐阅读
  • DAO(Data Access Object)模式是一种用于抽象和封装所有对数据库或其他持久化机制访问的方法,它通过提供一个统一的接口来隐藏底层数据访问的复杂性。 ... [详细]
  • 重要知识点有:函数参数默许值、盈余参数、扩大运算符、new.target属性、块级函数、箭头函数以及尾挪用优化《深切明白ES6》笔记目次函数的默许参数在ES5中,我们给函数传参数, ... [详细]
  • 原文网址:https:www.cnblogs.comysoceanp7476379.html目录1、AOP什么?2、需求3、解决办法1:使用静态代理4 ... [详细]
  • 深入解析 Lifecycle 的实现原理
    本文将详细介绍 Android Jetpack 中 Lifecycle 组件的实现原理,帮助开发者更好地理解和使用 Lifecycle,避免常见的内存泄漏问题。 ... [详细]
  • 本文详细介绍了 PHP 中对象的生命周期、内存管理和魔术方法的使用,包括对象的自动销毁、析构函数的作用以及各种魔术方法的具体应用场景。 ... [详细]
  • 单元测试:使用mocha和should.js搭建nodejs的单元测试
    2019独角兽企业重金招聘Python工程师标准BDD测试利器:mochashould.js众所周知对于任何一个项目来说,做好单元测试都是必不可少 ... [详细]
  • 本文介绍了Java中的com.sun.codemodel.JBlock._continue()方法,并提供了多个实际代码示例,帮助开发者更好地理解和使用该方法。 ... [详细]
  • 属性类 `Properties` 是 `Hashtable` 类的子类,用于存储键值对形式的数据。该类在 Java 中广泛应用于配置文件的读取与写入,支持字符串类型的键和值。通过 `Properties` 类,开发者可以方便地进行配置信息的管理,确保应用程序的灵活性和可维护性。此外,`Properties` 类还提供了加载和保存属性文件的方法,使其在实际开发中具有较高的实用价值。 ... [详细]
  • 如何使用 `org.eclipse.rdf4j.query.impl.MapBindingSet.getValue()` 方法及其代码示例详解 ... [详细]
  • 本文详细解析了使用C++实现的键盘输入记录程序的源代码,该程序在Windows应用程序开发中具有很高的实用价值。键盘记录功能不仅在远程控制软件中广泛应用,还为开发者提供了强大的调试和监控工具。通过具体实例,本文深入探讨了C++键盘记录程序的设计与实现,适合需要相关技术的开发者参考。 ... [详细]
  • 如何使用 `org.apache.poi.openxml4j.opc.PackagePart` 类中的 `loadRelationships()` 方法及其代码示例详解 ... [详细]
  • Python 伦理黑客技术:深入探讨后门攻击(第三部分)
    在《Python 伦理黑客技术:深入探讨后门攻击(第三部分)》中,作者详细分析了后门攻击中的Socket问题。由于TCP协议基于流,难以确定消息批次的结束点,这给后门攻击的实现带来了挑战。为了解决这一问题,文章提出了一系列有效的技术方案,包括使用特定的分隔符和长度前缀,以确保数据包的准确传输和解析。这些方法不仅提高了攻击的隐蔽性和可靠性,还为安全研究人员提供了宝贵的参考。 ... [详细]
  • C++ 异步编程中获取线程执行结果的方法与技巧及其在前端开发中的应用探讨
    本文探讨了C++异步编程中获取线程执行结果的方法与技巧,并深入分析了这些技术在前端开发中的应用。通过对比不同的异步编程模型,本文详细介绍了如何高效地处理多线程任务,确保程序的稳定性和性能。同时,文章还结合实际案例,展示了这些方法在前端异步编程中的具体实现和优化策略。 ... [详细]
  • 本文详细介绍了在 Android 7.1 系统中调整屏幕分辨率和默认音量设置的方法。针对系统默认音量过大的问题,提供了具体的步骤来降低系统、铃声、媒体和闹钟的默认音量,以提升用户体验。此外,还涵盖了如何通过系统设置或使用第三方工具来优化屏幕分辨率,确保设备显示效果更加清晰和流畅。 ... [详细]
  • 本文详细介绍了一种利用 ESP8266 01S 模块构建 Web 服务器的成功实践方案。通过具体的代码示例和详细的步骤说明,帮助读者快速掌握该模块的使用方法。在疫情期间,作者重新审视并研究了这一未被充分利用的模块,最终成功实现了 Web 服务器的功能。本文不仅提供了完整的代码实现,还涵盖了调试过程中遇到的常见问题及其解决方法,为初学者提供了宝贵的参考。 ... [详细]
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社区 版权所有