本文整理汇总了Java中org.apache.wicket.proxy.LazyInitProxyFactory类的典型用法代码示例。如果您正苦于以下问题:Java LazyInitProxyFactory类的具体用法?Java LazyInitProxyFactory怎么用?Java LazyInitProxyFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
LazyInitProxyFactory类属于org.apache.wicket.proxy包,在下文中一共展示了LazyInitProxyFactory类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getFieldValue
import org.apache.wicket.proxy.LazyInitProxyFactory; //导入依赖的package包/类
@Override
public Object getFieldValue(final Field field, Object fieldOwner) {
String key = field.getType().getName();
if (!this.context.containsKey(key)) {
String message = formatMissingObjectErrorMessage(field, fieldOwner);
throw new IllegalStateException(message);
}
final Object bean = this.context.get(key);
return LazyInitProxyFactory.createProxy(field.getType(), new IProxyTargetLocator() {
private static final long serialVersionUID = 1L;
@Override
public Object locateProxyTarget() {
return bean;
}
});
}
示例2: getFieldValue
import org.apache.wicket.proxy.LazyInitProxyFactory; //导入依赖的package包/类
@Override
public Object getFieldValue(Field field, Object fieldOwner) {
if (supportsField(field)) {
IProxyTargetLocator locator = new ArtifactoryBeanLocator(field.getType(), contextLocator);
Object proxy = LazyInitProxyFactory.createProxy(field.getType(), locator);
return proxy;
} else {
return null;
}
}
示例3: ArtifactoryWebSession
import org.apache.wicket.proxy.LazyInitProxyFactory; //导入依赖的package包/类
public ArtifactoryWebSession(Request request) {
super(request);
authenticationManager = (AuthenticationManager) LazyInitProxyFactory.createProxy(
AuthenticationManager.class, new SecurityServiceLocator());
}
示例4: getProxyDao
import org.apache.wicket.proxy.LazyInitProxyFactory; //导入依赖的package包/类
/**
* Creates a proxy via LazyInitProxyFactory. Use-full if needed in Wicket components. Avoids Wicket serialization of the dao.
* @return
*/
public BaseDao< ? > getProxyDao()
{
return (BaseDao< ? >) LazyInitProxyFactory.createProxy(registryEntry.getDaoClassType(), new DaoLocator(registryEntry.getId()));
}