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

推荐阅读
  • 本文介绍了在iOS开发中使用UITextField实现字符限制的方法,包括利用代理方法和使用BNTextField-Limit库的实现策略。通过这些方法,开发者可以方便地限制UITextField的字符个数和输入规则。 ... [详细]
  • 标题: ... [详细]
  • XML介绍与使用的概述及标签规则
    本文介绍了XML的基本概念和用途,包括XML的可扩展性和标签的自定义特性。同时还详细解释了XML标签的规则,包括标签的尖括号和合法标识符的组成,标签必须成对出现的原则以及特殊标签的使用方法。通过本文的阅读,读者可以对XML的基本知识有一个全面的了解。 ... [详细]
  • 纠正网上的错误:自定义一个类叫java.lang.System/String的方法
    本文纠正了网上关于自定义一个类叫java.lang.System/String的错误答案,并详细解释了为什么这种方法是错误的。作者指出,虽然双亲委托机制确实可以阻止自定义的System类被加载,但通过自定义一个特殊的类加载器,可以绕过双亲委托机制,达到自定义System类的目的。作者呼吁读者对网上的内容持怀疑态度,并带着问题来阅读文章。 ... [详细]
  • 本文介绍了RxJava在Android开发中的广泛应用以及其在事件总线(Event Bus)实现中的使用方法。RxJava是一种基于观察者模式的异步java库,可以提高开发效率、降低维护成本。通过RxJava,开发者可以实现事件的异步处理和链式操作。对于已经具备RxJava基础的开发者来说,本文将详细介绍如何利用RxJava实现事件总线,并提供了使用建议。 ... [详细]
  • 本文介绍了如何在给定的有序字符序列中插入新字符,并保持序列的有序性。通过示例代码演示了插入过程,以及插入后的字符序列。 ... [详细]
  • 本文介绍了Java高并发程序设计中线程安全的概念与synchronized关键字的使用。通过一个计数器的例子,演示了多线程同时对变量进行累加操作时可能出现的问题。最终值会小于预期的原因是因为两个线程同时对变量进行写入时,其中一个线程的结果会覆盖另一个线程的结果。为了解决这个问题,可以使用synchronized关键字来保证线程安全。 ... [详细]
  • 个人学习使用:谨慎参考1Client类importcom.thoughtworks.gauge.Step;importcom.thoughtworks.gauge.T ... [详细]
  • CF:3D City Model(小思维)问题解析和代码实现
    本文通过解析CF:3D City Model问题,介绍了问题的背景和要求,并给出了相应的代码实现。该问题涉及到在一个矩形的网格上建造城市的情景,每个网格单元可以作为建筑的基础,建筑由多个立方体叠加而成。文章详细讲解了问题的解决思路,并给出了相应的代码实现供读者参考。 ... [详细]
  • springmvc学习笔记(十):控制器业务方法中通过注解实现封装Javabean接收表单提交的数据
    本文介绍了在springmvc学习笔记系列的第十篇中,控制器的业务方法中如何通过注解实现封装Javabean来接收表单提交的数据。同时还讨论了当有多个注册表单且字段完全相同时,如何将其交给同一个控制器处理。 ... [详细]
  • 猜字母游戏
    猜字母游戏猜字母游戏——设计数据结构猜字母游戏——设计程序结构猜字母游戏——实现字母生成方法猜字母游戏——实现字母检测方法猜字母游戏——实现主方法1猜字母游戏——设计数据结构1.1 ... [详细]
  • [大整数乘法] java代码实现
    本文介绍了使用java代码实现大整数乘法的过程,同时也涉及到大整数加法和大整数减法的计算方法。通过分治算法来提高计算效率,并对算法的时间复杂度进行了研究。详细代码实现请参考文章链接。 ... [详细]
  • 本文介绍了Python爬虫技术基础篇面向对象高级编程(中)中的多重继承概念。通过继承,子类可以扩展父类的功能。文章以动物类层次的设计为例,讨论了按照不同分类方式设计类层次的复杂性和多重继承的优势。最后给出了哺乳动物和鸟类的设计示例,以及能跑、能飞、宠物类和非宠物类的增加对类数量的影响。 ... [详细]
  • Imtryingtofigureoutawaytogeneratetorrentfilesfromabucket,usingtheAWSSDKforGo.我正 ... [详细]
  • 本文讨论了微软的STL容器类是否线程安全。根据MSDN的回答,STL容器类包括vector、deque、list、queue、stack、priority_queue、valarray、map、hash_map、multimap、hash_multimap、set、hash_set、multiset、hash_multiset、basic_string和bitset。对于单个对象来说,多个线程同时读取是安全的。但如果一个线程正在写入一个对象,那么所有的读写操作都需要进行同步。 ... [详细]
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社区 版权所有