Package org.oasisopen.sca.annotation

Examples of org.oasisopen.sca.annotation.Callback


        service.getInterfaceContract().setInterface(javaInterface);
        return service;
    }

    private void processCallback(Class<?> interfaze, Contract contract) throws InvalidServiceTypeException {
        Callback callback = interfaze.getAnnotation(Callback.class);
        if (callback != null && !Void.class.equals(callback.value())) {
            Class<?> callbackClass = callback.value();
            JavaInterface javaInterface;
            try {
                javaInterface = javaInterfaceFactory.createJavaInterface(callbackClass);
                contract.getInterfaceContract().setCallbackInterface(javaInterface);
            } catch (InvalidInterfaceException e) {
                throw new InvalidServiceTypeException("Invalid callback interface "+callbackClass, interfaze);
            }
        } else if (callback != null && Void.class.equals(callback.value())) {
            throw new InvalidServiceTypeException("No callback interface specified on annotation", interfaze);
        }
    }
View Full Code Here


    }

    @Override
    public void visitMethod(Method method, JavaImplementation type) throws IntrospectionException {

        Callback annotation = method.getAnnotation(Callback.class);
        if (annotation == null) {
            return;
        }
        if( type.getJavaScope() == JavaScopeImpl.COMPOSITE ) {
          throw new IllegalCallbackReferenceException("[JCA90057] @Callback on field or method cannot be used for a class with @Scope(COMPOSITE): " + type.getName() + "." + method.getName());
        }
       
        if (!(annotation.value() == null || annotation.value() == Void.class)) {
            throw new IllegalCallbackReferenceException("[JCA90046] @Callback on field of method must not have any parameters: " + type.getName() + "." + method.getName());
        }
       
        if(Modifier.isPrivate(method.getModifiers())) {
            throw new IllegalCallbackReferenceException("Illegal annotation @Callback found on "+method, method);
View Full Code Here

    }

    @Override
    public void visitField(Field field, JavaImplementation type) throws IntrospectionException {

        Callback annotation = field.getAnnotation(Callback.class);
        if (annotation == null) {
            return;
        }
        if( type.getJavaScope() == JavaScopeImpl.COMPOSITE ) {
          throw new IllegalCallbackReferenceException("[JCA90057] @Callback on field or method cannot be used for a class with @Scope(COMPOSITE): " + type.getName() + "." + field.getName());
        }
        if (!(annotation.value() == null || annotation.value() == Void.class)) {
            throw new IllegalCallbackReferenceException("[JCA90046] @Callback on field of method must not have any parameters: " + type.getName() + "." + field.getName());
        }
        if(Modifier.isPrivate(field.getModifiers())) {
            throw new IllegalCallbackReferenceException("Illegal annotation @Callback found on "+field, field);
        }
View Full Code Here

        service.getInterfaceContract().setInterface(javaInterface);
        return service;
    }

    private void processCallback(Class<?> interfaze, Contract contract) throws InvalidServiceTypeException {
        Callback callback = interfaze.getAnnotation(Callback.class);
        if (callback != null && !Void.class.equals(callback.value())) {
            Class<?> callbackClass = callback.value();
            JavaInterface javaInterface;
            try {
                javaInterface = javaFactory.createJavaInterface(callbackClass);
                contract.getInterfaceContract().setCallbackInterface(javaInterface);
            } catch (InvalidInterfaceException e) {
                throw new InvalidServiceTypeException("Invalid callback interface "+callbackClass, interfaze);
            }
        } else if (callback != null && Void.class.equals(callback.value())) {
            throw new InvalidServiceTypeException("No callback interface specified on annotation", interfaze);
        }
    }
View Full Code Here

    }

    @Override
    public void visitMethod(Method method, JavaImplementation type) throws IntrospectionException {

        Callback annotation = method.getAnnotation(Callback.class);
        if (annotation == null) {
            return;
        }
       
        if (!(annotation.value() == null || annotation.value() == Void.class)) {
            throw new IllegalCallbackReferenceException("[JCA90046] @Callback on field of method must not have any parameters: " + type.getName() + "." + method.getName());
        }
       
        if(Modifier.isPrivate(method.getModifiers())) {
            throw new IllegalCallbackReferenceException("Illegal annotation @Callback found on "+method, method);
View Full Code Here

    }

    @Override
    public void visitField(Field field, JavaImplementation type) throws IntrospectionException {

        Callback annotation = field.getAnnotation(Callback.class);
        if (annotation == null) {
            return;
        }
        if (!(annotation.value() == null || annotation.value() == Void.class)) {
            throw new IllegalCallbackReferenceException("[JCA90046] @Callback on field of method must not have any parameters: " + type.getName() + "." + field.getName());
        }
        if(Modifier.isPrivate(field.getModifiers())) {
            throw new IllegalCallbackReferenceException("Illegal annotation @Callback found on "+field, field);
        }
View Full Code Here

        service.getInterfaceContract().setInterface(javaInterface);
        return service;
    }

    private void processCallback(Class<?> interfaze, Contract contract) throws InvalidServiceTypeException {
        Callback callback = interfaze.getAnnotation(Callback.class);
        if (callback != null && !Void.class.equals(callback.value())) {
            Class<?> callbackClass = callback.value();
            JavaInterface javaInterface;
            try {
                javaInterface = javaInterfaceFactory.createJavaInterface(callbackClass);
                contract.getInterfaceContract().setCallbackInterface(javaInterface);
            } catch (InvalidInterfaceException e) {
                throw new InvalidServiceTypeException("Invalid callback interface "+callbackClass, interfaze);
            }
        } else if (callback != null && Void.class.equals(callback.value())) {
            throw new InvalidServiceTypeException("No callback interface specified on annotation", interfaze);
        }
    }
View Full Code Here

    }

    @Override
    public void visitMethod(Method method, JavaImplementation type) throws IntrospectionException {

        Callback annotation = method.getAnnotation(Callback.class);
        if (annotation == null) {
            return;
        }
        if( type.getJavaScope() == JavaScopeImpl.COMPOSITE ) {
          throw new IllegalCallbackReferenceException("[JCA90057] @Callback on field or method cannot be used for a class with @Scope(COMPOSITE): " + type.getName() + "." + method.getName());
        }
       
        if (!(annotation.value() == null || annotation.value() == Void.class)) {
            throw new IllegalCallbackReferenceException("[JCA90046] @Callback on field of method must not have any parameters: " + type.getName() + "." + method.getName());
        }
       
        if(Modifier.isPrivate(method.getModifiers())) {
            throw new IllegalCallbackReferenceException("Illegal annotation @Callback found on "+method, method);
View Full Code Here

    }

    @Override
    public void visitField(Field field, JavaImplementation type) throws IntrospectionException {

        Callback annotation = field.getAnnotation(Callback.class);
        if (annotation == null) {
            return;
        }
        if( type.getJavaScope() == JavaScopeImpl.COMPOSITE ) {
          throw new IllegalCallbackReferenceException("[JCA90057] @Callback on field or method cannot be used for a class with @Scope(COMPOSITE): " + type.getName() + "." + field.getName());
        }
        if (!(annotation.value() == null || annotation.value() == Void.class)) {
            throw new IllegalCallbackReferenceException("[JCA90046] @Callback on field of method must not have any parameters: " + type.getName() + "." + field.getName());
        }
        if(Modifier.isPrivate(field.getModifiers())) {
            throw new IllegalCallbackReferenceException("Illegal annotation @Callback found on "+field, field);
        }
View Full Code Here

        service.getInterfaceContract().setInterface(javaInterface);
        return service;
    }

    private void processCallback(Class<?> interfaze, Contract contract) throws InvalidServiceTypeException {
        Callback callback = interfaze.getAnnotation(Callback.class);
        if (callback != null && !Void.class.equals(callback.value())) {
            Class<?> callbackClass = callback.value();
            JavaInterface javaInterface;
            try {
                javaInterface = javaInterfaceFactory.createJavaInterface(callbackClass);
                contract.getInterfaceContract().setCallbackInterface(javaInterface);
            } catch (InvalidInterfaceException e) {
                throw new InvalidServiceTypeException("Invalid callback interface "+callbackClass, interfaze);
            }
        } else if (callback != null && Void.class.equals(callback.value())) {
            throw new InvalidServiceTypeException("No callback interface specified on annotation", interfaze);
        }
    }
View Full Code Here

TOP

Related Classes of org.oasisopen.sca.annotation.Callback

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.