Examples of ScopeContext


Examples of org.apache.tuscany.core.context.ScopeContext

    public DefaultScopeStrategy() {
    }

    public Map<Scope,ScopeContext> getScopeContexts(EventContext eventContext) {
        ScopeContext moduleScope = new ModuleScopeContext(eventContext);
        ScopeContext sessionScope = new SessionScopeContext(eventContext);
        ScopeContext requestScope = new RequestScopeContext(eventContext);
        ScopeContext statelessScope = new StatelessScopeContext(eventContext);
        ScopeContext aggregrateScope = new CompositeScopeContext(eventContext);
        Map<Scope,ScopeContext> scopes = new HashMap<Scope,ScopeContext>();
        scopes.put(Scope.MODULE,moduleScope);
        scopes.put(Scope.SESSION,sessionScope);
        scopes.put(Scope.REQUEST,requestScope);
        scopes.put(Scope.INSTANCE,statelessScope);
View Full Code Here

Examples of org.apache.tuscany.core.context.ScopeContext

    // ----------------------------------

    public Object locateService(String qualifiedName) throws ServiceUnavailableException {
        checkInit();
        QualifiedName qName = new QualifiedName(qualifiedName);
        ScopeContext scope = scopeIndex.get(qName.getPartName());
        if (scope == null) {
            throw new ServiceNotFoundException(qualifiedName);
        }
        Context ctx = scope.getContext(qName.getPartName());
        try {
            Object o = ctx.getInstance(qName);
            if (o == null) {
                throw new ServiceNotFoundException(qualifiedName);
            }
View Full Code Here

Examples of org.nutz.ioc.impl.ScopeContext

  @Test
  public void test_constants_context() {
    String s = "@Context.save('xx', 'tt', null)";
    ChainNode cn = N(s);
    assertEquals(s, cn.toString());
    IocMaking ing = new IocMaking(null, null, new ScopeContext("app"), null, null, null);
    assertFalse((Boolean) cn.eval(ing));
  }
View Full Code Here

Examples of org.nutz.ioc.impl.ScopeContext

    assertEquals("F2", f2.getName());
    Animal f22 = ioc.get(Animal.class, "f2");
    assertEquals("F2", f22.getName());
    assertFalse(f2 == f22);

    ScopeContext ic = new ScopeContext("MyScope");
    Map<String, ObjectProxy> map = ic.getObjs();
    f2 = ioc.get(Animal.class, "f2", ic);
    assertEquals("F2", f2.getName());
    f22 = ioc.get(Animal.class, "f2", ic);
    assertEquals("F2", f22.getName());
    assertTrue(f2 == f22);
View Full Code Here

Examples of org.nutz.ioc.impl.ScopeContext

    IocContext ic;
  }

  @Test
  public void test_refer_context() {
    IocContext context = new ScopeContext("abc");
    String json = "{obj:{singleton:false,fields:{ic:{refer:'$conText'}}}}";
    Ioc2 ioc = new NutIoc(new MapLoader(json), context, "abc");
    TestReferContext trc = ioc.get(TestReferContext.class);
    assertTrue(context == trc.ic);

    IocContext context2 = new ScopeContext("rrr");
    trc = ioc.get(TestReferContext.class, "obj", context2);
    assertTrue(trc.ic instanceof ComboContext);
  }
View Full Code Here

Examples of org.nutz.ioc.impl.ScopeContext

public class ComboIocProvider implements IocProvider {

  public Ioc create(NutConfig config, String[] args) {
    try {
      return new NutIoc(new ComboIocLoader(args), new ScopeContext("app"), "app");
    }
    catch (ClassNotFoundException e) {
      throw Lang.wrapThrow(e);
    }
  }
View Full Code Here

Examples of org.nutz.ioc.impl.ScopeContext

import org.nutz.mvc.NutConfig;

public class XmlIocProvider implements IocProvider {

  public Ioc create(NutConfig config, String[] args) {
    return new NutIoc(new XmlIocLoader(args), new ScopeContext("app"), "app");
  }
View Full Code Here

Examples of org.nutz.ioc.impl.ScopeContext

import org.nutz.mvc.NutConfig;

public class AnnotationIocProvider implements IocProvider {

  public Ioc create(NutConfig config, String[] args) {
    return new NutIoc(new AnnotationIocLoader(args), new ScopeContext("app"), "app");
  }
View Full Code Here

Examples of org.nutz.ioc.impl.ScopeContext

import org.nutz.mvc.NutConfig;

public class JsonIocProvider implements IocProvider {

  public Ioc create(NutConfig config, String[] args) {
    return new NutIoc(new JsonLoader(args), new ScopeContext("app"), "app");
  }
View Full Code Here

Examples of org.nutz.ioc.impl.ScopeContext

import org.nutz.mvc.NutConfig;

public class AnnotationIocProvider implements IocProvider {

    public Ioc create(NutConfig config, String[] args) {
        return new NutIoc(new AnnotationIocLoader(args), new ScopeContext("app"), "app");
    }
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.