Examples of MethodInjector


Examples of com.github.overengineer.container.inject.MethodInjector

            }
            if (delegateMethod == null) {
                //TODO mrpvoe error message
                throw new IllegalArgumentException("No valid delegate methods could be found");
            }
            MethodInjector delegateMethodInjector = injectorFactory.create(delegateClass, delegateMethod, providedArgs);
            @SuppressWarnings("unchecked")
            ServiceDelegateInvoker<T> serviceDelegateInvoker = new ServiceDelegateInvoker<T>(delegateKey, delegateMethodInjector, provider);
            delegateInvokerCache.put(serviceMethod, serviceDelegateInvoker);
        }
    }
View Full Code Here

Examples of org.apache.tuscany.core.injection.MethodInjector

    }

    @SuppressWarnings("unchecked")
    public Injector<?> getInjector(ContextResolver resolver) {
        if (method != null) {
            return new MethodInjector(method, new AutowireObjectFactory(method.getParameterTypes()[0], resolver));
        } else {
            return new FieldInjector(field, new AutowireObjectFactory(field.getType(), resolver));
        }
    }
View Full Code Here

Examples of org.apache.tuscany.core.injection.MethodInjector

    }

    public Injector<?> getInjector(MonitorFactory factory) {
        if (method != null) {
            Object monitor = factory.getMonitor(method.getParameterTypes()[0]);
            return new MethodInjector(method, new SingletonObjectFactory<Object>(monitor));
        } else {
            Object monitor = factory.getMonitor(field.getType());
            return new FieldInjector(field, new SingletonObjectFactory<Object>(monitor));
        }
    }
View Full Code Here

Examples of org.apache.tuscany.core.injection.MethodInjector

        field = f;
    }

    public Injector<?> getInjector(ContextResolver resolver) {
        if (method != null) {
            return new MethodInjector(method, new ContextObjectFactory(resolver));
        } else {
            return new FieldInjector(field, new ContextObjectFactory(resolver));
        }
    }
View Full Code Here

Examples of org.apache.tuscany.core.injection.MethodInjector

            ObjectCreationException e = new ObjectCreationException("Unknown type");
            e.setIdentifier(type.getName());
            throw e;
        }
        if (method != null) {
            return new MethodInjector(method, factory);
        }
        return new FieldInjector(field, factory);
    }
View Full Code Here

Examples of org.apache.tuscany.core.injection.MethodInjector

        field = f;
    }

    public Injector<?> getInjector(ContextResolver resolver) {
        if (method != null) {
            return new MethodInjector(method, new ContextObjectFactory(resolver));
        } else {
            return new FieldInjector(field, new ContextObjectFactory(resolver));
        }
    }
View Full Code Here

Examples of org.apache.tuscany.core.injection.MethodInjector

        field = f;
    }

    public Injector<?> getEventInvoker(String name) {
        if (method != null) {
            return new MethodInjector(method, new SingletonObjectFactory<Object>(name));
        }else{
            return new FieldInjector(field, new SingletonObjectFactory<Object>(name));
        }
    }
View Full Code Here

Examples of org.apache.tuscany.core.injection.MethodInjector

                destroyInvoker = new MethodEventInvoker(method);
                continue;
            }
            ComponentName compName = method.getAnnotation(ComponentName.class);
            if (compName != null) {
                Injector injector = new MethodInjector(method, new SingletonObjectFactory(name));
                injectors.add(injector);
            }
            org.osoa.sca.annotations.Context context = method.getAnnotation(org.osoa.sca.annotations.Context.class);
            if (context != null) {
                Injector injector = new MethodInjector(method, new SingletonObjectFactory(moduleComponentContext));
                injectors.add(injector);
            }
        }
        boolean stateless = (scope == Scope.INSTANCE);
        return new JavaAtomicContext("foo", new PojoObjectFactory(JavaIntrospectionHelper
View Full Code Here

Examples of org.apache.tuscany.core.injection.MethodInjector

        source.setDestroyInvoker(destroyInvoker);
        JavaContextFactory target = new JavaContextFactory("target",constructor,scope);
        target.setInitInvoker(initInvoker);
        target.setDestroyInvoker(destroyInvoker);
        List<Injector> injectors = new ArrayList<Injector>();
        injectors.add(new MethodInjector(getPojo, new MockTargetFactory("target",context)));
        source.setSetters(injectors);
        List<ContextFactory<Context>> list = new ArrayList<ContextFactory<Context>>();
        list.add((ContextFactory)source);
        list.add((ContextFactory)target);
        return list;
View Full Code Here

Examples of org.apache.tuscany.core.injection.MethodInjector

        Injector injector = null;
        if (value instanceof DataObject) {
            if (field != null) {
                injector = new FieldInjector(field, new SDOObjectFactory((DataObject) value));
            } else {
                injector = new MethodInjector(method, new SDOObjectFactory((DataObject) value));
            }
        } else if (JavaIntrospectionHelper.isImmutable(type)) {
            if (field != null) {
                injector = new FieldInjector(field, new SingletonObjectFactory<Object>(value));
            } else {
                injector = new MethodInjector(method, new SingletonObjectFactory<Object>(value));
            }
        }
        return injector;

    }
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.