Package javassist.util.proxy

Examples of javassist.util.proxy.ProxyObject


      proxyClass = factory.createClass();
    }

    public Object getProxy() {
      try {
        final ProxyObject proxy = (ProxyObject) proxyClass.newInstance();
        proxy.setHandler( new PassThroughHandler( proxy, proxyClass.getName() ) );
        return proxy;
      }
      catch ( Throwable t ) {
        throw new HibernateException( "Unable to instantiated proxy instance" );
      }
View Full Code Here


      proxyClass = factory.createClass();
    }

    public Object getProxy() {
      try {
        ProxyObject proxy = ( ProxyObject ) proxyClass.newInstance();
        proxy.setHandler( new PassThroughHandler( proxy, proxyClass.getName() ) );
        return proxy;
      }
      catch ( Throwable t ) {
        throw new HibernateException( "Unable to instantiated proxy instance" );
      }
View Full Code Here

      {
         ClassLoader cl = Configurator.getClassLoader(context.getBeanMetaData());
         factory.setInterfaces(getClasses(kernel.getConfigurator(), interfaces, cl));
      }
      Class<?> proxyClass = getProxyClass(factory);
      ProxyObject proxy = (ProxyObject)proxyClass.newInstance();
      proxy.setHandler(new LazyHandler(bean, kernel.getBus(), beanInfo.getClassInfo().getType()));
      return proxy;
   }
View Full Code Here

/*     */     {
/*  61 */       ClassLoader cl = Configurator.getClassLoader(context.getBeanMetaData());
/*  62 */       factory.setInterfaces(getClasses(kernel.getConfigurator(), interfaces, cl));
/*     */     }
/*  64 */     Class proxyClass = getProxyClass(factory);
/*  65 */     ProxyObject proxy = (ProxyObject)proxyClass.newInstance();
/*  66 */     proxy.setHandler(new LazyHandler(bean, kernel.getBus(), beanInfo.getClassInfo().getType()));
/*  67 */     return proxy;
/*     */   }
View Full Code Here

    public boolean isProxy(Object o) {
        return o != null && ProxyObject.class.isAssignableFrom(o.getClass());
    }
   
    private <T> void setHandler(Object proxyInstance, final MethodInvocation<? super T> handler) {
        ProxyObject proxyObject = (ProxyObject) proxyInstance;

        proxyObject.setHandler(new MethodHandler() {
            public Object invoke(final Object self, final Method thisMethod, final Method proceed, Object[] args)
                throws Throwable {

                return handler.intercept((T) self, thisMethod, args, new SuperMethod() {
                    public Object invoke(Object proxy, Object[] args) {
View Full Code Here

   /**
    * Wrap a CGLIB interceptor around an instance of the component
    */
   public Object wrap(Object bean, MethodHandler interceptor) throws Exception
   {
      ProxyObject proxy = getProxyFactory().newInstance();
      proxy.setHandler(interceptor);
      return proxy;
   }
View Full Code Here

TOP

Related Classes of javassist.util.proxy.ProxyObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.