Oracle Fusion Middleware
Java API Reference for Oracle PDK Java
11g Release 1 (11.1.1)
E10691-01

oracle.portal.provider.v2.render.http
Class JavaRenderer

java.lang.Object
  extended by oracle.portal.provider.v2.render.ManagedRenderer
      extended by oracle.portal.provider.v2.render.http.BaseManagedRenderer
          extended by oracle.portal.provider.v2.render.http.JavaRenderer
All Implemented Interfaces:
Validateable, InitializableXMLObject

public class JavaRenderer
extends BaseManagedRenderer
implements InitializableXMLObject

JavaRenderer has responsibility for responding to a PortletRenderRequest by dynamically invoking an arbitrarily named method on an instance of an arbitrary class. The only restrictions are that the class must have a null constructor, and the named method must take a PortletRenderRequest as the only parameter.

The properties contentType and pageExpires may be set explicitly on a JavaRenderer, or inherited from defaults set at RenderManager level. However the class and method names must be set at JavaRenderer level via calls to setClassName(String) and setRenderMethod(String). Once these strings have been set, it is important that the BaseManagedRenderer.postInitialize() method is called to complete initialization. If the provider definition is a DefaultProviderDefinition, these calls may be initiated as a result of <className> and <renderMethod> declarations in the provider XML registry.


Constructor Summary
JavaRenderer()
          Null constructor.
 
Method Summary
 java.lang.String getClassName()
          Gets the fully-qualified class name of the object used to render this request.
 java.lang.String getRenderMethod()
          Gets the name of the method called on an instance of the preset class to render a request.
 void renderBody(PortletRenderRequest pr)
          Renders the request using dynamic invocation of the preset method on an instance of the preset class.
 void setClassName(java.lang.String className)
          Sets the fully-qualified class name of the object used to render this request.
 void setRenderMethod(java.lang.String methodName)
          Sets the name of the method to be called on an instance of the preset class to render a request.
 void validate(java.lang.String context, ValidationError errors)
          Validates the internal state of this JavaRenderer instance.
 
Methods inherited from class oracle.portal.provider.v2.render.http.BaseManagedRenderer
addParameter, getContentType, getGeneratesESI, postInitialize, preInitialize, prepareResponse, setContentType, setGeneratesESI, setGeneratesESI, setPageExpires, setPageExpires, setUseInvalidationCaching, setUseInvalidationCaching
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface oracle.portal.utils.xml.v2.InitializableXMLObject
postInitialize, preInitialize
 

Constructor Detail

JavaRenderer

public JavaRenderer()
Null constructor.

Method Detail

renderBody

public void renderBody(PortletRenderRequest pr)
                throws PortletException
Renders the request using dynamic invocation of the preset method on an instance of the preset class. The method must take a PortletRenderRequest as its only parameter.

Specified by:
renderBody in class ManagedRenderer
Parameters:
pr - a PortletRenderRequest
Throws:
PortletException - if dynamic invocation of the method fails

setClassName

public void setClassName(java.lang.String className)
Sets the fully-qualified class name of the object used to render this request.

Parameters:
className - fully-qualified class name.

getClassName

public java.lang.String getClassName()
Gets the fully-qualified class name of the object used to render this request.

Returns:
the fully-qualified class name of the object used to render this request.

setRenderMethod

public void setRenderMethod(java.lang.String methodName)
Sets the name of the method to be called on an instance of the preset class to render a request.

Parameters:
methodName - a method name.

getRenderMethod

public java.lang.String getRenderMethod()
Gets the name of the method called on an instance of the preset class to render a request.

Returns:
a method name.

validate

public void validate(java.lang.String context,
                     ValidationError errors)
Validates the internal state of this JavaRenderer instance. Errors found are reported using the supplied ValidationError instance.

Specified by:
validate in interface Validateable
Overrides:
validate in class BaseManagedRenderer
Parameters:
context - The context of the calling instance.
errors - The current list of errors.

Oracle Fusion Middleware
Java API Reference for Oracle PDK Java
11g Release 1 (11.1.1)
E10691-01

Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.