Package org.apache.aries.proxy

Examples of org.apache.aries.proxy.UnableToProxyException


      if(old != null) {
        c = Class.forName(className, false, this);
      }
      return c;
    } catch (ClassFormatError cfe) {
      throw new UnableToProxyException(createSet.iterator().next(), cfe);
    } catch (ClassNotFoundException e) {
      throw new UnableToProxyException(createSet.iterator().next(), e);
    }
  }
View Full Code Here


      for(Class<?> c : interfaces) {
        adapter.setCurrentInterface(Type.getType(c));
        try {
          AbstractWovenProxyAdapter.readClass(c, this);
        } catch (IOException e) {
          throw new UnableToProxyException(c, e);
        }
      }
     
      adapter.setCurrentInterface(Type.getType(Object.class));
      visitObjectMethods();
View Full Code Here

      }
    } catch (ClassNotFoundException e) {
      // If this happens we're about to hit bigger trouble on verify, so we
      // should stop weaving and fail. Make sure we don't cause the hook to
      // throw an error though.
      UnableToProxyException u = new UnableToProxyException(name, e);
      throw new RuntimeException(NLS.MESSAGES.getMessage("cannot.load.superclass", superName.replace('/', '.'), typeBeingWoven.getClassName()), u);
    }
  }
View Full Code Here

        methodAdapter.invokeConstructor(superType, NO_ARGS_CONSTRUCTOR);
      else {
        if(hasNoArgsConstructor)
          methodAdapter.invokeConstructor(typeBeingWoven, NO_ARGS_CONSTRUCTOR);
        else
          throw new RuntimeException(new UnableToProxyException(typeBeingWoven.getClassName(),
              NLS.MESSAGES.getMessage("type.lacking.no.arg.constructor", typeBeingWoven.getClassName(), superType.getClassName())));
      }
      methodAdapter.loadThis();
      methodAdapter.loadArg(0);
      methodAdapter.putField(typeBeingWoven, DISPATCHER_FIELD, DISPATCHER_TYPE);
View Full Code Here

    try {
      Constructor<?> con = c.getDeclaredConstructor(Callable.class, InvocationListener.class);
      con.setAccessible(true);
      return con.newInstance(dispatcher, listener);
    } catch (Exception e) {
      throw new UnableToProxyException(ifaces.iterator().next(), e);
    }
  }
View Full Code Here

      }

      if (unable == null) {
          throw new RuntimeException(NLS.MESSAGES.getMessage("no.common.superclass", arg0, arg1));
      } else {
          throw new RuntimeException(new UnableToProxyException(unable, NLS.MESSAGES.getMessage("no.common.superclass", arg0, arg1)));
      }
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here

      // We can't call up to a package protected method if we aren't in the same
      // package
      if((access & (ACC_PUBLIC | ACC_PROTECTED | ACC_PRIVATE)) == 0) {
        if(!!!samePackage)
          throw new RuntimeException(NLS.MESSAGES.getMessage("method.from.superclass.is.hidden", name, superToCopy.getName(), overridingClassType.getClassName()),
                                     new UnableToProxyException(superToCopy));
      }
      //Safe to copy a call to this method!
      Type superType = Type.getType(superToCopy);
     
      // identify the target method parameters and return type
View Full Code Here

    try {
      Constructor<?> con = c.getDeclaredConstructor(Callable.class, InvocationListener.class);
      con.setAccessible(true);
      return con.newInstance(dispatcher, listener);
    } catch (Exception e) {
      throw new UnableToProxyException(ifaces.iterator().next(), e);
    }
  }
View Full Code Here

          }
        } else {
          //We need to generate a class that implements the interfaces (if any) and
          //has the classToProxy as a superclass
          if((classToProxy.getModifiers() & Modifier.FINAL) != 0) {
            throw new UnableToProxyException(classToProxy, "The class " + classToProxy
                + " does not implement all of the interfaces " + interfaces +
                " and is final. This means that we cannot create a proxy for both the class and all of the requested interfaces.");
          }
          proxyObject = InterfaceProxyGenerator.getProxyInstance(clientBundle,
              classToProxy, interfaces, dispatcher, listener);
View Full Code Here

        //a lower subclass
        classToProxy = potential;
      } else if (!!!potential.isAssignableFrom(classToProxy)){
        //classToProxy is not a subclass of potential - This is
        //an error, we can't be part of two hierarchies at once!
        throw new UnableToProxyException(classToProxy, "The requested classes "
            + classToProxy + " and " + potential + " are not in the same type hierarchy");
      }
    }
    return classToProxy;
  }
View Full Code Here

TOP

Related Classes of org.apache.aries.proxy.UnableToProxyException

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.