Examples of IntrospectionException


Examples of org.apache.tuscany.sca.implementation.java.IntrospectionException

                    ) {
                    Service service;
                    try {
                        service = createService(clazz, interfaze, null);
                    } catch (InvalidInterfaceException e) {
                        throw new IntrospectionException(e);
                    }
                    type.getServices().add(service);
                }
            }
            return;
        }
       
        if (annotation.value().length == 0) {
            throw new IntrospectionException("[JCA90059] The array of interfaces or classes specified by the value attribute of the @Service annotation MUST contain at least one element");
        }
        Class<?>[] interfaces = annotation.value();
        if (annotation.names().length > 0) {
            if (annotation.names().length != interfaces.length) {
                throw new IntrospectionException("[JCA90050] The number of Strings in the names attribute array of the @Service annotation MUST match the number of elements in the value attribute array");
            }
            Set<String> names = new HashSet<String>();
            names.addAll(Arrays.asList(annotation.names()));
            if (names.size() != annotation.names().length) {
                throw new IntrospectionException("[JCA90060] The value of each element in the @Service names array MUST be unique amongst all the other element values in the array");
            }
        }

        //validate no scope on servce interface
        for (Class<?> iface : interfaces) {
            if (iface.getAnnotation(org.oasisopen.sca.annotation.Scope.class) != null) {
                throw new IntrospectionException("[JCA90041] @Scope annotation not allowed on service interface " + iface
                    .getName());
            }
        }
       
        //validate service methods implemented
        Method[] ms = clazz.getMethods();
        for (Class<?> iface : interfaces) {
            for (Method m : iface.getMethods()) {
                if (!hasMethod(m, ms)) {
                    throw new IntrospectionException("[JCA90042,JCI20002] Implementation missing service method " + m.getName() + " service interface " + iface.getName());
                }
            }
        }
       
        for (int i=0; i < interfaces.length; i++) {
            try {
                String name = (annotation.names().length > 0) ? annotation.names()[i] : null;
                Service service = createService(clazz, interfaces[i], name);
                type.getServices().add(service);
            } catch (InvalidInterfaceException e) {
                throw new IntrospectionException(e);
            }
        }
       
    }
View Full Code Here

Examples of org.apache.tuscany.sca.implementation.java.IntrospectionException

            if (callInterface.getCallbackClass() != null) {
                JavaInterface callbackInterface = javaInterfaceFactory.createJavaInterface(callInterface.getCallbackClass());
                reference.getInterfaceContract().setCallbackInterface(callbackInterface);
            }
        } catch (InvalidInterfaceException e) {
            throw new IntrospectionException(e);
        }
        return reference;
    }
View Full Code Here

Examples of org.apache.tuscany.sca.implementation.java.introspect.IntrospectionException

                if (interfaze.isAnnotationPresent(Remotable.class) || interfaze.isAnnotationPresent(Callback.class)) {
                    Service service;
                    try {
                        service = createService(interfaze);
                    } catch (InvalidInterfaceException e) {
                        throw new IntrospectionException(e);
                    }
                    type.getServices().add(service);
                }
            }
            return;
        }
        Class<?>[] interfaces = annotation.interfaces();
        if (interfaces.length == 0) {
            Class<?> interfaze = annotation.value();
            if (Void.class.equals(interfaze)) {
                throw new IllegalServiceDefinitionException("No interfaces specified");
            } else {
                interfaces = new Class<?>[1];
                interfaces[0] = interfaze;
            }
        }
        for (Class<?> interfaze : interfaces) {
            if (!interfaze.isInterface()) {
                throw new InvalidServiceType("Service must be an interface", interfaze);
            }
            Service service;
            try {
                service = createService(interfaze);
            } catch (InvalidInterfaceException e) {
                throw new IntrospectionException(e);
            }
            type.getServices().add(service);
        }
    }
View Full Code Here

Examples of org.crsh.cli.impl.descriptor.IntrospectionException

      Annotation ann) throws IntrospectionException {

    //
    if (argumentAnn != null) {
      if (optionAnn != null) {
        throw new IntrospectionException();
      }

      //
      return new BoundArgumentDescriptor(
          binding,
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.