org.apache.tapestry5.internal.services
Class PropertyConduitSourceImpl

java.lang.Object
  extended by org.apache.tapestry5.internal.services.PropertyConduitSourceImpl
All Implemented Interfaces:
InvalidationListener, PropertyConduitSource

public class PropertyConduitSourceImpl
extends Object
implements PropertyConduitSource, InvalidationListener


Constructor Summary
PropertyConduitSourceImpl(PropertyAccess access, PlasticProxyFactory proxyFactory, TypeCoercer typeCoercer, StringInterner interner)
           
 
Method Summary
 PropertyConduit create(Class rootClass, String expression)
          Returns a property conduit instance for the given expression.
 void listenForInvalidations(InvalidationEventHub hub)
           
static NullPointerException nullTerm(String term, String expression, Object root)
          May be invoked from fabricated PropertyConduit instances.
 void objectWasInvalidated()
          Clears its caches when the component class loader is invalidated; this is because it will be common to generate conduits rooted in a component class (which will no longer be valid and must be released to the garbage collector).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyConduitSourceImpl

public PropertyConduitSourceImpl(PropertyAccess access,
                                 @ComponentLayer
                                 PlasticProxyFactory proxyFactory,
                                 TypeCoercer typeCoercer,
                                 StringInterner interner)
Method Detail

listenForInvalidations

@PostInjection
public void listenForInvalidations(@ComponentClasses
                                                 InvalidationEventHub hub)

create

public PropertyConduit create(Class rootClass,
                              String expression)
Description copied from interface: PropertyConduitSource
Returns a property conduit instance for the given expression. PropertyConduitSource caches the conduits it returns, so despite the name, this method does not always create a new conduit. The cache is cleared if a change to component classes is observed.

Callers of this method should observe notifications from the InvalidationEventHub for ComponentClasses and discard any aquired conduits; failure to do so will create memory leaks whenever component classes change (the conduits will keep references to the old classes and classloaders).

Specified by:
create in interface PropertyConduitSource
Parameters:
rootClass - the type of the root object to which the expression is applied
expression - expression to be evaluated on instances of the root class
Returns:
RuntimeException if the expression is invalid (poorly formed, references non-existent properties, etc.)

objectWasInvalidated

public void objectWasInvalidated()
Clears its caches when the component class loader is invalidated; this is because it will be common to generate conduits rooted in a component class (which will no longer be valid and must be released to the garbage collector).

Specified by:
objectWasInvalidated in interface InvalidationListener

nullTerm

public static NullPointerException nullTerm(String term,
                                            String expression,
                                            Object root)
May be invoked from fabricated PropertyConduit instances.



Copyright © 2003-2012 The Apache Software Foundation.