Package javassist.util.proxy

Examples of javassist.util.proxy.ProxyFactory.create()


    ProxyFactory proxyFactory = new ProxyFactory();
    proxyFactory.setSuperclass( entityContextImplType );
    proxyFactory.setFilter( new EntityOrPropertyMethodFilter() );

    try {
      return (E) proxyFactory.create(
          new Class<?>[] { ConfigurationContext.class },
          new Object[] { this },
          new EntityOrPropertyMethodHandler( entityContextImplType, propertyContextImplType ) );
    }
    catch (Exception e) {
View Full Code Here


    ProxyFactory proxyFactory = new ProxyFactory();
    proxyFactory.setSuperclass( propertyContextImplType );
    proxyFactory.setFilter( new EntityOrPropertyMethodFilter() );

    try {
      return (P) proxyFactory.create(
          new Class<?>[] { ConfigurationContext.class },
          new Object[] { this },
          new EntityOrPropertyMethodHandler( entityContextImplType, propertyContextImplType ) );
    }
    catch (Exception e) {
View Full Code Here

    ProxyFactory proxyFactory = new ProxyFactory();
    proxyFactory.setSuperclass( globalContextImplType );
    proxyFactory.setFilter( new EntityMethodFilter() );

    try {
      return (G) proxyFactory.create(
          new Class<?>[] { ConfigurationContext.class },
          new Object[] { this },
          new EntityOrPropertyMethodHandler( entityContextImplType, propertyContextImplType ) );
    }
    catch (Exception e) {
View Full Code Here

    ProxyFactory proxyFactory = new ProxyFactory();
    proxyFactory.setSuperclass( entityContextImplType );
    proxyFactory.setFilter( new EntityOrPropertyMethodFilter() );

    try {
      return (E) proxyFactory.create(
          new Class<?>[] { ConfigurationContext.class },
          new Object[] { this },
          new EntityOrPropertyMethodHandler( entityContextImplType, propertyContextImplType ) );
    }
    catch (Exception e) {
View Full Code Here

    ProxyFactory proxyFactory = new ProxyFactory();
    proxyFactory.setSuperclass( propertyContextImplType );
    proxyFactory.setFilter( new EntityOrPropertyMethodFilter() );

    try {
      return (P) proxyFactory.create(
          new Class<?>[] { ConfigurationContext.class },
          new Object[] { this },
          new EntityOrPropertyMethodHandler( entityContextImplType, propertyContextImplType ) );
    }
    catch (Exception e) {
View Full Code Here

      Object[] args = {};

      SSLServerSocket proxy = null;
      try
      {
         proxy = (SSLServerSocket) pf.create(sig, args);
      }
      catch (Exception e)
      {
         IOException ioe = new IOException("Failed to create SSLServerSocket proxy");
         ioe.initCause(e);
View Full Code Here

  @Test(expected = ObjectQueryException.class)
  public void testWrongProxy() throws Exception {
    GenericSelectQuery<Person, Object> query = new GenericSelectQuery<Person, Object>(Person.class);
    ProxyFactory pf = new ProxyFactory();
    Object o = pf.create(null, null, new MethodHandler() {

      public Object invoke(Object self, Method thisMethod, Method proceed, Object[] args) throws Throwable {
        return null;
      }
    });
View Full Code Here

  @Test(expected = ObjectQueryException.class)
  public void testWrongProxyPrjection() throws Exception {
    GenericSelectQuery<Person, Object> query = new GenericSelectQuery<Person, Object>(Person.class);
    ProxyFactory pf = new ProxyFactory();
    Object o = pf.create(null, null, new MethodHandler() {

      public Object invoke(Object self, Method thisMethod, Method proceed, Object[] args) throws Throwable {
        return null;
      }
    });
View Full Code Here

    ProxyFactory proxyFactory = new ProxyFactory();
    proxyFactory.setSuperclass( globalContextImplType );
    proxyFactory.setFilter( new EntityMethodFilter() );

    try {
      return (G) proxyFactory.create(
          new Class<?>[] { ConfigurationContext.class },
          new Object[] { this },
          new EntityOrPropertyMethodHandler( entityContextImplType, propertyContextImplType ) );
    }
    catch (Exception e) {
View Full Code Here

    ProxyFactory proxyFactory = new ProxyFactory();
    proxyFactory.setSuperclass( entityContextImplType );
    proxyFactory.setFilter( new EntityOrPropertyMethodFilter() );

    try {
      return (E) proxyFactory.create(
          new Class<?>[] { ConfigurationContext.class },
          new Object[] { this },
          new EntityOrPropertyMethodHandler( entityContextImplType, propertyContextImplType ) );
    }
    catch (Exception e) {
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.