Package net.sf.cglib.proxy

Examples of net.sf.cglib.proxy.Enhancer.create()


      ex.setSuperclass(InjectorContainer.class);
      ex.setInterfaces(new Class[] { Player.class });
    ex.setCallbacks(new Callback[] { NoOp.INSTANCE, implementation });
    ex.setCallbackFilter(callbackFilter);
     
      return (Player) ex.create();
  }
 
  /**
   * Construct a temporary player with the given associated socket injector.
   * @param server - the parent server.
View Full Code Here


        // Invoke our on method
        return offlineMethod.invoke(SerializedOfflinePlayer.this, args);
      }
      });
     
      return (Player) ex.create();
  }
}
View Full Code Here

  public Object getProxy() {
    Enhancer enhancer = new Enhancer();
    enhancer.setSuperclass(advised.getTargetSource().getTargetClass());
    enhancer.setInterfaces(advised.getTargetSource().getInterfaces());
    enhancer.setCallback(new DynamicAdvisedInterceptor(advised));
    Object enhanced = enhancer.create();
    return enhanced;
  }

  private static class DynamicAdvisedInterceptor implements MethodInterceptor {
View Full Code Here

            enhancer.setInterfaces(allImplementedInterfaces);
            enhancer.setCallbackType(net.sf.cglib.proxy.MethodInterceptor.class);
            enhancer.setUseFactory(false);//????
            interceptor = new ConnectorMethodInterceptor(kernel.getKernelName(), ObjectName.getInstance(objectName));
            enhancer.setCallbacks(new Callback[]{interceptor});
            proxy = enhancer.create(new Class[0], new Object[0]);
        } else {
            proxy = connectionFactory;
        }

        //connect proxy
View Full Code Here

    Enhancer enhancer = new Enhancer();
    enhancer.setSuperclass(Service.class);
    enhancer.setCallback(proxy);

    return (Service) enhancer.create();
  }
}
View Full Code Here

      {
        return o.getClass().getName().replace(".wrapper", "");
      }
    });

    return e.create();
  }
}
View Full Code Here

        {
          return super.getClassName("WICKET_" + prefix, source, key, names);
        }
      });

      return e.create();
    }
  }

  /**
   * This interface is used to make the proxy forward writeReplace() call to the handler instead
View Full Code Here

                public Object loadObject() throws Exception {
                    return dispatcher.call();
                }
            });
            e.setUseFactory(false);
            return e.create();
        }

        protected Class<?> getTargetClass(Class<?>[] interfaceNames) {
            // Only allow class proxying if specifically asked to
            Class<?> root = Object.class;
View Full Code Here

  @SuppressWarnings("unchecked")
  protected <T, V> V proxy(Class<V> assertClass, Class<T> actualClass, T actual) {
    Enhancer enhancer = new Enhancer();
    enhancer.setSuperclass(assertClass);
    enhancer.setCallback(collector);
    return (V) enhancer.create(array(actualClass), array(actual));
  }

  /**
   * Creates a new instance of <code>{@link BigDecimalAssert}</code>.
   *
 
View Full Code Here

        });
        Class<?> targetJavaInterface = getTargetJavaClass(serviceInterface);
        targetJavaInterface = RemoteInterfaceGenerator.generate(targetJavaInterface);
        enhancer.setClassLoader(targetJavaInterface.getClassLoader());
        enhancer.setInterfaces(new Class[] {targetJavaInterface});
        return (Remote)enhancer.create();
    }

    private Object invokeTarget(Operation op, Object[] args) throws InvocationTargetException {
        return wire.invoke(op, args);
    }
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.