Package org.osoa.sca.annotations

Examples of org.osoa.sca.annotations.Callback


    }

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

        Callback annotation = method.getAnnotation(Callback.class);
        if (annotation == null) {
            return;
        }
        if (method.getParameterTypes().length != 1) {
            throw new IllegalCallbackReferenceException("Setter must have one parameter", 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;
        }
        JavaElementImpl element = new JavaElementImpl(field);
        createCallback(type, element);
View Full Code Here

        processors.remove(processor);
    }

    public <T> JavaServiceContract introspect(Class<T> type) throws InvalidServiceContractException {
        Class<?> callbackClass = null;
        Callback callback = type.getAnnotation(Callback.class);
        if (callback != null && !Void.class.equals(callback.value())) {
            callbackClass = callback.value();
        } else if (callback != null && Void.class.equals(callback.value())) {
            IllegalCallbackException e = new IllegalCallbackException("No callback interface specified on annotation");
            e.setIdentifier(type.getName());
            throw e;
        }
        return introspect(type, callbackClass);
View Full Code Here

        service.setServiceContract(contract);
        return service;
    }

    public void processCallback(Class<?> interfaze, ServiceContract<?> contract) throws IllegalCallbackException {
        Callback callback = interfaze.getAnnotation(Callback.class);
        if (callback != null && !Void.class.equals(callback.value())) {
            Class<?> callbackClass = callback.value();
            contract.setCallbackClass(callbackClass);
            contract.setCallbackName(getBaseName(callbackClass));
        } else if (callback != null && Void.class.equals(callback.value())) {
            IllegalCallbackException e = new IllegalCallbackException(
                "Callback annotation must specify an interface on service type");
            e.setIdentifier(interfaze.getName());
            throw e;
        }
View Full Code Here

    public void visitMethod(CompositeComponent parent,
                            Method method,
                            PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>> type,
                            DeploymentContext context) throws ProcessingException {

        Callback annotation = method.getAnnotation(Callback.class);
        if (annotation == null) {
            return;
        }
        if (method.getParameterTypes().length != 1) {
            IllegalCallbackReferenceException e =
View Full Code Here

    public void visitField(CompositeComponent parent, Field field,
                           PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>> type,
                           DeploymentContext context) throws ProcessingException {

        Callback annotation = field.getAnnotation(Callback.class);
        if (annotation == null) {
            return;
        }
        String name = field.getName();
        JavaMappedService callbacksService = null;
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 (method.getParameterTypes().length != 1) {
            throw new IllegalCallbackReferenceException("Setter must have one parameter", 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;
        }
        JavaElementImpl element = new JavaElementImpl(field);
        createCallback(type, element);
View Full Code Here

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

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

TOP

Related Classes of org.osoa.sca.annotations.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.