org.jboss.webbeans.context
Class ContextMap

java.lang.Object
  extended by com.google.common.collect.ForwardingObject
      extended by com.google.common.collect.ForwardingMap<K,java.util.concurrent.Future<V>>
          extended by org.jboss.webbeans.util.ConcurrentCache<java.lang.Class<? extends java.lang.annotation.Annotation>,java.util.List<Context>>
              extended by org.jboss.webbeans.context.ContextMap
All Implemented Interfaces:
java.util.Map<java.lang.Class<? extends java.lang.annotation.Annotation>,java.util.concurrent.Future<java.util.List<Context>>>

public class ContextMap
extends ConcurrentCache<java.lang.Class<? extends java.lang.annotation.Annotation>,java.util.List<Context>>

A map from a scope to a list of contexts

Author:
Nicklas Karlsson, Pete Muir

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Constructor Summary
ContextMap()
           
 
Method Summary
 void add(Context context)
          Adds a context under a scope type Creates the list of contexts if it doesn't exist
 AbstractContext getBuiltInContext(java.lang.Class<? extends java.lang.annotation.Annotation> scopeType)
          Gets the dependent context
 java.util.List<Context> getContext(java.lang.Class<? extends java.lang.annotation.Annotation> scopeType)
          Gets the list of context with the given scope type
 java.lang.String toString()
           
 
Methods inherited from class org.jboss.webbeans.util.ConcurrentCache
delegate, getFuture, getValue, putIfAbsent, rethrow
 
Methods inherited from class com.google.common.collect.ForwardingMap
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ContextMap

public ContextMap()
Method Detail

getBuiltInContext

public AbstractContext getBuiltInContext(java.lang.Class<? extends java.lang.annotation.Annotation> scopeType)
Gets the dependent context

Parameters:
scopeType - The scope type to get
Returns:
The dependent context

getContext

public java.util.List<Context> getContext(java.lang.Class<? extends java.lang.annotation.Annotation> scopeType)
Gets the list of context with the given scope type

Parameters:
scopeType - The scope type to match
Returns:
A list of matching contexts. An empty list is returned if there are no matches

toString

public java.lang.String toString()
Overrides:
toString in class com.google.common.collect.ForwardingObject

add

public void add(Context context)
Adds a context under a scope type Creates the list of contexts if it doesn't exist

Parameters:
context - The new context


Copyright © 2008-2009. All Rights Reserved.