}
}
SFSBBeanState getSFSBBeanState(SessionContextImpl sc) {
//No need to synchronize
SFSBBeanState sfsbBeanState = null;
try {
if ((containerState != CONTAINER_STARTED) && (containerState != CONTAINER_STOPPED)) {
_logger.log(Level.FINE, "getSFSBBeanState() returning because "
+ "containerState: " + containerState);
return null;
}
if (sc.getState() == DESTROYED) {
return null;
}
Object ejb = sc.getEJB();
ComponentInvocation ci = new ComponentInvocation(ejb, this, sc);
invocationManager.preInvoke(ci);
synchronized (sc) {
try {
interceptorManager.intercept(
CallbackType.PRE_PASSIVATE, sc);
sc.setLastPersistedAt(System.currentTimeMillis());
long newCtxVersion = sc.incrementAndGetVersion();
byte[] serializedState = IOUtils.serializeObject(sc, true);
sfsbBeanState = sfsbStoreManager.createSFSBBeanState(
sc.getInstanceKey(), System.currentTimeMillis(),
!sc.existsInStore(), serializedState);
sfsbBeanState.setVersion(newCtxVersion);
interceptorManager.intercept(
CallbackType.POST_ACTIVATE, sc);
//Do not set sc.setExistsInStore() here
} catch (java.io.NotSerializableException serEx) {
_logger.log(Level.WARNING, "Error during checkpoint ("