当前位置: 首页>>代码示例>>Java>>正文


Java Factory.newInstance方法代码示例

本文整理汇总了Java中net.sf.cglib.proxy.Factory.newInstance方法的典型用法代码示例。如果您正苦于以下问题:Java Factory.newInstance方法的具体用法?Java Factory.newInstance怎么用?Java Factory.newInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.sf.cglib.proxy.Factory的用法示例。


在下文中一共展示了Factory.newInstance方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getProxy

import net.sf.cglib.proxy.Factory; //导入方法依赖的package包/类
public static HibernateProxy getProxy(
	final Factory factory, 
	final Class persistentClass, 
	final Class[] interfaces, 
	final Method getIdentifierMethod, 
	final Method setIdentifierMethod, 
	final Serializable id, 
	final SessionImplementor session) 
throws HibernateException {
	final CGLIBLazyInitializer instance = new CGLIBLazyInitializer(
		persistentClass, interfaces, id, getIdentifierMethod, setIdentifierMethod, session
	);
	final HibernateProxy proxy = (HibernateProxy) factory.newInstance(instance);
	instance.constructed = true;
	return proxy;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:17,代码来源:CGLIBLazyInitializer.java

示例2: proxifyBean

import net.sf.cglib.proxy.Factory; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
private <T> T proxifyBean(T bean) throws IllegalAccessException, InstantiationException {
    if (!isEnhanceable(bean.getClass())) {
        return bean;
    }
    Factory factory = getFactory(bean.getClass());
    Callback[] callbacks = getCallbacks(bean);
    T newInstance = (T) factory.newInstance(callbacks);
    ExceptionMethodInterceptor exceptionCallback = (ExceptionMethodInterceptor) callbacks[1];
    // By default the ExceptionMethodInterceptor is not active to allow calling setters in class constructor
    // After class instance creation it should be immediately activated
    exceptionCallback.setActive(true);
    return newInstance;
}
 
开发者ID:dtitov,项目名称:CodeFreeze,代码行数:15,代码来源:CGLIBCodeFreeze.java

示例3: createUsingFactory

import net.sf.cglib.proxy.Factory; //导入方法依赖的package包/类
protected <T extends InteractionAwareFixture> T createUsingFactory(Callback callback, Factory factory, Class<?>[] constructorTypes, Object[] constructorArgs) {
    Callback[] callbacks = new Callback[] { callback };

    T result;
    if (constructorArgs != null && constructorArgs.length > 0) {
        result = (T) factory.newInstance(constructorTypes, constructorArgs, callbacks);
    } else {
        result = (T) factory.newInstance(callbacks);
    }
    return result;
}
 
开发者ID:fhoeben,项目名称:hsac-fitnesse-fixtures,代码行数:12,代码来源:FixtureFactory.java

示例4: newInstance

import net.sf.cglib.proxy.Factory; //导入方法依赖的package包/类
static JedisWrapperDoNotUse newInstance(final Factory factory, final Jedis realJedis) {
    return (JedisWrapperDoNotUse) factory.newInstance(new JedisWrapperMethodInterceptor(realJedis));
}
 
开发者ID:lithiumtech,项目名称:rdbi,代码行数:4,代码来源:JedisWrapperMethodInterceptor.java


注:本文中的net.sf.cglib.proxy.Factory.newInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。