Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

oracle.cabo.servlet
Class BaseBajaContext

java.lang.Object
  |
  +--oracle.cabo.servlet.BaseBajaContext
All Implemented Interfaces:
BajaContext
Direct Known Subclasses:
JspBajaContext

public class BaseBajaContext
extends java.lang.Object
implements BajaContext

Base implementation of BajaContext.

=-=AEW Add lots of setters? Clients shouldn't have to subclass.


Constructor Summary
BaseBajaContext(javax.servlet.Servlet servlet, PageBroker broker, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Creates a BaseBajaContext.
 
Method Summary
protected  ErrorLog createErrorLog(javax.servlet.Servlet servlet)
          Hook for creating error logs.
protected  StateManager createStateManager()
          Hook for creating StateManagers.
protected  void defaultPageEncoders()
          Default the encoder and decoder, choosing the correct ones depending on the request.
protected  LocaleContext deriveLocaleContext()
          Returns the LocaleContext for this context.
 void dispose()
          Frees any state stored on the BajaContext.
 Agent getAgent()
          Returns an Agent object that can be used to identify what device will be receiving the output.
 ErrorLog getErrorLog()
          Get an interface that can be used to log errors.
 LocaleContext getLocaleContext()
          Returns the client locale.
 PageDecoder getPageDecoder()
          Return the decoder used to transform URLs into Pages and PageEvents.
 PageEncoder getPageEncoder()
          Return the encoder used to transform Pages and PageEvents into URLs.
 java.lang.Object getProperty(java.lang.String namespace, java.lang.Object key)
          Gets a property stored on the context.
 java.lang.Object getService(java.lang.Class serviceClass, java.lang.Object serviceSelector)
          Returns a object registered on the context.
 javax.servlet.http.HttpServletRequest getServletRequest()
          Returns the servlet request object.
 javax.servlet.http.HttpServletResponse getServletResponse()
          Returns the servlet response object.
 StateManager getStateManager(boolean createIfNull)
          Returns a QueueStateManager used to create States for Pages.
 void setErrorLog(ErrorLog log)
          Sets an interface that will be used to log errors.
 void setLocaleContext(LocaleContext localeContext)
          Overrides the default client locale.
 void setPageDecoder(PageDecoder decoder)
          Sets the decoder used to transform URLs into Pages and PageEvents.
 void setPageEncoder(PageEncoder encoder)
          Sets the encoder used to transform Pages and PageEvents into URLs.
 void setProperty(java.lang.String namespace, java.lang.Object key, java.lang.Object value)
          Stores a property on the context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseBajaContext

public BaseBajaContext(javax.servlet.Servlet servlet,
                       PageBroker broker,
                       javax.servlet.http.HttpServletRequest request,
                       javax.servlet.http.HttpServletResponse response)
Creates a BaseBajaContext.
Method Detail

getServletRequest

public javax.servlet.http.HttpServletRequest getServletRequest()
Returns the servlet request object.
Specified by:
getServletRequest in interface BajaContext

getServletResponse

public javax.servlet.http.HttpServletResponse getServletResponse()
Returns the servlet response object.
Specified by:
getServletResponse in interface BajaContext

getLocaleContext

public LocaleContext getLocaleContext()
Returns the client locale.
Specified by:
getLocaleContext in interface BajaContext

setLocaleContext

public void setLocaleContext(LocaleContext localeContext)
Overrides the default client locale.
Specified by:
setLocaleContext in interface BajaContext

getErrorLog

public ErrorLog getErrorLog()
Get an interface that can be used to log errors.
Specified by:
getErrorLog in interface BajaContext

setErrorLog

public void setErrorLog(ErrorLog log)
Sets an interface that will be used to log errors.

getAgent

public Agent getAgent()
Returns an Agent object that can be used to identify what device will be receiving the output.
Specified by:
getAgent in interface BajaContext

getPageEncoder

public PageEncoder getPageEncoder()
Return the encoder used to transform Pages and PageEvents into URLs.
Specified by:
getPageEncoder in interface BajaContext

getPageDecoder

public PageDecoder getPageDecoder()
Return the decoder used to transform URLs into Pages and PageEvents.
Specified by:
getPageDecoder in interface BajaContext

getStateManager

public StateManager getStateManager(boolean createIfNull)
Returns a QueueStateManager used to create States for Pages. The StateManager will be stored on the HttpSession.

Specified by:
getStateManager in interface BajaContext
Parameters:
createIfNull - if true, will create a StateManager if one is not available or has expired.
See Also:
QueueStateManager

setPageEncoder

public void setPageEncoder(PageEncoder encoder)
Sets the encoder used to transform Pages and PageEvents into URLs.

setPageDecoder

public void setPageDecoder(PageDecoder decoder)
Sets the decoder used to transform URLs into Pages and PageEvents.

getProperty

public java.lang.Object getProperty(java.lang.String namespace,
                                    java.lang.Object key)
Gets a property stored on the context.
Specified by:
getProperty in interface BajaContext

setProperty

public void setProperty(java.lang.String namespace,
                        java.lang.Object key,
                        java.lang.Object value)
Stores a property on the context. Since BajaContexts are not persistent, state stored on a BajaContext will not be present in subsequent requests.

This method supports objects that implement the Bindable interface. Any such objects will automatically have bindValue() and unbindValue() called when added to and removed from the context.

Specified by:
setProperty in interface BajaContext
Following copied from interface: oracle.cabo.servlet.BajaContext
See Also:
Bindable

getService

public java.lang.Object getService(java.lang.Class serviceClass,
                                   java.lang.Object serviceSelector)
Returns a object registered on the context. This implementation of BajaContext allows retrieval of the ServletContext, ServletConfig, Servlet, and PageBroker objects, as well as any objects supported by the PageBroker's getService() method.

Specified by:
getService in interface BajaContext
Parameters:
serviceClass - a class object that the returned object must be an instance of
serviceSelector - a selector object, if one is needed

dispose

public void dispose()
Frees any state stored on the BajaContext. Specifically, any properties that have been set that implement the Bindable interface will have unbindValue() called, then be removed from the context. This method is automatically called by PageBrokerHandler.

Specified by:
dispose in interface BajaContext
See Also:
BajaContext.setProperty(java.lang.String, java.lang.Object, java.lang.Object), Bindable

deriveLocaleContext

protected LocaleContext deriveLocaleContext()
Returns the LocaleContext for this context. Called once, the first time getLocaleContext() is called.

defaultPageEncoders

protected void defaultPageEncoders()
Default the encoder and decoder, choosing the correct ones depending on the request. Override to default differently (or just explicitly set the encoder and decoder).

createStateManager

protected StateManager createStateManager()
Hook for creating StateManagers. The default implementation creates a default-length QueueStateManager.

createErrorLog

protected ErrorLog createErrorLog(javax.servlet.Servlet servlet)
Hook for creating error logs. The default implementation will log to the servlet error log; in debug builds, it will also log to the console.

Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

Copyright © 2002,2003, Oracle. All Rights Reserved.