Package javassist.util.proxy

Examples of javassist.util.proxy.MethodHandler


            throw new IsisException(e);
        }
    }

    private <T> MethodHandler newMethodHandler(final T domainObject) {
        return new MethodHandler() {
            @Override
            public Object invoke(final Object proxied, final Method proxyMethod, final Method proxiedMethod, final Object[] args) throws Throwable {

                final boolean inheritedFromObject = proxyMethod.getDeclaringClass().equals(Object.class);
                if(inheritedFromObject) {
View Full Code Here


        @SuppressWarnings("unchecked")
        final Class<T> proxySubclass = proxyFactory.createClass();
        try {
            final T newInstance = proxySubclass.newInstance();
            final ProxyObject proxyObject = (ProxyObject) newInstance;
            proxyObject.setHandler(new MethodHandler() {
                private ThreadLocal<T> serviceByThread = new ThreadLocal<T>();
               
                @Override
                public Object invoke(final Object proxied, final Method proxyMethod, final Method proxiedMethod, final Object[] args) throws Throwable {
View Full Code Here

            try
            {
               ProxyFactory factory = new ProxyFactory();
               factory.setSuperclass(superClass);
               factory.setFilter(MethodFilterHolder.METHOD_FILTER);
               MethodHandler handler = new MethodHandler()
               {
                  public Object invoke(Object self, Method m, Method proceed, Object[] args) throws Throwable
                  {
                     if ((!Modifier.isPublic(m.getModifiers()) || !Modifier.isPublic(m.getDeclaringClass()
                        .getModifiers())) && !m.isAccessible())
View Full Code Here

            try
            {
               ProxyFactory factory = new ProxyFactory();
               factory.setSuperclass(superClass);
               factory.setFilter(MethodFilterHolder.METHOD_FILTER);
               MethodHandler handler = new MethodHandler()
               {
                  public Object invoke(Object self, Method m, Method proceed, Object[] args) throws Throwable
                  {
                     if ((!Modifier.isPublic(m.getModifiers()) || !Modifier.isPublic(m.getDeclaringClass()
                        .getModifiers())) && !m.isAccessible())
View Full Code Here

      @Override
      public boolean isHandled(Method m) {
        return handledMethods.contains(m.getName());
      }
    });
    MethodHandler handler = new MethodHandler() {
      @Override
      public Object invoke(Object arg0, Method m, Method arg2, Object[] args) throws Throwable {
        String name = m.getName();
        if ("getConfiguration".equals(name)) {
          return conf;
View Full Code Here

      @Override
      public boolean isHandled(Method m) {
        return handledMethods.contains(m.getName());
      }
    });
    MethodHandler handler = new MethodHandler() {
      @Override
      public Object invoke(Object arg0, Method m, Method arg2, Object[] args) throws Throwable {
        String name = m.getName();
        if ("getConfiguration".equals(name)) {
          return conf;
View Full Code Here

      public boolean isHandled(Method m) {
        String name = m.getName();
        return "getConfiguration".equals(name) || "getCounter".equals(name) || "progress".equals(name);
      }
    });
    MethodHandler handler = new MethodHandler() {
      @Override
      public Object invoke(Object arg0, Method m, Method arg2, Object[] args) throws Throwable {
        String name = m.getName();
        if ("getConfiguration".equals(name)) {
          return conf;
View Full Code Here

      @Override
      public boolean isHandled(Method m) {
        return handledMethods.contains(m.getName());
      }
    });
    MethodHandler handler = new MethodHandler() {
      @Override
      public Object invoke(Object arg0, Method m, Method arg2, Object[] args) throws Throwable {
        String name = m.getName();
        if ("getConfiguration".equals(name)) {
          return conf;
View Full Code Here

      @Override
      public boolean isHandled(Method m) {
        return handledMethods.contains(m.getName());
      }
    });
    MethodHandler handler = new MethodHandler() {
      @Override
      public Object invoke(Object arg0, Method m, Method arg2, Object[] args) throws Throwable {
        String name = m.getName();
        if ("getConfiguration".equals(name)) {
          return conf;
View Full Code Here

      final Method method) {
   
    try {
      Class<T> implClass = (Class<T>) classCache.get(frameClass);
      T handler = factory.create(implClass);
      ((Proxy) handler).setHandler(new MethodHandler() {
        private JavaHandlerContextImpl<Element> defaultJavahandlerImpl = new JavaHandlerContextImpl<Element>(
            graph, method, element);
       

        @Override
View Full Code Here

TOP

Related Classes of javassist.util.proxy.MethodHandler

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.