org.apache.tapestry.bean
Class BeanProvider

java.lang.Object
  extended by org.apache.tapestry.bean.BeanProvider
All Implemented Interfaces:
EventListener, PageDetachListener, PageRenderListener, IBeanProvider

public class BeanProvider
extends Object
implements IBeanProvider, PageDetachListener, PageRenderListener

Basic implementation of the IBeanProvider interface.

Since:
1.0.4
Version:
$Id: BeanProvider.java 243791 2004-02-19 17:38:13Z hlship $
Author:
Howard Lewis Ship

Constructor Summary
BeanProvider(IComponent component)
           
 
Method Summary
 boolean canProvideBean(String name)
          Returns true if the provider can provide the named bean.
 Object getBean(String name)
          Returns the JavaBean with the specified name.
 Collection getBeanNames()
          Returns a collection of the names of any beans which may be provided.
 IComponent getComponent()
          Returns the IComponent (which may be a IPage) for which this bean provider is providing beans.
 IResourceResolver getResourceResolver()
          Returns a resource resolver.
 void pageBeginRender(PageEvent event)
          Invoked before just before the page renders a response.
 void pageDetached(PageEvent event)
          Removes all beans with the REQUEST lifecycle.
 void pageEndRender(PageEvent event)
          Invoked after a successful render of the page.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeanProvider

public BeanProvider(IComponent component)
Method Detail

getBeanNames

public Collection getBeanNames()
Description copied from interface: IBeanProvider
Returns a collection of the names of any beans which may be provided.

Specified by:
getBeanNames in interface IBeanProvider
Since:
1.0.6
See Also:
IComponentSpecification.getBeanNames()

getComponent

public IComponent getComponent()
Description copied from interface: IBeanProvider
Returns the IComponent (which may be a IPage) for which this bean provider is providing beans.

Specified by:
getComponent in interface IBeanProvider
Since:
1.0.5

getBean

public Object getBean(String name)
Description copied from interface: IBeanProvider
Returns the JavaBean with the specified name. The bean is created as needed.

Specified by:
getBean in interface IBeanProvider

pageDetached

public void pageDetached(PageEvent event)
Removes all beans with the REQUEST lifecycle. Beans with the PAGE lifecycle stick around, and beans with no lifecycle were never stored in the first place.

Specified by:
pageDetached in interface PageDetachListener

getResourceResolver

public IResourceResolver getResourceResolver()
Description copied from interface: IBeanProvider
Returns a resource resolver.

Specified by:
getResourceResolver in interface IBeanProvider
Since:
1.0.8

pageBeginRender

public void pageBeginRender(PageEvent event)
Description copied from interface: PageRenderListener
Invoked before just before the page renders a response. This provides listeners with a last chance to initialize themselves for the render. This initialization can include modifying peristent page properties.

Specified by:
pageBeginRender in interface PageRenderListener
Since:
2.2

pageEndRender

public void pageEndRender(PageEvent event)
Description copied from interface: PageRenderListener
Invoked after a successful render of the page. Allows objects to release any resources they needed during the the render.

Specified by:
pageEndRender in interface PageRenderListener
Since:
2.2
See Also:
AbstractComponent.pageEndRender(PageEvent)

canProvideBean

public boolean canProvideBean(String name)
Description copied from interface: IBeanProvider
Returns true if the provider can provide the named bean.

Specified by:
canProvideBean in interface IBeanProvider
Since:
2.2