Interface ThunkCreator

  • All Known Implementing Classes:

    public interface ThunkCreator
    A thunk is a delayed calculation. In Java and Tapestry terms, a Thunk is a proxy object of a particular interface that delegates all methods to an object of the same type obtained from an ObjectProvider. This is used by LazyAdvisor to build lazy thunk proxies.
    • Method Detail

      • createThunk

        <T> T createThunk​(java.lang.Class<T> proxyType,
                          ObjectCreator objectCreator,
                          java.lang.String description)
        Creates a Thunk of the given proxy type.
        Type Parameters:
        T - type of thunk
        proxyType - type of object to create (must be an interface)
        objectCreator - provides an instance of the same type on demand (may be invoked multiple times)
        description - to be returned from the thunk's toString() method
        thunk of given type