Package javassist.util.proxy

Examples of javassist.util.proxy.MethodFilter


                  }
               }
               else
                  hierarchy = Arrays.copy(types, new Class<?>[types.length]);

               MethodFilter filter = new MethodFilter()
               {
                  @Override
                  public boolean isHandled(Method method)
                  {
                     if (!method.getDeclaringClass().getName().contains("java.lang")
View Full Code Here


    * Create a proxy for the given {@link Class} type.
    */
   @SuppressWarnings("unchecked")
   public static <T> T enhance(final ClassLoader loader, Object instance, ForgeProxy handler)
   {
      MethodFilter filter = new MethodFilter()
      {
         @Override
         public boolean isHandled(Method method)
         {
            String name = method.getName();
View Full Code Here

    * Create a proxy for the given {@link Class} type.
    */
   @SuppressWarnings("unchecked")
   public static <T> T enhance(Class<T> type, ForgeProxy handler)
   {
      MethodFilter filter = new MethodFilter()
      {
         @Override
         public boolean isHandled(Method method)
         {
            String name = method.getName();
View Full Code Here

                     }
                  }
                  else
                     hierarchy = Arrays.copy(types, new Class<?>[types.length]);

                  MethodFilter filter = new MethodFilter()
                  {
                     @Override
                     public boolean isHandled(Method method)
                     {
                        if (!method.getDeclaringClass().getName().contains("java.lang")
View Full Code Here

        else {
            factory.setSuperclass(clazz);
        }

        factory.setFilter(
                new MethodFilter() {
                    @Override
                    public boolean isHandled(Method method) {
                        String methodName = method.getName();

                        if (methodName.startsWith("get")) {
View Full Code Here

               }
            }
            else
               hierarchy = Arrays.copy(types, new Class<?>[types.length]);

            MethodFilter filter = new MethodFilter()
            {
               @Override
               public boolean isHandled(Method method)
               {
                  if (!method.getDeclaringClass().getName().contains("java.lang")
View Full Code Here

        final ProxyFactory proxyFactory = new ProxyFactory();
        proxyFactory.setSuperclass(cls);
        proxyFactory.setInterfaces(ArrayExtensions.combine(cls.getInterfaces(), new Class<?>[] { JavassistEnhanced.class }));

        proxyFactory.setFilter(new MethodFilter() {
            @Override
            public boolean isHandled(final Method m) {
                // ignore finalize()
                return !m.getName().equals("finalize");
            }
View Full Code Here

      types = new Class[] { Configuration.class, TaskAttemptID.class, RecordWriter.class, OutputCommitter.class,
          StatusReporter.class };
      args = new Object[] { conf, new TaskAttemptID(), null, null, null };
      factory.setSuperclass(superType);
    }
    factory.setFilter(new MethodFilter() {
      @Override
      public boolean isHandled(Method m) {
        String name = m.getName();
        return "getConfiguration".equals(name) || "getCounter".equals(name) || "progress".equals(name);
      }
View Full Code Here

  @SuppressWarnings("unchecked")
  private <T> Class<T> createTheProxy(Class<?> mainClass) {
    ProxyFactory f = new ProxyFactory();
    f.setSuperclass(mainClass);
    f.setInterfaces(new Class[] {NoSqlProxy.class});
    f.setFilter(new MethodFilter() {
      public boolean isHandled(Method m) {
        // ignore finalize()
        if(m.getName().equals("finalize"))
          return false;
        else if(m.getName().equals("equals"))
View Full Code Here

  @SuppressWarnings("unchecked")
  private <T> Class<T> createTheProxy(Class<?> mainClass) {
    ProxyFactory f = new ProxyFactory();
    f.setSuperclass(mainClass);
    f.setInterfaces(new Class[] {NoSqlProxy.class});
    f.setFilter(new MethodFilter() {
      public boolean isHandled(Method m) {
        // ignore finalize()
        if(m.getName().equals("finalize"))
          return false;
        else if(m.getName().equals("equals"))
View Full Code Here

TOP

Related Classes of javassist.util.proxy.MethodFilter

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.