Package org.osoa.sca.annotations

Examples of org.osoa.sca.annotations.Init


                injectors.add(injector);
            }
        }
        for (Method method : methods) {
            // FIXME Java5
            Init init = method.getAnnotation(Init.class);
            if (init != null && initInvoker == null) {
                initInvoker = new MethodEventInvoker(method);
                eagerInit = init.eager();
                continue;
            }
            Destroy destroy = method.getAnnotation(Destroy.class);
            if (destroy != null && destroyInvoker == null) {
                destroyInvoker = new MethodEventInvoker(method);
View Full Code Here


    public InitProcessor() {
    }

    public void visitMethod(Method method, ComponentType type) throws ConfigurationLoadException {
        Init init = method.getAnnotation(Init.class);
        if (init == null) {
            return;
        }
        if (method.getParameterTypes().length != 0) {
            throw new ConfigurationLoadException("Initialize methods cannot take parameters");
        }
        type.getExtensibilityElements().add(new InitInvokerExtensibilityElement(method, init.eager()));
    }
View Full Code Here

        super(factory);
    }

    @Override
    public void visitMethod(Method method, JavaImplementation type) throws IntrospectionException {
        Init annotation = method.getAnnotation(Init.class);
        if (annotation == null) {
            return;
        }
        if (method.getParameterTypes().length != 0) {
            throw new IllegalInitException("Initializer must not have argments", method);
View Full Code Here

        super(factory);
    }

    @Override
    public void visitMethod(Method method, JavaImplementation type) throws IntrospectionException {
        Init annotation = method.getAnnotation(Init.class);
        if (annotation == null) {
            return;
        }
        if (method.getParameterTypes().length != 0) {
            throw new IllegalInitException("Initializer must not have argments", method);
View Full Code Here

    public InitProcessor(AssemblyFactory factory) {
        super(factory);
    }

    public void visitMethod(Method method, JavaImplementation type) throws IntrospectionException {
        Init annotation = method.getAnnotation(Init.class);
        if (annotation == null) {
            return;
        }
        if (method.getParameterTypes().length != 0) {
            throw new IllegalInitException("Initializer must not have argments", method);
View Full Code Here

        super(factory);
    }

    @Override
    public void visitMethod(Method method, JavaImplementation type) throws IntrospectionException {
        Init annotation = method.getAnnotation(Init.class);
        if (annotation == null) {
            return;
        }
        if (method.getParameterTypes().length != 0) {
            throw new IllegalInitException("Initializer must not have argments", method);
View Full Code Here

    public InitProcessor(AssemblyFactory factory) {
        super(factory);
    }

    public void visitMethod(Method method, JavaImplementation type) throws IntrospectionException {
        Init annotation = method.getAnnotation(Init.class);
        if (annotation == null) {
            return;
        }
        if (method.getParameterTypes().length != 0) {
            throw new IllegalInitException("Initializer must not have argments", method);
View Full Code Here

        super(factory);
    }

    @Override
    public void visitMethod(Method method, JavaImplementation type) throws IntrospectionException {
        Init annotation = method.getAnnotation(Init.class);
        if (annotation == null) {
            return;
        }
        if (method.getParameterTypes().length != 0) {
            throw new IllegalInitException("Initializer must not have argments", method);
View Full Code Here

    public void visitMethod(CompositeComponent parent, Method method,
                            PojoComponentType<JavaMappedService, JavaMappedReference, JavaMappedProperty<?>> type,
                            DeploymentContext context)
        throws ProcessingException {
        Init annotation = method.getAnnotation(Init.class);
        if (annotation == null) {
            return;
        }
        if (method.getParameterTypes().length != 0) {
            IllegalInitException e = new IllegalInitException("Initializer must not have argments");
            e.setIdentifier(method.toString());
            throw e;
        }
        if (type.getInitMethod() != null) {
            throw new DuplicateInitException("More than one initializer found on implementaton");
        }
        if (Modifier.isProtected(method.getModifiers())) {
            method.setAccessible(true);
        }
        type.setEagerInit(annotation.eager());
        type.setInitMethod(method);
    }
View Full Code Here

                if (method.getParameterTypes().length == 1) {
                    if (interfaze.isAssignableFrom(method.getParameterTypes()[0])) {
                        setter = method;
                    }
                }
                Init init;
                if ((init = method.getAnnotation(Init.class)) != null) {
                    sourceConfig.setInitLevel(init.eager() ? 50 : 0);
                    sourceConfig.setInitInvoker(new MethodEventInvoker<Object>(method));

                } else if (method.getAnnotation(Destroy.class) != null) {
                    sourceConfig.setDestroyInvoker(new MethodEventInvoker<Object>(method));
                }
View Full Code Here

TOP

Related Classes of org.osoa.sca.annotations.Init

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.