com.sun.ejb.containers.util
Class MethodMap

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap
          extended by com.sun.ejb.containers.util.MethodMap
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map

public final class MethodMap
extends java.util.HashMap

This is an optimized map for resolving java.lang.reflect.Method objects. Doing a method lookup, even on an unsynchronized Map, can be an expensive operation, in many cases taking multiple microseconds. In most situations this overhead is negligible, but it can be noticeable when performed in the common path of a local ejb invocation, where our goal is to be as fast as a raw java method call. A MethodMap must be created with an existing Map and is immutable after construction(except for clear()). It does not support the optional Map operations put, putAll, and remove. NOTE that these operations could be implemented but are not necessary at this point since the main use is for the container's method info, which is invariant after initialization. As this is a map for Method objects, null keys are not supported. This map is unsynchronized.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>
 
Constructor Summary
MethodMap(java.util.Map methodMap)
           
MethodMap(java.util.Map methodMap, int numBuckets)
           
 
Method Summary
 void clear()
           
 java.lang.Object get(java.lang.reflect.Method m, int numParams)
           
 java.lang.Object get(java.lang.Object key)
           
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
           
 void putAll(java.util.Map t)
           
 java.lang.Object remove(java.lang.Object key)
           
 
Methods inherited from class java.util.HashMap
clone, containsKey, containsValue, entrySet, isEmpty, keySet, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

MethodMap

public MethodMap(java.util.Map methodMap)

MethodMap

public MethodMap(java.util.Map methodMap,
                 int numBuckets)
Method Detail

put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object value)
Specified by:
put in interface java.util.Map
Overrides:
put in class java.util.HashMap

putAll

public void putAll(java.util.Map t)
Specified by:
putAll in interface java.util.Map
Overrides:
putAll in class java.util.HashMap

remove

public java.lang.Object remove(java.lang.Object key)
Specified by:
remove in interface java.util.Map
Overrides:
remove in class java.util.HashMap

get

public java.lang.Object get(java.lang.Object key)
Specified by:
get in interface java.util.Map
Overrides:
get in class java.util.HashMap

get

public java.lang.Object get(java.lang.reflect.Method m,
                            int numParams)

clear

public void clear()
Specified by:
clear in interface java.util.Map
Overrides:
clear in class java.util.HashMap


Copyright © 2012 GlassFish Community. All Rights Reserved.