|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--javax.servlet.GenericServlet
|
+--javax.servlet.http.HttpServlet
|
+--oracle.portal.provider.v1.http.HttpProvider
HttpProvider is the entry point into the JPDK runtime. It is a servlet. It hides the details of HTTP communication from the provider/portlet implementor. It is responsible for unmarshalling the HTTP provider request and mapping that request to the Provider interfaces. Likewise, it takes the results of these calls and marshals them into the Http response.
Each HttpProvider instance (servlet) represents a single Provider. The particular provider the HttpProvider servlet represents is registered in one of two ways. Most commonly, the Provider is registered declaratively, in the provider descriptor file called provider.xml. The HttpProvider servlet locates its descriptor file from a serlvet initArgs. The initArg is called provider_root. Its value defines the provider's root or home directory. The HttpProvider locates the provider.xml in this directory.
Note: when using this method, be sure to configure the HttpProvider servlet using servlet aliasing. This allows distinct configurations (and therefore providers) to run in the same server.
Alternatively, one can subclass the HttpProvider servlet to register the
Provider class. In this case, the subclass should implement a single
(overridden) method getProviderClass. This method returns the
class implementing the provider this servlet represents.
Though the HttpProvider servlet represents a single provider (class), the servlet maintains distinct provider instances. One instance is maintained per portal. That is if your web provider is registered in two portals, the HttpProvider servlet will maintain a provider instance for each portal. Provider instances have the same duration as the HttpProvider servlet. That is, once instantiated the instance is maintained (and reused) by the HttpProvider until it itself is destroyed.
As this servlet is designed to be communicated to via the Portal, duplicating these requests in a browser to determine if the serlvet/provider is properly configured and running is difficult. To address this the HttpProvider supports a test mode. If you send a default (unqualified) request to the HttpProvider it will perform various tests and output an HTML response indicating status. For example, in Apache, if the HttpProvider is configured with the servlet alias "sample" you commonly would access it via the URL "http://myserver/servlet/sample. Invoking the HttpProvider in this manner, without any parameters, causes it to run configuration test and report the results back to you in your browser.
HttpProvider is responsible for initializing the provider instance. This
can occur by one of two ways. The first is if the provider implements
Provider. In this case HttpProvider calls
the Provider.init(long,ProviderLog)
method. The second is if the provider additionally implements the Initializable interface. In this case, the Initializable.init(ParameterMap) method is called.
The ParameterMap passed contains the same
information as the first method, accessed using the parameter names
ProviderConstants.PROVIDER_ID
ProviderConstants.PROVIDER_LOG
and additional context information, such as init args, which are also
accessible using the ParameterMap.getParameterValue(String) method.
| Field Summary | |
static java.lang.String |
AUTO_RELOAD
|
static java.lang.String |
CACHE_LEVEL_HEADER
The constant that defines the validate cache header label that identifies the cache (user) level being specified. |
static java.lang.String |
CACHE_LEVEL_SYSTEM
The constant that identifies "system" level caching. |
static java.lang.String |
CACHE_LEVEL_USER
The constant that identifies "user" level caching. |
static java.lang.String |
CACHE_UPDATE_HEADER_VALUE
The constant value that indicates the current response is new and should replace the existing cached content. |
static java.lang.String |
CACHE_USE_HEADER
The constant for the validation based cache header label that is used to indicate the existing (cached) version is valid and should be reused. |
static java.lang.String |
CACHE_USE_HEADER_VALUE
The constant value that indicates the current cached content is still valid and should be returned to the requester. |
static java.lang.String |
CACHE_VERSION_HEADER
The constant that defines the the validate cache header label. |
static java.lang.String |
DEBUG_LEVEL
|
static java.lang.String |
EXPIRES_HEADER
The constant that defines the expires cache header label. |
static java.lang.String |
PORTLET_RENDER_REQUEST
The constant that is used as the key for retrieving the PortletRenderRequest from a HttpServletRequest using getAttribute(). |
static java.lang.String |
PROVIDER_ROOT
|
static java.lang.String |
PROVIDER_USER
The constant that is used as the key for retrieving the ProviderUser from the servlet session. |
static java.lang.String |
RELOAD_INTERVAL
|
static java.lang.String |
REQUEST_ID_HEADER
The header used for oracle specific request id. |
static java.lang.String |
SERVLET_CONFIG
The constant that is used as the key for retrieving the ServletConfig from a ServletPortletRenderRequest using getAttribute(). |
static java.lang.String |
SERVLET_CONTEXT
The constant that is used as the key for retrieving the ServletContext from a ServletPortletRenderRequest using getAttribute(). |
static java.lang.String |
SERVLET_REQUEST
The constant that is used as the key for retrieving the HttpServletRequest from a ServletPortletRenderRequest using getAttribute(). |
static java.lang.String |
SERVLET_RESPONSE
The constant that is used as the key for retrieving the HttpServletResponse from a ServletPortletRenderRequest using getAttribute(). |
static java.lang.String |
SESSION_TIMEOUT
|
static java.lang.String |
SHOW_TEST_PAGE
|
static int |
SYSTEM_LEVEL
Constant integer value used to indicate system level caching. |
static int |
USER_LEVEL
Constant integer value used to indicate user level caching. |
| Constructor Summary | |
HttpProvider()
|
|
| Method Summary | |
void |
destroy()
Standard servlet destroy method. |
java.lang.Class |
getProviderClass()
Returns the Provider class this servlet manages. |
void |
init(javax.servlet.ServletConfig sc)
Standard servlet init method. |
void |
log(java.lang.String msg)
Log the message to the Servlet log. |
void |
log(java.lang.String msg,
java.lang.Throwable t)
Log the exception to the Servlet log. |
void |
service(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Standard servlet service method. |
| Methods inherited from class javax.servlet.http.HttpServlet |
service |
| Methods inherited from class javax.servlet.GenericServlet |
getInitParameter,
getInitParameterNames,
getServletConfig,
getServletContext,
getServletInfo |
| Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
public static final java.lang.String SERVLET_CONFIG
public static final java.lang.String SERVLET_CONTEXT
public static final java.lang.String SERVLET_REQUEST
public static final java.lang.String SERVLET_RESPONSE
public static final java.lang.String PORTLET_RENDER_REQUEST
public static final java.lang.String PROVIDER_USER
public static final java.lang.String EXPIRES_HEADER
public static final java.lang.String CACHE_VERSION_HEADER
public static final java.lang.String CACHE_LEVEL_HEADER
public static final java.lang.String CACHE_LEVEL_USER
public static final int USER_LEVEL
public static final java.lang.String CACHE_LEVEL_SYSTEM
public static final int SYSTEM_LEVEL
public static final java.lang.String CACHE_USE_HEADER
public static final java.lang.String CACHE_UPDATE_HEADER_VALUE
public static final java.lang.String CACHE_USE_HEADER_VALUE
public static final java.lang.String REQUEST_ID_HEADER
public static final java.lang.String PROVIDER_ROOT
public static final java.lang.String SESSION_TIMEOUT
public static final java.lang.String AUTO_RELOAD
public static final java.lang.String DEBUG_LEVEL
public static final java.lang.String SHOW_TEST_PAGE
public static final java.lang.String RELOAD_INTERVAL
| Constructor Detail |
public HttpProvider()
| Method Detail |
public void init(javax.servlet.ServletConfig sc)
throws javax.servlet.ServletException
public void destroy()
public void service(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws javax.servlet.ServletException,
java.io.IOException
request - HttpServletRequest : detects if this is a request for a test pageresponse - HttpServletResponse :
public java.lang.Class getProviderClass()
throws javax.servlet.ServletException
provider whose value is a fully qualified
class name. If that doesn't exist then it checks to see if the initArg
provider_root is set. If it is it looks for a provider.xml file in this
root directory and tries to read the classname fron the provider tag. (Its
an attribute named "class").Developers can override this method returning their Provider if they want to have a distinguished servlet on the server.
public void log(java.lang.String msg)
msg - the message to log.
public void log(java.lang.String msg,
java.lang.Throwable t)
msg - the message to log.t - the exception that represents the reported problem.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||