|
Oracle™ Business Intelligence Beans Java API Reference | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--oracle.dss.thin.servlet.ServletRequestHandler
ServletRequestHandler is an implementation of a simple servlet controller for ThinBeans. In order to use the ServletRequestHandler, an servlet would create a ServletRequestHandler and place it on its HttpSession. ThinBeans that exist across requests ( are stored in the HttpSession ) should also be registered with the ServletRequestHandler. When a request reaches the servlet, the servlet should make sure that all of the ThinBeans that are needed for the request have been created and registered with the ServletRequestHandler and then call the handleRequest() method on its ServletRequestHandler, which will perform the following tasks on the ThinBeans registered with the ServletRequestHandler:
If an application needs to set state and process events at different times an application can call setState() and handleEvent(), which is equivalent to calling handleRequest(). If an application wants to customize state or event handling, they can either implement their own controller or they can subclass the ServletRequestHandler and implement their own setState(), handleEvent(), and getState() methods.
If the servlet wants to place the state of the registered ThinBeans onto subsequent events then it needs to call getStateStrings() add the list of state strings as hidden form fields on the HTML form that contains the ThinBean.
Constructor Summary | |
ServletRequestHandler() Default Constructor |
Method Summary | |
java.util.Locale |
getLocale() Retrieves the Locale that the ThinBeanUI s uses. |
java.util.Dictionary |
getState(oracle.cabo.share.url.URLEncoder encoder) Retrieves a dictionary of state strings, which can be placed onto URLs for subsequent events by adding hidden forms to the form(s) that contain ThinBeans. |
ThinBean |
getThinBean(java.lang.String thinBeanName) Returns a registered ThinBean by name |
java.util.Enumeration |
getThinBeanNames() Retrieves an Enumeration of the names, as Strings, of ThinBeans registered with this instance of the ServletRequestHandler. |
int |
handleEvent(QueryParameterProvider provider) Routes the current event to the correct ThinBean. |
int |
handleRequest(QueryParameterProvider provider) Handles the request by setting state on registered ThinBeans and then routing the current event to the correct ThinBean. |
int |
handleRequest(QueryParameterProvider provider, oracle.cabo.servlet.state.State[] states) Handles the request by setting state on registered ThinBeans and then routing the current event to the correct ThinBean. |
void |
registerThinBean(ThinBean bean) Registers a ThinBean with the RequestHandler. |
void |
registerThinBean(ThinBeanUI bean) Registers a ThinBeanUI with the RequestHandler. |
void |
setLocale(java.util.Locale locale) Specifies the Locale for all of the ThinBeanUI s. |
void |
setState(QueryParameterProvider provider) Sets state on registered ThinBeans |
void |
setState(oracle.cabo.servlet.state.State state) Sets state on registered ThinBeans that is stored in a oracle.cabo.servlet.state.State object instead of on the URL. |
boolean |
unregisterThinBean(ThinBean bean) Unregisters a ThinBean with the RequestHandler. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ServletRequestHandler()
Method Detail |
public int handleRequest(QueryParameterProvider provider) throws ThinException
provider
- the QueryParameterProvider for the current requestpublic int handleRequest(QueryParameterProvider provider, oracle.cabo.servlet.state.State[] states) throws ThinException
provider
- the QueryParameterProvider for the current requeststates
- an array of State objects that contain ThinBean state.public void setState(QueryParameterProvider provider) throws ThinException
provider
- the QueryParameterProvider for the current requestpublic void setState(oracle.cabo.servlet.state.State state) throws ThinException
oracle.cabo.servlet.state.State
object instead of on the URL. ThinBean state can be placed into a state object and the state object's id should be placed onto the URL. The state is fetched from its oracle.cabo.servlet.state.StateManager
by id. This method assumes that the names of the state properties coorespond to the names of registered ThinBeans.
If ThinBean state is contained by in the URL and in the State object, then this method should be called in addition to setState(QueryParameterProvider).
If an application has stored ThinBean state in multiple State object, then this method can be called multiple times.
state
- a State instanceThinException
- public int handleEvent(QueryParameterProvider provider) throws ThinException
provider
- the QueryParameterProvider for the current requestpublic java.util.Dictionary getState(oracle.cabo.share.url.URLEncoder encoder)
encoder
- the URLEncoder to use when determining parameter namespublic void setLocale(java.util.Locale locale)
Locale
for all of the ThinBeanUI
s.locale
- The Locale
for this ThinBeanUI
.public java.util.Locale getLocale()
Locale
that the ThinBeanUI
s uses.Locale
for the ThinBeanUI
s.public void registerThinBean(ThinBean bean)
bean
- the ThinBean being registered.public void registerThinBean(ThinBeanUI bean)
bean
- the ThinBeanUI being registered.public boolean unregisterThinBean(ThinBean bean)
bean
- the ThinBean being unregistered.public ThinBean getThinBean(java.lang.String thinBeanName)
thinBeanName
- the name of the registered ThinBeanpublic java.util.Enumeration getThinBeanNames()
|
Oracle™ Business Intelligence Beans Java API Reference | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |