Permalink
Browse files

Updated notes and normalized destroy() naming convention

  • Loading branch information...
1 parent ab9a318 commit da260f6bfdd1cb630f1dd314142d3de1ff6dd061 @jjlauer jjlauer committed May 5, 2011
@@ -47,16 +47,16 @@
* @throws InterruptedException Thrown if the calling thread is interrupted
* while we are attempting the bind.
*/
- SmppSession bind(SmppSessionConfiguration config, SmppSessionHandler sessionHandler) throws SmppTimeoutException, SmppChannelException, SmppBindException, UnrecoverablePduException, InterruptedException;
+ public SmppSession bind(SmppSessionConfiguration config, SmppSessionHandler sessionHandler) throws SmppTimeoutException, SmppChannelException, SmppBindException, UnrecoverablePduException, InterruptedException;
/**
- * Shutdown a client by ensuring that all session sockets are closed and all
+ * Destroy a client by ensuring that all session sockets are closed and all
* resources are cleaned up. This method should the <b>last</b> method called
* before discarding or losing a reference to a client. Since this method
* cleans up all resources, make sure that any data you need to access is
* accessed <b>before</b> calling this method. After calling this method
* it is not guaranteed that <b>any</b> other method will correctly work.
*/
- void shutdown();
+ public void destroy();
}
@@ -136,7 +136,7 @@ public int getConnectionSize() {
}
@Override
- public void shutdown() {
+ public void destroy() {
// close all channels still open within this session "bootstrap"
this.channels.close().awaitUninterruptibly();
// clean up all external resources
@@ -181,7 +181,7 @@ public Thread newThread(Runnable r) {
// this is required to not causing server to hang from non-daemon threads
// this also makes sure all open Channels are closed to I *think*
logger.info("Shutting down client bootstrap and executors...");
- clientBootstrap.shutdown();
+ clientBootstrap.destroy();
executor.shutdownNow();
monitorExecutor.shutdownNow();
@@ -164,7 +164,7 @@ public Thread newThread(Runnable r) {
// this is required to not causing server to hang from non-daemon threads
// this also makes sure all open Channels are closed to I *think*
logger.info("Shutting down client bootstrap and executors...");
- clientBootstrap.shutdown();
+ clientBootstrap.destroy();
executor.shutdownNow();
monitorExecutor.shutdownNow();
@@ -106,7 +106,7 @@ public void run() {
// this is required to not causing server to hang from non-daemon threads
// this also makes sure all open Channels are closed to I *think*
logger.info("trying to shutdown bootstrap...");
- bootstrap.shutdown();
+ bootstrap.destroy();
System.out.println("Press any key to exit");
@@ -78,7 +78,7 @@ public static void stopSimulator() {
logger.info("Stopping the server inside test class");
server.stop();
logger.info("Stopping the boostrap inside test class");
- bootstrap.shutdown();
+ bootstrap.destroy();
}
public SmppSessionConfiguration createDefaultConfiguration() {

0 comments on commit da260f6

Please sign in to comment.