| org.apache.beehive.netui.pageflow.ServletContainerAdapter
All known Subclasses: org.apache.beehive.netui.pageflow.DefaultServletContainerAdapter,
ServletContainerAdapter | public interface ServletContainerAdapter extends Adapter(Code) | | Adapter interface for plugging into various Servlet containers. An implementor of this interface is "discovered" at
runtime. The discovery process is as follows:
-
A list of META-INF/services/org.apache.beehive.netui.pageflow.ServletContainerAdapter resources is obtained
from classpath. This means, for example, that a file called
"org.apache.beehive.netui.pageflow.ServletContainerAdapter" under directory META-INF/services would be
found inside any JAR file on classpath.
-
Inside each of these resources is the name of a class that implements ServletContainerAdapter. This class
is loaded, and its
ServletContainerAdapter.accept accept method is called.
-
If
ServletContainerAdapter.accept accept returns
true , then that implementation class is chosen as the current
adapter; otherwise, the next one in the list is tried.
- If no adapters are discovered, an instance of
DefaultServletContainerAdapter is used.
|
Method Summary | |
public void | beginRequest(HttpServletRequest request, HttpServletResponse response) Called at the beginning of each processed request. | public Object | createControlBeanContext(HttpServletRequest request, HttpServletResponse response) Get a context object to support Beehive Controls.
Parameters: request - the current HttpServletRequest. Parameters: response - the current HttpServletResponse. | boolean | doSecurityRedirect(String path, HttpServletRequest request, HttpServletResponse response) Cause the server to do a security check for the given path. | public void | endRequest(HttpServletRequest request, HttpServletResponse response) Called at the end of each processed request. | public void | ensureFailover(String attrName, Object attrVal, HttpServletRequest request) Ensure that the given session attribute is replicated in a cluster for session failover. | public PageFlowEventReporter | getEventReporter() Get an event reporter, which will be notified of events like "page flow created", "action raised", etc. | public Factory | getFactory(Class classType, String id, FactoryConfig config) Generic method to get a Factory class that may be container dependent. | public String | getFullContextPath(HttpServletRequest request) Return the webapp context path for the given request. | public int | getListenPort(HttpServletRequest request) Get the port on which the server is listening for unsecure connections.
Parameters: request - the current HttpServletRequest. | public String | getPlatformName() Get the name of the platform, which may be used to find platform-specific configuration files. | public int | getSecureListenPort(HttpServletRequest request) Get the port on which the server is listening for secure connections.
Parameters: request - the current HttpServletRequest. | public SecurityProtocol | getSecurityProtocol(String path, HttpServletRequest request) Tell whether a web application resource requires a secure transport protocol. | public boolean | isInProductionMode() Tell whether the server is running in production mode. | public void | login(String username, String password, HttpServletRequest request, HttpServletResponse response) Log in the user, using "weak" username/password authentication. | public void | logout(boolean invalidateSessions, HttpServletRequest request, HttpServletResponse response) Log out the current user.
Parameters: invalidateSessions - if true , the session is invalidated (on all single-signon webapps); otherwise the session and its data are left intact. |
beginRequest | public void beginRequest(HttpServletRequest request, HttpServletResponse response)(Code) | | Called at the beginning of each processed request.
Parameters: request - the current HttpServletRequest. Parameters: response - the current HttpServletResponse. |
createControlBeanContext | public Object createControlBeanContext(HttpServletRequest request, HttpServletResponse response)(Code) | | Get a context object to support Beehive Controls.
Parameters: request - the current HttpServletRequest. Parameters: response - the current HttpServletResponse. a new ControlBeanContext. |
doSecurityRedirect | boolean doSecurityRedirect(String path, HttpServletRequest request, HttpServletResponse response)(Code) | | Cause the server to do a security check for the given path. If required, it does a redirect to
change the scheme (http/https).
Parameters: path - the webapp-relative path on which to run security checks. Parameters: request - the current HttpServletRequest. Parameters: response - the current HttpServletResponse. true if a redirect occurred. |
endRequest | public void endRequest(HttpServletRequest request, HttpServletResponse response)(Code) | | Called at the end of each processed request.
Parameters: request - the current HttpServletRequest. Parameters: response - the current HttpServletResponse. |
ensureFailover | public void ensureFailover(String attrName, Object attrVal, HttpServletRequest request)(Code) | | Ensure that the given session attribute is replicated in a cluster for session failover.
This method does not need to be implemented for servers that do not support clustering and
session failover.
Parameters: attrName - the name of the session attribute for which failover should be ensured. Parameters: attrVal - the value of the given session attribute. Parameters: request - the current HttpServletRequest. |
getEventReporter | public PageFlowEventReporter getEventReporter()(Code) | | Get an event reporter, which will be notified of events like "page flow created", "action raised", etc.
|
getFactory | public Factory getFactory(Class classType, String id, FactoryConfig config)(Code) | | Generic method to get a Factory class that may be container dependent.
This method is called to get the following Factory implementations:
Parameters: classType - the class type that the factory should extend or implement. Parameters: id - can be used for the case where there is more than one possible Factorythat extends or implaments the class type. Parameters: config - a configuration object passed to a Factory a Factory class that extends or implemtents the given class type. |
getFullContextPath | public String getFullContextPath(HttpServletRequest request)(Code) | | Return the webapp context path for the given request. This differs from HttpServletRequest.getContextPath()
only in that it will return a valid value even if the request is for the default webapp.
Parameters: request - the current HttpServletRequest. |
getListenPort | public int getListenPort(HttpServletRequest request)(Code) | | Get the port on which the server is listening for unsecure connections.
Parameters: request - the current HttpServletRequest. the port on which the server is listening for unsecure connections. |
getPlatformName | public String getPlatformName()(Code) | | Get the name of the platform, which may be used to find platform-specific configuration files.
the name of the platform |
getSecureListenPort | public int getSecureListenPort(HttpServletRequest request)(Code) | | Get the port on which the server is listening for secure connections.
Parameters: request - the current HttpServletRequest. the port on which the server is listening for secure connections. |
getSecurityProtocol | public SecurityProtocol getSecurityProtocol(String path, HttpServletRequest request)(Code) | | Tell whether a web application resource requires a secure transport protocol. This is
determined from web.xml; for example, the following block specifies that all resources under
/login require a secure transport protocol.
<security-constraint>
<web-resource-collection>
<web-resource-name>Secure PageFlow - begin</web-resource-name>
<url-pattern>/login/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
Parameters: path - a webapp-relative path for a resource. Parameters: request - the current HttpServletRequest. Boolean.TRUE if a transport-guarantee of CONFIDENTIAL orINTEGRAL is associated with the given resource; Boolean.FALSE a transport-guarantee of NONE is associated with the given resource; ornull if there is no transport-guarantee associated with the given resource. |
isInProductionMode | public boolean isInProductionMode()(Code) | | Tell whether the server is running in production mode.
true if the server is running in production mode. |
login | public void login(String username, String password, HttpServletRequest request, HttpServletResponse response) throws LoginException(Code) | | Log in the user, using "weak" username/password authentication.
Parameters: username - the user's login name. Parameters: password - the user's password. Parameters: request - the current HttpServletRequest. Parameters: response - the current HttpServletResponse. exception: LoginException - if the authentication failed |
logout | public void logout(boolean invalidateSessions, HttpServletRequest request, HttpServletResponse response)(Code) | | Log out the current user.
Parameters: 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 thecurrent webapp, set this parameter to false and call invalidate() on the HttpSession. Parameters: request - the current HttpServletRequest. Parameters: response - the current HttpServletResponse. |
|
|