本文整理了Java中javolution.xml.XMLObjectReader.close()
方法的一些代码示例,展示了XMLObjectReader.close()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLObjectReader.close()
方法的具体详情如下:
包路径:javolution.xml.XMLObjectReader
类名称: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("
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("
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
RemoteSignalingPointCodeMap
ConcernedSignalingPointCodeMap
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
RemoteSignalingPointCodeMap
ConcernedSignalingPointCodeMap
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
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
Mtp3ServiceAccessPoint sap = e.getValue();
((Mtp3ServiceAccessPointImpl)sap).setStackName(name);
}
reader.close();
}
}