站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > Spring Framework 2.1.0 API 文档英文版

PortletApplicationObjectSupport (Spring Framework API 2.1) - Spring Framework 2.1.0 API 文档英文版


The Spring Framework

org.springframework.web.portlet.context
Class PortletApplicationObjectSupport

java.lang.Object
  extended by org.springframework.context.support.ApplicationObjectSupport
      extended by org.springframework.web.portlet.context.PortletApplicationObjectSupport
All Implemented Interfaces:
ApplicationContextAware, PortletContextAware
Direct Known Subclasses:
PortletContentGenerator

public abstract class PortletApplicationObjectSupport
extends ApplicationObjectSupport
implements PortletContextAware

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

Since:
2.0
Author:
Juergen Hoeller

Field Summary
 
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
 
Constructor Summary
PortletApplicationObjectSupport()
           
 
Method Summary
protected  PortletContext getPortletContext()
          Return the current PortletContext.
protected  File getTempDir()
          Return the temporary directory for the current web application, as provided by the servlet container.
protected  boolean isContextRequired()
          Overrides the base class behavior to enforce running in an ApplicationContext.
 void setPortletContext(PortletContext portletContext)
          Set the PortletContext that this object runs in.
 
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PortletApplicationObjectSupport

public PortletApplicationObjectSupport()
Method Detail

setPortletContext

public void setPortletContext(PortletContext portletContext)
Description copied from interface: PortletContextAware
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.

Specified by:
setPortletContext in interface PortletContextAware
Parameters:
portletContext - PortletContext object to be used by this object

isContextRequired

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.

Overrides:
isContextRequired in class ApplicationObjectSupport
See Also:
ApplicationObjectSupport.getApplicationContext(), ApplicationObjectSupport.getMessageSourceAccessor(), getPortletContext(), getTempDir()

getPortletContext

protected final PortletContext getPortletContext()
                                          throws IllegalStateException
Return the current PortletContext.

Throws:
IllegalStateException - if not running within a PortletContext

getTempDir

protected final File getTempDir()
                         throws IllegalStateException
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:
PortletUtils.getTempDir(javax.portlet.PortletContext)

The Spring Framework

Copyright © 2002-2007 The Spring Framework.