}
}
SimpleMetadata getSFSBBeanState(SessionContextImpl sc) {
//No need to synchronize
SimpleMetadata simpleMetadata = null;
try {
if ((containerState != CONTAINER_STARTED) && (containerState != CONTAINER_STOPPED)) {
_logger.log(Level.FINE, "getSFSBBeanState() returning because "
+ "containerState: " + containerState);
return null;
}
if (sc.getState() == BeanState.DESTROYED) {
return null;
}
Object ejb = sc.getEJB();
EjbInvocation ejbInv = createEjbInvocation(ejb, sc);
invocationManager.preInvoke(ejbInv);
boolean needToDoPostInvokeTx = false;
boolean destroyBean = false;
synchronized (sc) {
try {
needToDoPostInvokeTx = callLifecycleCallbackInTxIfUsed(ejbInv, sc,
prePassivateInvInfo, CallbackType.PRE_PASSIVATE);
sc.setLastPersistedAt(System.currentTimeMillis());
long newCtxVersion = sc.incrementAndGetVersion();
byte[] serializedState = EjbContainerUtilImpl.getInstance().getJavaEEIOUtils().serializeObject(sc, true);
simpleMetadata = new SimpleMetadata(sc.getVersion(),
System.currentTimeMillis(),
removalGracePeriodInSeconds*1000L, serializedState);
simpleMetadata.setVersion(newCtxVersion);
needToDoPostInvokeTx = callLifecycleCallbackInTxIfUsed(ejbInv, sc,
postActivateInvInfo, CallbackType.POST_ACTIVATE);
//Do not set sc.setExistsInStore() here
} catch (java.io.NotSerializableException serEx) {
_logger.log(Level.WARNING, "Error during checkpoint ("