Hi Asha,
I posted a reply to this earlier but it hasn't appeared, if you see two replies from me on this then its due to a delay somewhere along the line.
From what I can see you have 2 choices;
1) Does openSession return a value? If yes,
test the return value and exit from your run method, thereby exiting the thread.
2) if 1) isn't possible then have openSession throw an exception. Catch the exception in your run method below and return from run(). For info, openSession sounds like it catches the CORBA exception but does nothing with it. Maybe rethrow the exception and catch it in the method below.
For info, 2) is probably the option you need here.
public void run() {
try {
// some code for getting the corba object
obj_ref.openSession(user, password); // This is where i am getting org.omg.CORBA.COMM_FAILURE
pingT = new pingTask(sessionRef, Thread.currentThread());
timer.schedule(pingT, 10000, 3*1000);
} catch (InterruptedException e){
log.warn( "Interrupted explicitly ..", e);
} catch (CORBAException ce)
{
logg.error ("CORBA connection problem: " + ce.ToString());
return;
} catch (Exception e){
log.error("Exception in run method", e);//
} finally {
timer.cancel();
// Some code here for cleanup
}
}