public class DefaultOwbFailOverService extends Object implements FailOverService
FailOverService.| Modifier and Type | Field and Description |
|---|---|
static String |
ATTRIBUTE_CONVERSATION_CONTEXT_MAP |
static String |
ATTRIBUTE_SESSION_CONTEXT |
static String |
CONFIG_IS_SUPPORT_FAILOVER |
static String |
CONFIG_IS_SUPPORT_PASSIVATE |
static String |
CONFIG_RESOURCES_SERIALIZATION_HANDLER |
NOT_HANDLED| Constructor and Description |
|---|
DefaultOwbFailOverService() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addActivationListenerToSession(javax.servlet.http.HttpSession session)
Adds the
FailOverSessionActivationListener to the current HttpSession. |
protected void |
addFailOverBagToSession(FailOverBag bag,
javax.servlet.http.HttpSession session)
Store the
FailOverBag as attribute to the current HttpSession. |
void |
enableFailOverSupport(boolean supportFailOver) |
void |
enablePassivationSupport(boolean supportPassivation) |
String |
getJvmId() |
ObjectInputStream |
getObjectInputStream(InputStream in)
Get object input stream.
|
ObjectOutputStream |
getObjectOutputStream(OutputStream out)
Get object output stream.
|
Object |
handleResource(javax.enterprise.inject.spi.Bean<?> bean,
Object resourceObject,
ObjectInput in,
ObjectOutput out)
Except the EJB remote stub, it is hard to handle other types of
resources.
|
boolean |
isPassivation() |
boolean |
isSupportFailOver() |
boolean |
isSupportPassivation() |
protected void |
restoreBeansFromFailOverBag(FailOverBag bag,
javax.servlet.http.HttpSession session)
Restores the session and conversation contexts from the given
FailOverBag. |
void |
sessionDidActivate(javax.servlet.http.HttpSession session) |
void |
sessionIsIdle(javax.servlet.http.HttpSession session) |
void |
sessionIsInUse(javax.servlet.http.HttpSession session) |
void |
sessionWillPassivate(javax.servlet.http.HttpSession session) |
protected void |
storeBeansInFailOverBag(FailOverBag bag,
javax.servlet.http.HttpSession session)
Stores the session and conversation contexts in the
FailOverBag. |
public static final String CONFIG_IS_SUPPORT_FAILOVER
public static final String CONFIG_IS_SUPPORT_PASSIVATE
public static final String CONFIG_RESOURCES_SERIALIZATION_HANDLER
public static final String ATTRIBUTE_SESSION_CONTEXT
public static final String ATTRIBUTE_CONVERSATION_CONTEXT_MAP
public void sessionIsIdle(javax.servlet.http.HttpSession session)
sessionIsIdle in interface FailOverServicepublic void sessionIsInUse(javax.servlet.http.HttpSession session)
sessionIsInUse in interface FailOverServicepublic void sessionDidActivate(javax.servlet.http.HttpSession session)
sessionDidActivate in interface FailOverServicepublic void sessionWillPassivate(javax.servlet.http.HttpSession session)
sessionWillPassivate in interface FailOverServiceprotected void addActivationListenerToSession(javax.servlet.http.HttpSession session)
FailOverSessionActivationListener to the current HttpSession.
It must not be manually registered when we store it as session attribute.session - The current HttpSession.protected void addFailOverBagToSession(FailOverBag bag, javax.servlet.http.HttpSession session)
FailOverBag as attribute to the current HttpSession.
So when the session is fail over to other JVM or local disk, the
attribute could also be serialized.bag - The FailOverBag.session - The current HttpSession.protected void storeBeansInFailOverBag(FailOverBag bag, javax.servlet.http.HttpSession session)
FailOverBag.bag - The FailOverBag.session - The current HttpSession.protected void restoreBeansFromFailOverBag(FailOverBag bag, javax.servlet.http.HttpSession session)
FailOverBag.bag - The FailOverBag.session - The current HttpSession.public Object handleResource(javax.enterprise.inject.spi.Bean<?> bean, Object resourceObject, ObjectInput in, ObjectOutput out)
handleResource in interface FailOverServicepublic ObjectInputStream getObjectInputStream(InputStream in) throws IOException
getObjectInputStream in interface FailOverServiceIOExceptionpublic ObjectOutputStream getObjectOutputStream(OutputStream out) throws IOException
getObjectOutputStream in interface FailOverServiceIOExceptionpublic String getJvmId()
getJvmId in interface FailOverServicepublic boolean isSupportFailOver()
isSupportFailOver in interface FailOverServicepublic void enableFailOverSupport(boolean supportFailOver)
enableFailOverSupport in interface FailOverServicepublic boolean isSupportPassivation()
isSupportPassivation in interface FailOverServicepublic void enablePassivationSupport(boolean supportPassivation)
enablePassivationSupport in interface FailOverServicepublic boolean isPassivation()
Copyright © 2008-2013 The Apache Software Foundation. All Rights Reserved.