@Override public void run() { final SessionID sessionID; try { try { sessionID = statefulSessionComponent.createSession(); } catch (Throwable t) { SessionOpenRequestHandler.this.writeException( channelAssociation, SessionOpenRequestHandler.this.marshallerFactory, invocationId, t, null); return; } // get the affinity of the component final Affinity hardAffinity = statefulSessionComponent.getCache().getStrictAffinity(); SessionOpenRequestHandler.this.writeSessionId( channelAssociation, invocationId, sessionID, hardAffinity); } catch (IOException ioe) { EjbLogger.ROOT_LOGGER.exceptionGeneratingSessionId( ioe, invocationId, channelAssociation.getChannel()); // close the channel IoUtils.safeClose(this.channelAssociation.getChannel()); return; } }