diff options
Diffstat (limited to 'mdbc-server/src/main/java')
-rwxr-xr-x | mdbc-server/src/main/java/org/onap/music/mdbc/MdbcServer.java | 1 | ||||
-rw-r--r-- | mdbc-server/src/main/java/org/onap/music/mdbc/StateManager.java | 9 |
2 files changed, 10 insertions, 0 deletions
diff --git a/mdbc-server/src/main/java/org/onap/music/mdbc/MdbcServer.java b/mdbc-server/src/main/java/org/onap/music/mdbc/MdbcServer.java index 08f6e1e..1712c30 100755 --- a/mdbc-server/src/main/java/org/onap/music/mdbc/MdbcServer.java +++ b/mdbc-server/src/main/java/org/onap/music/mdbc/MdbcServer.java @@ -103,6 +103,7 @@ public class MdbcServer { public void stop() { if (null != server) { + meta.getStateManager().releaseAllPartitions(); server.stop(); server = null; } diff --git a/mdbc-server/src/main/java/org/onap/music/mdbc/StateManager.java b/mdbc-server/src/main/java/org/onap/music/mdbc/StateManager.java index 8e7976f..430e783 100644 --- a/mdbc-server/src/main/java/org/onap/music/mdbc/StateManager.java +++ b/mdbc-server/src/main/java/org/onap/music/mdbc/StateManager.java @@ -344,4 +344,13 @@ public class StateManager { public OwnershipAndCheckpoint getOwnAndCheck() { return ownAndCheck; } + + /** + * Close all connections for this server, relinquishing any locks/partitions owned by this server + */ + public void releaseAllPartitions() { + for(String connection: this.connectionRanges.keySet()) { + closeConnection(connection); + } + } } |