Examples of ProxyObject


Examples of javassist.util.proxy.ProxyObject

   /**
    * 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

Examples of javassist.util.proxy.ProxyObject

     
      try
      {
         if (comp==null)
         {
            ProxyObject proxy = Component.createProxyFactory(
                  ComponentType.STATEFUL_SESSION_BEAN,
                  beanClass,
                  Component.getBusinessInterfaces(beanClass)
               ).newInstance();
            proxy.setHandler(this);
            return proxy;
         }
         else
         {
            return comp.wrap(bean, this);
View Full Code Here

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

Examples of javassist.util.proxy.ProxyObject

      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

Examples of javassist.util.proxy.ProxyObject

      {
         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

Examples of javassist.util.proxy.ProxyObject

/*     */     {
/*  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

Examples of javassist.util.proxy.ProxyObject

    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

Examples of javassist.util.proxy.ProxyObject

   /**
    * 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

Examples of org.jboss.forge.furnace.proxy.javassist.util.proxy.ProxyObject

   }

   @Test
   public void testIsProxyObjectType() throws Exception
   {
      Assert.assertTrue(Proxies.isProxyType(new ProxyObject()
      {
         @Override
         public void setHandler(MethodHandler mi)
         {
         }
View Full Code Here

Examples of org.jboss.weld.bean.proxy.ProxyObject

    public void destroy(T instance) {
        Preconditions.checkNotNull(instance);

        // check if this is a proxy of a normal-scoped bean
        if (instance instanceof ProxyObject) {
            ProxyObject proxy = (ProxyObject) instance;
            if (proxy.getHandler() instanceof ProxyMethodHandler) {
                ProxyMethodHandler handler = (ProxyMethodHandler) proxy.getHandler();
                Bean<?> bean = handler.getBean();
                Context context = getBeanManager().getContext(bean.getScope());
                if (context instanceof AlterableContext) {
                    AlterableContext alterableContext = (AlterableContext) context;
                    alterableContext.destroy(bean);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.