本文整理匯總了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()));
}