Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

oracle.cabo.servlet
Interface PageBroker

All Known Implementing Classes:
AbstractPageBroker

public interface PageBroker

The PageBroker interface is the root interface implemented by a UIX Controller application. An entire application could, conceivably, consist of just a single implementation of this interface, though such an application would scarcely take advantage of any UIX Controller functionality. Most developers will want to subclass one of the default implementations of this interface.


Method Summary
 PageEvent decodeMultipartRequest(BajaContext context, Page page)
          Decode a multipart request into a PageEvent.
 void destroy()
          Destroys the page broker, freeing any state as needed.
 java.lang.Object getService(BajaContext context, java.lang.Class serviceClass, java.lang.Object serviceSelector)
          Returns a object that provides some global service.
 Page handleRequest(BajaContext context, Page page, PageEvent event)
          Process a request for a single page, returning the new page to display.
 void init(javax.servlet.Servlet servlet, javax.servlet.ServletConfig config)
          Initializes the page broker.
 void renderError(BajaContext context, java.lang.Throwable error)
          Renders an error.
 void renderPage(BajaContext context, Page page)
          Renders a page.
 void requestEnded(BajaContext context)
          Callback at the very end of a request.
 void requestStarted(BajaContext context)
          Called at the very beginning of a request.
 

Method Detail

requestStarted

public void requestStarted(BajaContext context)
                    throws javax.servlet.ServletException
Called at the very beginning of a request. Called before any other methods, and before decoding has commenced.
Parameters:
context - the BajaContext

requestEnded

public void requestEnded(BajaContext context)
                  throws javax.servlet.ServletException
Callback at the very end of a request. Called after all other methods and after the page has finished rendering, and called whether or not the request succeeded successfully or terminated with an error or exception.
Parameters:
context - the BajaContext

handleRequest

public Page handleRequest(BajaContext context,
                          Page page,
                          PageEvent event)
                   throws PageEventException
Process a request for a single page, returning the new page to display. This method will be invoked even if there is no event - in which case the event will be null. This allows clients to perform validation or normalization on the page.

Parameters:
context - the BajaContext
page - the page the client is requesting
event - the event on that page, or null if the client is just requesting a page display
Throws:
PageEventException - if the processing of the event fails

decodeMultipartRequest

public PageEvent decodeMultipartRequest(BajaContext context,
                                        Page page)
                                 throws java.io.IOException,
                                        javax.servlet.ServletException
Decode a multipart request into a PageEvent. An implementation can use MultipartFormHandler.

Parameters:
context - the BajaContext
page - the page the client is requesting
Returns:
the PageEvent to be processed in response
See Also:
MultipartFormHandler

renderPage

public void renderPage(BajaContext context,
                       Page page)
                throws java.io.IOException,
                       javax.servlet.ServletException
Renders a page.

Parameters:
context - the BajaContext
page - the page the client is requesting

renderError

public void renderError(BajaContext context,
                        java.lang.Throwable error)
                 throws java.io.IOException,
                        javax.servlet.ServletException
Renders an error.

Parameters:
context - the BajaContext
error - a Throwable

getService

public java.lang.Object getService(BajaContext context,
                                   java.lang.Class serviceClass,
                                   java.lang.Object serviceSelector)
Returns a object that provides some global service. The default implementation of BajaContext.getService() will call this PageBroker method for any services it doesn't serve itself.

Parameters:
context - the BajaContext
serviceClass - a class object that the returned object must be an instance of
serviceSelector - a selector object, if one is needed

init

public void init(javax.servlet.Servlet servlet,
                 javax.servlet.ServletConfig config)
          throws javax.servlet.ServletException
Initializes the page broker.

destroy

public void destroy()
Destroys the page broker, freeing any state as needed.

Oracle UIX API Reference
Release 2.1.22.0.0
B12196-01

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