public class OwLazyLoadingProxyHandler extends Object
Simple utility class to create a proxy based on special OwLoader
implementation.
Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.
For licensing information read the license.txt file or
go to: http://wiki.alfresco.com
Constructor and Description |
---|
OwLazyLoadingProxyHandler() |
Modifier and Type | Method and Description |
---|---|
static <T> T |
createLazyLoadedInstance(OwLoader<T> loader,
Class<?>... interfaces)
Create a Proxy based on provided Loader, and corresponding interfaces.
|
static <T> InvocationHandler |
createProxyHandler(OwLoader<T> loader)
Will create an invocation handler which is loading the specific instance
based on the provided loader.
|
static <T,O extends T> |
createSimpleClassLazyLoadedInstance(Class<O> instanceType,
Class<T> interfaceType)
Create an Instance of an interface, loading the specific implementation class by an
OwClassInstanceLoader . |
static <T> T |
createSingeltonLazyLoadedInstance(OwLoader<T> loader,
Class<T> type)
Create a specific instance based on provided loader, trying to instantiate the corresponding type only once.
|
public static <T> InvocationHandler createProxyHandler(OwLoader<T> loader)
loader
- OwLoader to create delegation object for invocation handlerpublic static <T,O extends T> T createSimpleClassLazyLoadedInstance(Class<O> instanceType, Class<T> interfaceType)
OwClassInstanceLoader
.
Creation of specific instance is based on proxy handling and reflective instantiation of the implementing class using the default constructor.
instanceType
- Class implementing interfaceinterfaceType
- Class representing the interfacepublic static <T> T createSingeltonLazyLoadedInstance(OwLoader<T> loader, Class<T> type)
loader
- OwLoader specific type loadertype
- Class describing wanted interface implementationpublic static <T> T createLazyLoadedInstance(OwLoader<T> loader, Class<?>... interfaces)
loader
- OwLoader for specific implementation of interfacesinterfaces
- Class array of interface which Proxy should supportCopyright © 2014 Alfresco Business Solutions. All Rights Reserved.