|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectDefaultServletContainerAdapter
public abstract class DefaultServletContainerAdapter
Default implementation of a Servlet container adapter.
Constructor Summary | |
---|---|
protected |
DefaultServletContainerAdapter()
|
Method Summary | |
---|---|
void |
beginRequest(HttpServletRequest request,
HttpServletResponse response)
Called at the beginning of each processed request. |
Object |
createControlBeanContext(HttpServletRequest request,
HttpServletResponse response)
Get a context object to support Beehive Controls. |
protected PageFlowEventReporter |
createEventReporter()
|
boolean |
doSecurityRedirect(String path,
HttpServletRequest request,
HttpServletResponse response)
Cause the server to do a security check for the given path. |
void |
endRequest(HttpServletRequest request,
HttpServletResponse response)
Called at the end of each processed request. |
void |
ensureFailover(String attrName,
Object attrVal,
HttpServletRequest request)
Ensure that the given session attribute is replicated in a cluster for session failover. |
PageFlowEventReporter |
getEventReporter()
Get an event reporter, which will be notified of events like "page flow created", "action raised", etc. |
Factory |
getFactory(Class factoryType,
String id,
FactoryConfig config)
Generic method to get a Factory class that may be container dependent. |
String |
getFullContextPath(HttpServletRequest request)
Return the webapp context path for the given request. |
int |
getListenPort(HttpServletRequest request)
Get the port on which the server is listening for unsecure connections. |
String |
getPlatformName()
Get the name of the platform, which may be used to find platform-specific configuration files. |
int |
getSecureListenPort(HttpServletRequest request)
Get the port on which the server is listening for secure connections. |
SecurityProtocol |
getSecurityProtocol(String path,
HttpServletRequest request)
Tell whether a web application resource requires a secure transport protocol. |
protected ServletContext |
getServletContext()
Get the current ServletContext. |
boolean |
isInProductionMode()
Tell whether the system is in production mode. |
void |
login(String username,
String password,
HttpServletRequest request,
HttpServletResponse response)
Log in the user, using "weak" username/password authentication. |
void |
logout(boolean invalidateSessions,
HttpServletRequest request,
HttpServletResponse response)
Log out the user. |
void |
setContext(AdapterContext context)
Set the AdapterContext. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface Adapter |
---|
accept |
Constructor Detail |
---|
protected DefaultServletContainerAdapter()
Method Detail |
---|
public boolean isInProductionMode()
isInProductionMode
in interface ServletContainerAdapter
true
if the system property "beehive.productionmode" is set to "true", or if asserts are
disabled for this class in the case where the system property has no value; false
if the
system property is set to "false", or if asserts are enabled for this class in the case where the
system property has no value.public SecurityProtocol getSecurityProtocol(String path, HttpServletRequest request)
SecurityProtocol.UNSPECIFIED
for all paths.
getSecurityProtocol
in interface ServletContainerAdapter
path
- a webapp-relative path for a resource.request
- the current HttpServletRequest.
SecurityProtocol.UNSPECIFIED
.public boolean doSecurityRedirect(String path, HttpServletRequest request, HttpServletResponse response)
doSecurityRedirect
in interface ServletContainerAdapter
path
- the webapp-relative path on which to run security checks.request
- the current HttpServletRequest.response
- the current HttpServletResponse.
false
public int getListenPort(HttpServletRequest request)
-1
.
getListenPort
in interface ServletContainerAdapter
request
- the current HttpServletRequest.
-1
.public int getSecureListenPort(HttpServletRequest request)
-1
.
getSecureListenPort
in interface ServletContainerAdapter
request
- the current HttpServletRequest.
-1
.public void login(String username, String password, HttpServletRequest request, HttpServletResponse response) throws LoginException
UnsupportedOperationException
.
login
in interface ServletContainerAdapter
username
- the user's login name.password
- the user's password.request
- the current HttpServletRequest.response
- the current HttpServletResponse.
UnsupportedOperationException
- in all cases.
LoginException
- if the authentication failedpublic void logout(boolean invalidateSessions, HttpServletRequest request, HttpServletResponse response)
UnsupportedOperationException
.
logout
in interface ServletContainerAdapter
invalidateSessions
- if true
, the session is invalidated (on all single-signon webapps);
otherwise the session and its data are left intact. To invalidate the session in only the
current webapp, set this parameter to false
and call invalidate() on the HttpSession.request
- the current HttpServletRequest.response
- the current HttpServletResponse.
UnsupportedOperationException
- in all cases.public String getFullContextPath(HttpServletRequest request)
getContextPath()
on the request.
getFullContextPath
in interface ServletContainerAdapter
request
- the current HttpServletRequest.
getContextPath()
on the current request.public void ensureFailover(String attrName, Object attrVal, HttpServletRequest request)
ensureFailover
in interface ServletContainerAdapter
attrName
- the name of the session attribute for which failover should be ensured.attrVal
- the value of the given session attribute.request
- the current HttpServletRequest.public void beginRequest(HttpServletRequest request, HttpServletResponse response)
beginRequest
in interface ServletContainerAdapter
request
- the current HttpServletRequest.response
- the current HttpServletResponse.public void endRequest(HttpServletRequest request, HttpServletResponse response)
endRequest
in interface ServletContainerAdapter
request
- the current HttpServletRequest.response
- the current HttpServletResponse.public Object createControlBeanContext(HttpServletRequest request, HttpServletResponse response)
PageFlowBeanContext
.
createControlBeanContext
in interface ServletContainerAdapter
request
- the current HttpServletRequest.response
- the current HttpServletResponse.
protected ServletContext getServletContext()
public void setContext(AdapterContext context)
setContext
in interface Adapter
context
- the AdapterContext to set.public String getPlatformName()
getPlatformName
in interface ServletContainerAdapter
public PageFlowEventReporter getEventReporter()
DefaultPageFlowEventReporter
.
getEventReporter
in interface ServletContainerAdapter
PageFlowEventReporter
.protected PageFlowEventReporter createEventReporter()
public Factory getFactory(Class factoryType, String id, FactoryConfig config)
This method is called to get the following Factory implementations:
getFactory
in interface ServletContainerAdapter
factoryType
- the class type that the factory should extend or implementid
- can be used for the case where there is more than one possible Factory
that extends or implaments the class type.config
- a configuration object passed to a Factory
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |