Fixed a case where an exception would kill the kernel
adapter thread. Also improved the details of the error logging. git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7255 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
bfd49c43e3
commit
5225599ee2
@ -93,11 +93,11 @@ public class KernelAdapter extends Thread
|
||||
kernel.terminate();
|
||||
}
|
||||
|
||||
protected void reportError( Exception e )
|
||||
protected void reportError( Endpoint p, Object context, Exception e )
|
||||
{
|
||||
// Should really be queued up so the outer thread can
|
||||
// retrieve them. For now we'll just log it. FIXME
|
||||
log.log( Level.SEVERE, "Unhandled error", e );
|
||||
log.log( Level.SEVERE, "Unhandled error, endpoint:" + p + ", context:" + context, e );
|
||||
}
|
||||
|
||||
protected HostedConnection getConnection( Endpoint p )
|
||||
@ -148,7 +148,7 @@ public class KernelAdapter extends Thread
|
||||
}
|
||||
messageDispatcher.messageReceived( source, m );
|
||||
} catch( Exception e ) {
|
||||
reportError(e);
|
||||
reportError(p, m, e);
|
||||
}
|
||||
}
|
||||
|
||||
@ -186,7 +186,7 @@ public class KernelAdapter extends Thread
|
||||
try {
|
||||
createAndDispatch( event );
|
||||
} catch( Exception e ) {
|
||||
reportError(e);
|
||||
reportError(event.getEndpoint(), event, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -209,7 +209,12 @@ public class KernelAdapter extends Thread
|
||||
// when the connection add events come through
|
||||
flushEvents();
|
||||
|
||||
try {
|
||||
createAndDispatch( e );
|
||||
} catch( Exception ex ) {
|
||||
reportError(e.getSource(), e, ex);
|
||||
}
|
||||
|
||||
} catch( InterruptedException ex ) {
|
||||
if( !go.get() )
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user