javax.enterprise.context.spi.Context.getScope()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(5.9k)|赞(0)|评价(0)|浏览(215)

本文整理了Java中javax.enterprise.context.spi.Context.getScope()方法的一些代码示例,展示了Context.getScope()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Context.getScope()方法的具体详情如下:
包路径:javax.enterprise.context.spi.Context
类名称:Context
方法名:getScope

Context.getScope介绍

[英]Get the scope type of the context object.
[中]获取上下文对象的作用域类型。

代码示例

代码示例来源:origin: org.apache.openwebbeans/openwebbeans-impl

@Override
public Class<? extends Annotation> getScope()
{
  return context.getScope();
}

代码示例来源:origin: com.caucho/resin

public void replaceContext(Context context)
{
 _contextMap.put(context.getScope(), context);
}

代码示例来源:origin: weld/core

@Override
public Class<? extends Annotation> getScope() {
  return delegate().getScope();
}

代码示例来源:origin: org.jboss.weld.se/weld-se

@Override
public Class<? extends Annotation> getScope() {
  return delegate().getScope();
}

代码示例来源:origin: weld/core

@Override
public Class<? extends Annotation> getScope() {
  return delegate().getScope();
}

代码示例来源:origin: weld/core

@Override
public Class<? extends Annotation> getScope() {
  return delegate().getScope();
}

代码示例来源:origin: org.jboss.weld.se/weld-se-shaded

@Override
public Class<? extends Annotation> getScope() {
  return delegate().getScope();
}

代码示例来源:origin: org.jboss.weld.servlet/weld-servlet-shaded

@Override
public Class<? extends Annotation> getScope() {
  return delegate().getScope();
}

代码示例来源:origin: CDISource/cdisource

public void register(AfterBeanDiscovery abd, ScopeController control, Context context) {
  abd.addContext(context);
  map.put(context.getScope(), control);
}

代码示例来源:origin: org.jboss.weld.se/weld-se-shaded

public void addContext(Context context) {
  Class<? extends Annotation> scope = context.getScope();
  if (isPassivatingScope(scope)) {
    context = PassivatingContextWrapper.wrap(context, services.get(ContextualStore.class));
  }
  List<Context> contextList = contexts.get(scope);
  if (contextList == null) {
    contextList = new CopyOnWriteArrayList<Context>();
    contexts.put(scope, contextList);
  }
  contextList.add(context);
}

代码示例来源:origin: org.jboss.weld.se/weld-se

public void addContext(Context context) {
  Class<? extends Annotation> scope = context.getScope();
  if (isPassivatingScope(scope)) {
    context = PassivatingContextWrapper.wrap(context, services.get(ContextualStore.class));
  }
  List<Context> contextList = contexts.get(scope);
  if (contextList == null) {
    contextList = new CopyOnWriteArrayList<Context>();
    contexts.put(scope, contextList);
  }
  contextList.add(context);
}

代码示例来源:origin: weld/core

public void addContext(Context context) {
  Class<? extends Annotation> scope = context.getScope();
  if (isPassivatingScope(scope)) {
    context = PassivatingContextWrapper.wrap(context, services.get(ContextualStore.class));
  }
  List<Context> contextList = contexts.get(scope);
  if (contextList == null) {
    contextList = new CopyOnWriteArrayList<Context>();
    contexts.put(scope, contextList);
  }
  contextList.add(context);
}

代码示例来源:origin: weld/core

public void addContext(Context context) {
  Class<? extends Annotation> scope = context.getScope();
  if (isPassivatingScope(scope)) {
    context = PassivatingContextWrapper.wrap(context, services.get(ContextualStore.class));
  }
  List<Context> contextList = contexts.get(scope);
  if (contextList == null) {
    contextList = new CopyOnWriteArrayList<Context>();
    contexts.put(scope, contextList);
  }
  contextList.add(context);
}

代码示例来源:origin: weld/core

public void addContext(Context context) {
  Class<? extends Annotation> scope = context.getScope();
  if (isPassivatingScope(scope)) {
    context = PassivatingContextWrapper.wrap(context, services.get(ContextualStore.class));
  }
  List<Context> contextList = contexts.get(scope);
  if (contextList == null) {
    contextList = new CopyOnWriteArrayList<Context>();
    contexts.put(scope, contextList);
  }
  contextList.add(context);
}

代码示例来源:origin: org.jboss.weld.servlet/weld-servlet-shaded

public void addContext(Context context) {
  Class<? extends Annotation> scope = context.getScope();
  if (isPassivatingScope(scope)) {
    context = PassivatingContextWrapper.wrap(context, services.get(ContextualStore.class));
  }
  List<Context> contextList = contexts.get(scope);
  if (contextList == null) {
    contextList = new CopyOnWriteArrayList<Context>();
    contexts.put(scope, contextList);
  }
  contextList.add(context);
}

代码示例来源:origin: org.apache.openwebbeans/openwebbeans-impl

public BeanManager addContext(Context context)
{
  addContext(context.getScope(), wrapCustomContext(context));
  return this;
}

代码示例来源:origin: org.jboss.cdi.tck/cdi-tck-impl

@Test
@SpecAssertion(section = CONTEXT, id = "ab")
public void testContextScopeType() {
  assert getCurrentManager().getContext(Dependent.class).getScope().equals(Dependent.class);
}

代码示例来源:origin: org.jboss.jsr299.tck/jsr299-tck-impl

@Test(groups = { "contexts" })
@SpecAssertion(section = "6.2", id = "ab")
public void testContextScopeType()
{
 assert getCurrentManager().getContext(Dependent.class).getScope().equals(Dependent.class);
}

代码示例来源:origin: org.jboss.weld.se/weld-se-shaded

@Override
public void addContext(Context context) {
  checkWithinObserverNotification();
  Preconditions.checkArgumentNotNull(context, "context");
  Class<? extends Annotation> scope = context.getScope();
  if (scope == null) {
    throw ContextLogger.LOG.contextHasNullScope(context);
  }
  if (!getBeanManager().isScope(scope)) {
    MetadataLogger.LOG.contextGetScopeIsNotAScope(scope, context);
  }
  if (scope == ApplicationScoped.class || scope == Dependent.class) {
    throw ContextLogger.LOG.cannotRegisterContext(scope, context);
  }
  getBeanManager().addContext(context);
  BootstrapLogger.LOG.addContext(getReceiver(), context);
}

代码示例来源:origin: weld/core

@Override
public void addContext(Context context) {
  checkWithinObserverNotification();
  Preconditions.checkArgumentNotNull(context, "context");
  Class<? extends Annotation> scope = context.getScope();
  if (scope == null) {
    throw ContextLogger.LOG.contextHasNullScope(context);
  }
  if (!getBeanManager().isScope(scope)) {
    MetadataLogger.LOG.contextGetScopeIsNotAScope(scope, context);
  }
  if (scope == ApplicationScoped.class || scope == Dependent.class) {
    throw ContextLogger.LOG.cannotRegisterContext(scope, context);
  }
  getBeanManager().addContext(context);
  BootstrapLogger.LOG.addContext(getReceiver(), context);
}

相关文章