Package org.coliper.ibean.proxy
Class ExtensionSupport
- java.lang.Object
-
- org.coliper.ibean.proxy.ExtensionSupport
-
public class ExtensionSupport extends Object
Bundles anExtensionHandlerwith its supported interfaces. This tuple is then used as a configuration element for creating and customizingIBeanFactorys. SeeExtensionHandlerfor a general description of theProxyIBeanFactoryextension concept. SeeProxyIBeanFactory.Builder.withInterfaceSupport(ExtensionSupport)for where and how to useExtensionSupport.ExtensionSupportinstances are created via constructorExtensionSupport(Class, Class, boolean)and are then immutable.
-
-
Constructor Summary
Constructors Constructor Description ExtensionSupport(Class<?> supportedInterface, Class<? extends ExtensionHandler> handlerType, boolean handlerStateful)Creates a new immutableExtensionSupport.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhandlerStateful()Returnstrueif the handler is stateful and needs to have an individual instance per IBean object.Class<? extends ExtensionHandler>handlerType()Provides theExtensionHandlerimplementation responsible for the supported interface.Class<?>supportedInterface()Provides the interface that is covered by the corresponding handler.List<Class<?>>supportedInterfaceAndSuperInterfaces()Returns thesupportedInterface()together with all sub-interfaces of that interface.
-
-
-
Constructor Detail
-
ExtensionSupport
public ExtensionSupport(Class<?> supportedInterface, Class<? extends ExtensionHandler> handlerType, boolean handlerStateful)
Creates a new immutableExtensionSupport.- Parameters:
supportedInterface- specifies the extension interface supported by theExtensionHandler. Must be a Java interface type.handlerType- theExtensionHandlertype responsible for intercepting IBean calls to the extension interface. Must be a sublcass ofExtensionHandler.handlerStateful- specifies if the handler is stateful or stateless. Iftruea handler type will be treated as stateful an a new handler instance will be created for each new IBean instance.
-
-
Method Detail
-
supportedInterface
public Class<?> supportedInterface()
Provides the interface that is covered by the corresponding handler.- Returns:
- the extension interface type
-
handlerType
public Class<? extends ExtensionHandler> handlerType()
Provides theExtensionHandlerimplementation responsible for the supported interface.- Returns:
- the
ExtensionHandlerimplementation
-
handlerStateful
public boolean handlerStateful()
Returnstrueif the handler is stateful and needs to have an individual instance per IBean object.- Returns:
falseif a single handler instance can handle all bean objects
-
supportedInterfaceAndSuperInterfaces
public List<Class<?>> supportedInterfaceAndSuperInterfaces()
Returns thesupportedInterface()together with all sub-interfaces of that interface.- Returns:
- a list of interface types. Never
nullbut might be empty.
-
-