if (smscListener != null) {
System.out.println("Stopping listener...");
synchronized (processors) {
int procCount = processors.count();
TestPDUProcessor proc;
SMSCSession session;
for (int i = 0; i < procCount; i++) {
proc = (TestPDUProcessor) processors.get(i);
session = proc.getSession();
System.out.print("Stopping session ... ");
session.stop();
System.out.println(" stopped.");
}
}
smscListener.stop();
smscListener = null;