Examples of Injection


Examples of jfun.yan.etc.injection.Injection

  }
  public void testBenchInjectionOnly() throws Exception{
    final Soo soo = new Soo();
    new Benchmark("Nuts: <injection>", LOOP){
      public void run() throws Exception {
        Injection inj = (Injection)yan.getInstance("injection");
        inj.inject(soo);
      }
    }.start(true);
   
    Noop bar = (Noop)yan.getInstance("complex_proxy");
    assertNotNull(bar);
View Full Code Here

Examples of mfinder.impl.Injector.Injection

            } else {
                Object value = Injector.stringToObject(prop.getAttribute(VALUE), pd.getPropertyType());
                if (value == null) {
                    LOG.warn("Not supported property [{}] for type [{}] in " + cls, pName, pd.getPropertyType());
                } else {
                    if (null != injections.put(pName, new Injection(pd.getWriteMethod(), value))) {
                        LOG.info("Override property [{}] value [{}] in " + cls, pName, prop.getAttribute(VALUE));
                    }
                }
            }
        }
View Full Code Here

Examples of org.apache.geronimo.j2ee.annotation.Injection

        for (Field field : fields) {
            Resource resource = (Resource) field.getAnnotation(Resource.class);
            Class type = getInjectionType(resource.type(), null, field);
            if (WebServiceContext.class == type) {
                holder.addInjection(field.getDeclaringClass().getName(),
                                    new Injection(field.getDeclaringClass().getName(), getInjectionName(null, field), ABSOLUTE_JNDI_NAME));
            }
        }
        List<Method> methods = finder.findAnnotatedMethods(Resource.class);
        for (Method method : methods) {
            Resource resource = (Resource) method.getAnnotation(Resource.class);
            Class type = getInjectionType(resource.type(), method, null);
            if (WebServiceContext.class == type) {
                holder.addInjection(method.getDeclaringClass().getName(),
                                    new Injection(method.getDeclaringClass().getName(), getInjectionName(method, null), ABSOLUTE_JNDI_NAME));
            }           
        }
    }
View Full Code Here

Examples of org.apache.geronimo.j2ee.annotation.Injection

    protected void addInjections(String jndiName, InjectionTargetType[] injectionTargetArray, Map sharedContext) {
        Holder holder = NamingBuilder.INJECTION_KEY.get(sharedContext);
        for (InjectionTargetType injectionTarget : injectionTargetArray) {
            String targetName = injectionTarget.getInjectionTargetName().getStringValue().trim();
            String targetClassName = injectionTarget.getInjectionTargetClass().getStringValue().trim();
            holder.addInjection(targetClassName, new Injection(targetClassName, targetName, jndiName));
        }
    }
View Full Code Here

Examples of org.apache.geronimo.j2ee.annotation.Injection

    protected void addInjections(String jndiName, InjectionTargetType[] injectionTargetArray, Map sharedContext) {
        Holder holder = NamingBuilder.INJECTION_KEY.get(sharedContext);
        for (InjectionTargetType injectionTarget : injectionTargetArray) {
            String targetName = injectionTarget.getInjectionTargetName().getStringValue().trim();
            String targetClassName = injectionTarget.getInjectionTargetClass().getStringValue().trim();
            holder.addInjection(targetClassName, new Injection(targetClassName, targetName, jndiName));
        }
    }
View Full Code Here

Examples of org.apache.geronimo.j2ee.annotation.Injection

    protected void addInjections(String jndiName, InjectionTargetType[] injectionTargetArray, Map sharedContext) {
        Holder holder = NamingBuilder.INJECTION_KEY.get(sharedContext);
        for (InjectionTargetType injectionTarget : injectionTargetArray) {
            String targetName = injectionTarget.getInjectionTargetName().getStringValue().trim();
            String targetClassName = injectionTarget.getInjectionTargetClass().getStringValue().trim();
            holder.addInjection(targetClassName, new Injection(targetClassName, targetName, jndiName));
        }
    }
View Full Code Here

Examples of org.apache.geronimo.j2ee.annotation.Injection

    protected void addInjections(String jndiName, ReferenceType type, Set<InjectionTarget> injectionTargets, Holder holder) {
        for (InjectionTarget injectionTarget : injectionTargets) {
            String targetName = injectionTarget.getInjectionTargetName().trim();
            String targetClassName = injectionTarget.getInjectionTargetClass().trim();
            holder.addInjection(targetClassName, new Injection(targetClassName, targetName, jndiName, type));
        }
    }
View Full Code Here

Examples of org.apache.geronimo.j2ee.annotation.Injection

        for (Field field : fields) {
            Resource resource = field.getAnnotation(Resource.class);
            Class type = getInjectionType(resource.type(), null, field);
            if (WebServiceContext.class == type) {
                holder.addInjection(field.getDeclaringClass().getName(),
                                    new Injection(field.getDeclaringClass().getName(), getInjectionName(null, field), BINDING_WEBSERVICE_CONTEXR_JNDI_NAME, ReferenceType.RESOURCE_ENV));
            }
        }
        List<Method> methods = finder.findAnnotatedMethods(Resource.class);
        for (Method method : methods) {
            Resource resource = method.getAnnotation(Resource.class);
            Class type = getInjectionType(resource.type(), method, null);
            if (WebServiceContext.class == type) {
                holder.addInjection(method.getDeclaringClass().getName(),
                                    new Injection(method.getDeclaringClass().getName(), getInjectionName(method, null), BINDING_WEBSERVICE_CONTEXR_JNDI_NAME, ReferenceType.RESOURCE_ENV));
            }
        }
    }
View Full Code Here

Examples of org.apache.geronimo.j2ee.annotation.Injection

    protected void addInjections(String jndiName, InjectionTargetType[] injectionTargetArray, Map sharedContext) {
        Holder holder = NamingBuilder.INJECTION_KEY.get(sharedContext);
        for (InjectionTargetType injectionTarget : injectionTargetArray) {
            String targetName = injectionTarget.getInjectionTargetName().getStringValue().trim();
            String targetClassName = injectionTarget.getInjectionTargetClass().getStringValue().trim();
            holder.addInjection(targetClassName, new Injection(targetClassName, targetName, jndiName));
        }
    }
View Full Code Here

Examples of org.apache.geronimo.j2ee.annotation.Injection

    protected void addInjections(String jndiName, InjectionTargetType[] injectionTargetArray, Map sharedContext) {
        Holder holder = NamingBuilder.INJECTION_KEY.get(sharedContext);
        for (InjectionTargetType injectionTarget : injectionTargetArray) {
            String targetName = injectionTarget.getInjectionTargetName().getStringValue().trim();
            String targetClassName = injectionTarget.getInjectionTargetClass().getStringValue().trim();
            holder.addInjection(targetClassName, new Injection(targetClassName, targetName, jndiName));
        }
    }
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.