Examples of GlobalScope


Examples of jfun.yan.factory.GlobalScope

        yan.registerComponent(Components.bean(Yin.class).singleton().singleton()
            .withArgument(1, Components.value("bad ying"))
            .withProperties(new String[]{"yin","yang"},
                new Creator[]{Components.useType(IYin.class),
                Components.useType(Yang.class)}).guard());
        yan.registerComponent(Components.bean(Yang.class).singleton(new GlobalScope())
            .withProperties(props)
            .withProperty("nonexistent", Components.value("bad yang"))
            .singleton(new ThreadLocalScope()));

        IYin yin = (IYin) yan.getInstanceOfType(IYin.class);
View Full Code Here

Examples of jfun.yan.factory.GlobalScope

      testSerializable(prepSER_isSerializable(yan), yan);
      testSerializable(Components.value("hello"), yan);
      testSerializable(Components.ctor(ArrayList.class, null), yan);
      testSerializable(Components.ctor(ArrayList.class, null), yan);
      testSerializable(Components.method(this, "greet").withArgument(0, Components.value("Tom")).singleton().proxy(), yan);
      testSerializable(Components.method(this, "greet").withArgument(0, Components.value("Tom")).singleton(new GlobalScope()).proxy(), yan);
      testSerializable(Components.method(this, "greet").withArgument(0, Components.value("Tom")).singleton(new ThreadLocalScope()).proxy(), yan);
    }
View Full Code Here

Examples of jfun.yan.factory.GlobalScope

            params[0] = Components.value(iter.next()).guard().singleton();
            for (int i = 1; i < params.length; i++) {
              Component tmp = Components.value(wrapperDependencies[i - 1]);
              switch(i%3){//to test all singleton methods.
                case 0:
                 tmp = tmp.singleton(new GlobalScope());
                 break;
                case 1:
                  tmp = tmp.singleton(new ThreadLocalScope());
                case 2:
                  tmp = tmp.singleton();
View Full Code Here

Examples of jfun.yan.factory.GlobalScope

      Component b = Components.bean(B.class).singleton(new ThreadLocalScope());
      verifyABMutualRecursionForSingleton(a, b);
    }
    public void testMutualRecursionOnScopedSingletonBean()
    throws IntrospectionException{
      Component a = Components.bean(A.class).singleton(new GlobalScope());
      Component b = Components.bean(B.class).singleton(new ThreadLocalScope());
      verifyABMutualRecursionForSingleton(a, b);
    }
View Full Code Here

Examples of jfun.yan.factory.GlobalScope

      verifyABMutualRecursionForSingleton(a, b);
    }
    public void testManualMutualRecursionOnScopedSingletonBean()
    throws IntrospectionException{
      Component a = Components.bean(A.class)
        .withProperty("b", Components.useKey("b")).singleton(new GlobalScope());
      Component b = Components.bean(B.class)
        .withProperty("a", Components.useKey("a")).singleton(new ThreadLocalScope());
      verifyABMutualRecursionForSingleton(a, b);
    }
View Full Code Here

Examples of jfun.yan.factory.GlobalScope

      verifyABMutualRecursionForSingleton(a, b);
    }
    public void testManualMutualRecursionOnScopedSemiSingletonBean()
    throws IntrospectionException{
      Component a = Components.bean(A.class)
        .singleton(new GlobalScope()).withProperty("b", Components.useKey("b"));
      Component b = Components.bean(B.class)
        .singleton(new ThreadLocalScope()).withProperty("a", Components.useKey("a"));
      verifyABMutualRecursionForSingleton(a, b);
    }  
View Full Code Here

Examples of jfun.yan.factory.GlobalScope

        .singleton(new ThreadLocalScope()).withProperty("a", Components.useKey("a"));
      verifyABMutualRecursionForSingleton(a, b);
    }  
    public void testMutualRecursionOnScopedSingletonSingletonBean()
    throws IntrospectionException{
      Component a = Components.bean(A.class).singleton(new GlobalScope()).singleton();
      Component b = Components.bean(B.class).singleton(new ThreadLocalScope()).singleton();
      verifyABMutualRecursionForSingleton(a, b);
    }
View Full Code Here

Examples of jfun.yan.factory.GlobalScope

      Component b = Components.bean(B.class).singleton(new ThreadLocalScope()).singleton();
      verifyABMutualRecursionForSingleton(a, b);
    }
    public void testMutualRecursionOnSingletonScopedSingletonBean()
    throws IntrospectionException{
      Component a = Components.bean(A.class).singleton().singleton(new GlobalScope());
      Component b = Components.bean(B.class).singleton().singleton(new ThreadLocalScope()).singleton();
      verifyABMutualRecursionForSingleton(a, b);
    }
View Full Code Here

Examples of org.chromium.sdk.internal.protocolparser.dynamicimpl.JavaCodeGenerator.GlobalScope

  public GeneratedCodeMap generateStaticParser(StringBuilder stringBuilder, String packageName,
      String className, Collection<GeneratedCodeMap> basePackages) {
    JavaCodeGenerator generator = new JavaCodeGenerator.Impl();

    GlobalScope globalScope = generator.newGlobalScope(type2TypeHandler.values(), basePackages);

    FileScope fileScope = globalScope.newFileScope(stringBuilder);

    fileScope.startLine("// This is a generated source.\n");
    fileScope.startLine("// See " + this.getClass().getName() + " for details\n");
    fileScope.append("\n");
    fileScope.startLine("package " + packageName + ";\n");
View Full Code Here

Examples of org.lilystudio.javascript.scope.GlobalScope

      int mode) throws Exception {
    Parser parser = new Parser(new CompilerEnvirons(), reporter);
    ScriptOrFnNode root = parser.parse(reader, null, 1);

    Environment env = new Environment(keepLineno, mode);
    GlobalScope globalScope = new GlobalScope();
    StatementList statements = new StatementList();
    Node node = root.getFirstChild();
    while (node != null) {
      IStatement statement = Utils.createStatement(node, root, globalScope);
      statements.add(statement);
      node = statement.getNext();
    }
    if (statements.size() > 0) {
      globalScope.compress(statements.get(0) instanceof VariableStatement, env);
    }

    if (env.isKeepLineno()) {
      env.setLineno(1);
    }
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.