Package org.apache.tapestry5.ioc.services

## Interface ThunkCreator

- All Known Implementing Classes:
    `ThunkCreatorImpl`

      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.
  Since:
    5.1.0.1

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `<T> T` | `createThunk​(Class<T> proxyType, ObjectCreator objectCreator, String description)` | Creates a Thunk of the given proxy type.

- - ### Method Detail

    - #### createThunk

          <T> T createThunk​(Class<T> proxyType,
                            ObjectCreator objectCreator,
                            String description)

      Creates a Thunk of the given proxy type.
      Type Parameters:
        `T` - type of thunk
      Parameters:
        `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
      Returns:
        thunk of given type