summaryrefslogtreecommitdiffstats
path: root/common/src/main/java
diff options
context:
space:
mode:
authorseshukm <seshu.kumar.m@huawei.com>2017-09-27 15:50:30 +0530
committerseshukm <seshu.kumar.m@huawei.com>2017-09-27 17:21:10 +0530
commit7c540729009087f9a9d018f4013d631364abfb90 (patch)
treecd77f3f07322929cad2a5b5379c1936530d662f6 /common/src/main/java
parent1d1979633d81c74795c9a11b7849af1b6038ba02 (diff)
Fixed Blocker issues.
IssueId: SO-165 Change-Id: I7c2520af9394ceb600a5a25fa9acfd095d872a1d Signed-off-by: seshukm <seshu.kumar.m@huawei.com>
Diffstat (limited to 'common/src/main/java')
-rw-r--r--common/src/main/java/org/openecomp/mso/yangDecoder/transform/impl/TransformJava2JsonFactory.java19
-rw-r--r--common/src/main/java/org/openecomp/mso/yangDecoder/transform/impl/TransformJava2XMLFactory.java20
2 files changed, 27 insertions, 12 deletions
diff --git a/common/src/main/java/org/openecomp/mso/yangDecoder/transform/impl/TransformJava2JsonFactory.java b/common/src/main/java/org/openecomp/mso/yangDecoder/transform/impl/TransformJava2JsonFactory.java
index 647b3038bb..95e594800a 100644
--- a/common/src/main/java/org/openecomp/mso/yangDecoder/transform/impl/TransformJava2JsonFactory.java
+++ b/common/src/main/java/org/openecomp/mso/yangDecoder/transform/impl/TransformJava2JsonFactory.java
@@ -37,21 +37,28 @@ public class TransformJava2JsonFactory extends TYangJsonXmlBase {
@Override
protected void setupWithDataBroker(final DataBroker dataBroker) {
// Intentionally left No-op, subclasses may customize it
- mappingservice = new BindingToNormalizedNodeCodec(GeneratedClassLoadingStrategy.getTCCLClassLoadingStrategy(),
- new BindingNormalizedNodeCodecRegistry(StreamWriterGenerator.create(JavassistUtils.forClassPool(ClassPool.getDefault()))));
- moduleInfoBackedContext = ModuleInfoBackedContext.create();
+
// moduleInfoBackedContext.registerModuleInfo(BindingReflections.getModuleInfo(SncTunnels.class));
try {
+ mappingservice = new BindingToNormalizedNodeCodec(GeneratedClassLoadingStrategy.getTCCLClassLoadingStrategy(),
+ new BindingNormalizedNodeCodecRegistry(StreamWriterGenerator.create(JavassistUtils.forClassPool(ClassPool.getDefault()))));
+ moduleInfoBackedContext = ModuleInfoBackedContext.create();
+
for (YangModuleInfo yangModuleInfo : getModuleInfos()) {
moduleInfoBackedContext.registerModuleInfo(yangModuleInfo);
}
+ schemaContext = moduleInfoBackedContext.tryToCreateSchemaContext().get();
+ mappingservice.onGlobalContextUpdated(schemaContext);
+ controllerContext.setSchemas(schemaContext);
} catch (Exception e) {
e.printStackTrace();
+ } finally {
+ if(null != mappingservice){
+ mappingservice.close();
+ }
}
- schemaContext = moduleInfoBackedContext.tryToCreateSchemaContext().get();
- mappingservice.onGlobalContextUpdated(schemaContext);
- controllerContext.setSchemas(schemaContext);
+
}
diff --git a/common/src/main/java/org/openecomp/mso/yangDecoder/transform/impl/TransformJava2XMLFactory.java b/common/src/main/java/org/openecomp/mso/yangDecoder/transform/impl/TransformJava2XMLFactory.java
index 5e5511b5e7..ea7adc8a33 100644
--- a/common/src/main/java/org/openecomp/mso/yangDecoder/transform/impl/TransformJava2XMLFactory.java
+++ b/common/src/main/java/org/openecomp/mso/yangDecoder/transform/impl/TransformJava2XMLFactory.java
@@ -37,20 +37,28 @@ public class TransformJava2XMLFactory extends TYangJsonXmlBase {
@Override
protected void setupWithDataBroker(final DataBroker dataBroker) {
// Intentionally left No-op, subclasses may customize it
- mappingservice = new BindingToNormalizedNodeCodec(GeneratedClassLoadingStrategy.getTCCLClassLoadingStrategy(),
- new BindingNormalizedNodeCodecRegistry(StreamWriterGenerator.create(JavassistUtils.forClassPool(ClassPool.getDefault()))));
- moduleInfoBackedContext = ModuleInfoBackedContext.create();
+
// moduleInfoBackedContext.registerModuleInfo(BindingReflections.getModuleInfo(SncTunnels.class));
try {
+ mappingservice = new BindingToNormalizedNodeCodec(GeneratedClassLoadingStrategy.getTCCLClassLoadingStrategy(),
+ new BindingNormalizedNodeCodecRegistry(StreamWriterGenerator.create(JavassistUtils.forClassPool(ClassPool.getDefault()))));
+ moduleInfoBackedContext = ModuleInfoBackedContext.create();
+
for (YangModuleInfo yangModuleInfo : getModuleInfos()) {
moduleInfoBackedContext.registerModuleInfo(yangModuleInfo);
}
+
+ schemaContext = moduleInfoBackedContext.tryToCreateSchemaContext().get();
+ mappingservice.onGlobalContextUpdated(schemaContext);
+ controllerContext.setSchemas(schemaContext);
} catch (Exception e) {
e.printStackTrace();
+ } finally {
+ if(null != mappingservice){
+ mappingservice.close();
+ }
}
- schemaContext = moduleInfoBackedContext.tryToCreateSchemaContext().get();
- mappingservice.onGlobalContextUpdated(schemaContext);
- controllerContext.setSchemas(schemaContext);
+
}