Add WebSocket support with Jakarta WebSocket integration
- Implemented WebSocketSession abstract class with callback-based API - Added ServletWebSocketSession with full Jakarta WebSocket bridging - Created @WebSocket annotation for declarative endpoint marking - Updated JettyApp to initialize Jakarta WebSocket container - Split Request/Response into abstract base and servlet implementations - Moved JettyApp to jabba.servlet package - Moved annotations to jabba.decor package - Added comprehensive WebSocket test suite (5 tests, all passing) - Updated README.md with WebSocket documentation and examples - All 31 tests passing (async, sync, security, websocket, database) - Fixed spelling errors in README.md
This commit is contained in:
+18
-3
@@ -92,16 +92,31 @@ class Server implements Runnable{
|
||||
info("stopping server");
|
||||
if(driver!=null){
|
||||
driver.interrupt();
|
||||
//driver.join();
|
||||
try{
|
||||
driver.join(5000); // Wait up to 5 seconds for graceful shutdown
|
||||
}catch(InterruptedException e){
|
||||
info("interrupted while waiting for driver to stop");
|
||||
}
|
||||
}
|
||||
// Clean up stale threads using proper interruption
|
||||
for(Thread th:Thread.getAllStackTraces().keySet()){
|
||||
if(th.getName().equalsIgnoreCase("executor")){
|
||||
info("cleaning up stale driver:"+th.toString())
|
||||
th.stop();
|
||||
th.interrupt();
|
||||
try{
|
||||
th.join(2000); // Wait up to 2 seconds
|
||||
}catch(InterruptedException e){
|
||||
// Ignore
|
||||
}
|
||||
}
|
||||
if(th.getName().equalsIgnoreCase("server.driver")){
|
||||
info("cleaning up stale driver:"+th.toString())
|
||||
th.stop();
|
||||
th.interrupt();
|
||||
try{
|
||||
th.join(2000); // Wait up to 2 seconds
|
||||
}catch(InterruptedException e){
|
||||
// Ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
return this;
|
||||
|
||||
Reference in New Issue
Block a user