From: Tony Tkacik Date: Fri, 23 May 2014 13:56:42 +0000 (+0000) Subject: Merge "BUG-509: create data tree SPI package" X-Git-Tag: autorelease-tag-v20140601202136_82eb3f9~33 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=06ac04f630e8988701088c829e1b7904b2137d61;hp=581592c46b0afa911f738b32b5ca33148c1e77bd Merge "BUG-509: create data tree SPI package" --- diff --git a/opendaylight/commons/opendaylight/pom.xml b/opendaylight/commons/opendaylight/pom.xml index 89fd22d5a2..e1e3164f71 100644 --- a/opendaylight/commons/opendaylight/pom.xml +++ b/opendaylight/commons/opendaylight/pom.xml @@ -17,8 +17,8 @@ 1.0.0 0.4.2-SNAPSHOT - 1.1.0 + 0.5.2-SNAPSHOT 4.1 @@ -78,6 +78,7 @@ 0.4.2-SNAPSHOT 0.4.2-SNAPSHOT 2010.09.24.4-SNAPSHOT + 2013.10.19.1-SNAPSHOT 2013.10.21.2-SNAPSHOT 2010.09.24.4-SNAPSHOT 2.3.2 @@ -1470,6 +1471,11 @@ ietf-inet-types ${ietf-inet-types.version} + + org.opendaylight.yangtools.model + ietf-restconf + ${ietf-restconf.version} + org.opendaylight.yangtools.model ietf-topology @@ -1485,6 +1491,11 @@ ietf-yang-types ${ietf-yang-types.version} + + org.opendaylight.yangtools.model + ietf-yang-types-20130715 + 2013.07.15.1-SNAPSHOT + org.opendaylight.yangtools.model opendaylight-l2-types diff --git a/opendaylight/distribution/opendaylight/pom.xml b/opendaylight/distribution/opendaylight/pom.xml index 48e661f196..52aa6d276b 100644 --- a/opendaylight/distribution/opendaylight/pom.xml +++ b/opendaylight/distribution/opendaylight/pom.xml @@ -1187,6 +1187,10 @@ org.opendaylight.yangtools.model ietf-inet-types + + org.opendaylight.yangtools.model + ietf-restconf + org.opendaylight.yangtools.model ietf-topology @@ -1195,6 +1199,10 @@ org.opendaylight.yangtools.model ietf-yang-types + + org.opendaylight.yangtools.model + ietf-yang-types-20130715 + org.opendaylight.yangtools.model opendaylight-l2-types diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/config/yang/md/sal/binding/impl/RuntimeMappingModule.java b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/config/yang/md/sal/binding/impl/RuntimeMappingModule.java index 750defc0e9..0f0ce0dc9d 100644 --- a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/config/yang/md/sal/binding/impl/RuntimeMappingModule.java +++ b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/config/yang/md/sal/binding/impl/RuntimeMappingModule.java @@ -26,6 +26,8 @@ import org.opendaylight.yangtools.yang.data.impl.codec.DeserializationException; import org.opendaylight.yangtools.yang.model.api.SchemaServiceListener; import org.osgi.framework.BundleContext; import org.osgi.framework.ServiceReference; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import com.google.common.base.Optional; import com.google.common.base.Preconditions; @@ -36,6 +38,8 @@ import com.google.common.base.Preconditions; public final class RuntimeMappingModule extends org.opendaylight.controller.config.yang.md.sal.binding.impl.AbstractRuntimeMappingModule { + private static final Logger LOG = LoggerFactory.getLogger(RuntimeMappingModule.class); + private BundleContext bundleContext; public RuntimeMappingModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, @@ -163,10 +167,17 @@ public final class RuntimeMappingModule extends } @Override - public void close() throws Exception { + public void close() { if(delegate != null) { delegate = null; - bundleContext.ungetService(reference); + + try { + bundleContext.ungetService(reference); + } catch (IllegalStateException e) { + // Indicates the BundleContext is no longer valid which can happen normally on shutdown. + LOG.debug( "Error unregistering service", e ); + } + bundleContext= null; reference = null; } diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/config/yang/md/sal/dom/impl/SchemaServiceImplSingletonModule.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/config/yang/md/sal/dom/impl/SchemaServiceImplSingletonModule.java index ba7414d42e..93284c98e1 100644 --- a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/config/yang/md/sal/dom/impl/SchemaServiceImplSingletonModule.java +++ b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/config/yang/md/sal/dom/impl/SchemaServiceImplSingletonModule.java @@ -16,6 +16,8 @@ import org.opendaylight.yangtools.yang.model.api.SchemaContext; import org.opendaylight.yangtools.yang.model.api.SchemaServiceListener; import org.osgi.framework.BundleContext; import org.osgi.framework.ServiceReference; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * @@ -23,6 +25,8 @@ import org.osgi.framework.ServiceReference; public final class SchemaServiceImplSingletonModule extends org.opendaylight.controller.config.yang.md.sal.dom.impl.AbstractSchemaServiceImplSingletonModule { + private static final Logger LOG = LoggerFactory.getLogger(SchemaServiceImplSingletonModule.class); + BundleContext bundleContext; public SchemaServiceImplSingletonModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, @@ -83,28 +87,41 @@ public final class SchemaServiceImplSingletonModule extends public void close() throws Exception { if (delegate != null) { delegate = null; - bundleContext.ungetService(reference); + + try { + bundleContext.ungetService(reference); + } catch (IllegalStateException e) { + // Indicates the service was already unregistered which can happen normally + // on shutdown. + LOG.debug( "Error unregistering service", e ); + } + reference = null; bundleContext = null; } } + @Override public void addModule(Module arg0) { delegate.addModule(arg0); } + @Override public SchemaContext getGlobalContext() { return delegate.getGlobalContext(); } + @Override public SchemaContext getSessionContext() { return delegate.getSessionContext(); } + @Override public ListenerRegistration registerSchemaServiceListener(SchemaServiceListener arg0) { return delegate.registerSchemaServiceListener(arg0); } + @Override public void removeModule(Module arg0) { delegate.removeModule(arg0); } diff --git a/opendaylight/md-sal/sal-rest-connector/pom.xml b/opendaylight/md-sal/sal-rest-connector/pom.xml index c17a4b70cc..e4c7c0c647 100644 --- a/opendaylight/md-sal/sal-rest-connector/pom.xml +++ b/opendaylight/md-sal/sal-rest-connector/pom.xml @@ -47,6 +47,14 @@ org.opendaylight.yangtools yang-parser-impl + + org.opendaylight.yangtools.model + ietf-restconf + + + org.opendaylight.yangtools.model + ietf-yang-types-20130715 + org.slf4j slf4j-api diff --git a/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/impl/RestconfProvider.java b/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/impl/RestconfProvider.java index 1870bdf0bf..2abd4b6a3a 100644 --- a/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/impl/RestconfProvider.java +++ b/opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/rest/impl/RestconfProvider.java @@ -34,7 +34,6 @@ public class RestconfProvider implements BundleActivator, Provider, ServiceTrack private ListenerRegistration listenerRegistration; private ServiceTracker brokerServiceTrancker; private BundleContext bundleContext; - private ProviderSession session; private Thread webSocketServerThread; @Override @@ -70,7 +69,6 @@ public class RestconfProvider implements BundleActivator, Provider, ServiceTrack } } webSocketServerThread.interrupt(); - session.close(); brokerServiceTrancker.close(); } diff --git a/opendaylight/netconf/netconf-ssh/src/main/java/org/opendaylight/controller/netconf/ssh/NetconfSSHServer.java b/opendaylight/netconf/netconf-ssh/src/main/java/org/opendaylight/controller/netconf/ssh/NetconfSSHServer.java index ff950e95e9..c6974d4982 100644 --- a/opendaylight/netconf/netconf-ssh/src/main/java/org/opendaylight/controller/netconf/ssh/NetconfSSHServer.java +++ b/opendaylight/netconf/netconf-ssh/src/main/java/org/opendaylight/controller/netconf/ssh/NetconfSSHServer.java @@ -27,7 +27,7 @@ public final class NetconfSSHServer implements Runnable { private static final AtomicLong sesssionId = new AtomicLong(); private final InetSocketAddress clientAddress; private final AuthProvider authProvider; - private boolean up = false; + private volatile boolean up = false; private NetconfSSHServer(int serverPort,InetSocketAddress clientAddress, AuthProvider authProvider) throws IllegalStateException, IOException { @@ -68,9 +68,17 @@ public final class NetconfSSHServer implements Runnable { while (up) { logger.trace("Starting new socket thread."); try { - SocketThread.start(ss.accept(), clientAddress, sesssionId.incrementAndGet(), authProvider); - } catch (IOException e) { - logger.error("Exception occurred during socket thread initialization {}", e); + SocketThread.start(ss.accept(), clientAddress, sesssionId.incrementAndGet(), authProvider); + } + catch (IOException e) { + if( up ) { + logger.error("Exception occurred during socket thread initialization", e); + } + else { + // We're shutting down so an exception is expected as the socket's been closed. + // Log to debug. + logger.debug("Shutting down - got expected exception: " + e); + } } } }