public abstract class

PortletApplicationObjectSupport

extends ApplicationObjectSupport
implements PortletContextAware
java.lang.Object
   ↳ org.springframework.context.support.ApplicationObjectSupport
     ↳ org.springframework.web.portlet.context.PortletApplicationObjectSupport
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

Convenient superclass for application objects running in a Portlet ApplicationContext. Provides getApplicationContext, getServletContext, and getTempDir methods.

Summary

[Expand]
Inherited Fields
From class org.springframework.context.support.ApplicationObjectSupport
Public Constructors
PortletApplicationObjectSupport()
Public Methods
void setPortletContext(PortletContext portletContext)
Set the PortletContext that this object runs in.
Protected Methods
final PortletContext getPortletContext()
Return the current PortletContext.
final File getTempDir()
Return the temporary directory for the current web application, as provided by the servlet container.
boolean isContextRequired()
Overrides the base class behavior to enforce running in an ApplicationContext.
[Expand]
Inherited Methods
From class org.springframework.context.support.ApplicationObjectSupport
From class java.lang.Object
From interface org.springframework.context.ApplicationContextAware
From interface org.springframework.web.portlet.context.PortletContextAware

Public Constructors

public PortletApplicationObjectSupport ()

Public Methods

public void setPortletContext (PortletContext portletContext)

Set the PortletContext that this object runs in.

Invoked after population of normal bean properties but before an init callback like InitializingBean's afterPropertiesSet or a custom init-method. Invoked after ApplicationContextAware's setApplicationContext.

Parameters
portletContext PortletContext object to be used by this object

Protected Methods

protected final PortletContext getPortletContext ()

Return the current PortletContext.

Throws
IllegalStateException if not running within a PortletContext

protected final File getTempDir ()

Return the temporary directory for the current web application, as provided by the servlet container.

Returns
  • the File representing the temporary directory
Throws
IllegalStateException if not running within a PortletContext
See Also
  • org.springframework.web.portlet.util.PortletUtils#getTempDir(javax.portlet.PortletContext)

protected boolean isContextRequired ()

Overrides the base class behavior to enforce running in an ApplicationContext. All accessors will throw IllegalStateException if not running in a context.