Top Inners Fields Constructors Methods
org.glassfish.gmbal.typelib

public Class TypeEvaluator

extends Object
Class Inheritance
Annotations
@TraceTypelib
@TraceTypelibEval
Static Imports
java.lang.reflect.Modifier.PUBLIC

Author
ken

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class
private static class

Field Summary

Modifier and TypeField and Description
private static Map<Class<T>, EvaluatedType>
private static List<EvaluatedType>
private static Map<TypeEvaluator.EvalMapKey, EvaluatedClassDeclaration>
private static Map<Class<?>, EvaluatedType>
private static final String
ORG_GLASSFISH_GMBAL_NO_MULTIPLE_UPPER_BOUNDS_EXCEPTION

For ORB compatibility with JDK11+ JDKs see https://github.com/eclipse-ee4j/orb-gmbal/issues/22

In short, the ORB references com.sun.corba.ee.spi.orb.ORB, which references com.sun.corba.ee.impl.corba.TypeCodeFactory which eventually references com.sun.corba.ee.spi.legacy.connection.Connection.getSocket and java.net.Socket.checkPermission(java.net.SocketImpl).

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static synchronized void
public static synchronized int
private static List<Field>
getDeclaredFields(final Class<?> cls)

private static Method
getDeclaredMethod(final Class<?> cls, final String name, final Class<?>... sig)

private static List<Method>
getDeclaredMethods(final Class<?> cls)

private static EvaluatedClassDeclaration
getECD(Class<T> cls)

public static synchronized EvaluatedType

Returns:

The evaluated type
getEvaluatedType
(Class<T>
The java type to evaluate
cls
)

Given any generic java type, evaluate all of its type bounds and return an evaluated type.

private static EvaluatedType

Returns:

an EvaluatedType, if cls is on the immutable list; otherwise null.
getImmutableEvaluatedType
(Class<?> cls)

Return the EvaluatedType corresponding to cls if cls represents an immutable type, otherwise return null.

private static void
public static synchronized void
setDebugLevel(int level)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

classMapback to summary
private static Map<Class<T>, EvaluatedType> classMap
emptyETListback to summary
private static List<EvaluatedType> emptyETList
evalClassMapback to summary
private static Map<TypeEvaluator.EvalMapKey, EvaluatedClassDeclaration> evalClassMap
immutableTypesback to summary
private static Map<Class<?>, EvaluatedType> immutableTypes
ORG_GLASSFISH_GMBAL_NO_MULTIPLE_UPPER_BOUNDS_EXCEPTIONback to summary
private static final String ORG_GLASSFISH_GMBAL_NO_MULTIPLE_UPPER_BOUNDS_EXCEPTION

For ORB compatibility with JDK11+ JDKs see https://github.com/eclipse-ee4j/orb-gmbal/issues/22

In short, the ORB references com.sun.corba.ee.spi.orb.ORB, which references com.sun.corba.ee.impl.corba.TypeCodeFactory which eventually references com.sun.corba.ee.spi.legacy.connection.Connection.getSocket and java.net.Socket.checkPermission(java.net.SocketImpl).

Now SocketImpl contains a method "<S extends SocketImpl & PlatformSocketImpl> S createPlatformSocketImpl", which causes the ORB to crash completely. Setting a system property with this string ignores the fact GMBAL doesn't support multiple upper bounds.

Constructor Detail

TypeEvaluatorback to summary
private TypeEvaluator()

Method Detail

dumpEvalClassMapback to summary
public static synchronized void dumpEvalClassMap()
evalClassMapSizeback to summary
public static synchronized int evalClassMapSize()
getDeclaredFieldsback to summary
private static List<Field> getDeclaredFields(final Class<?> cls)
getDeclaredMethodback to summary
private static Method getDeclaredMethod(final Class<?> cls, final String name, final Class<?>... sig) throws NoSuchMethodException, PrivilegedActionException
getDeclaredMethodsback to summary
private static List<Method> getDeclaredMethods(final Class<?> cls)
getECDback to summary
private static EvaluatedClassDeclaration getECD(Class<T> cls)
getEvaluatedTypeback to summary
public static synchronized EvaluatedType getEvaluatedType(Class<T> cls)

Given any generic java type, evaluate all of its type bounds and return an evaluated type.

Parameters
cls:Class<T>

The java type to evaluate

Returns:EvaluatedType

The evaluated type

getImmutableEvaluatedTypeback to summary
private static EvaluatedType getImmutableEvaluatedType(Class<?> cls)

Return the EvaluatedType corresponding to cls if cls represents an immutable type, otherwise return null.

Returns:EvaluatedType

an EvaluatedType, if cls is on the immutable list; otherwise null.

mapPutback to summary
private static void mapPut(EvaluatedClassDeclaration ecd, Class<T> cls)
Annotations
@TraceTypelib
setDebugLevelback to summary
public static synchronized void setDebugLevel(int level)
org.glassfish.gmbal.typelib back to summary

private Class TypeEvaluator.EvalMapKey

extends Pair<Class<?>, List<EvaluatedType>>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final TypeEvaluator.EvalMapKey
Inherited from org.glassfish.pfl.basic.contain.Pair:
_first_second

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from org.glassfish.pfl.basic.contain.Pair:
equalsfirsthashCodesecondtoString

Field Detail

OBJECT_KEYback to summary
public static final TypeEvaluator.EvalMapKey OBJECT_KEY

Constructor Detail

EvalMapKeyback to summary
public EvalMapKey(Class<?> cls, List<EvaluatedType> decls)
org.glassfish.gmbal.typelib back to summary

private Class TypeEvaluator.PartialDefinitions

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private Map<Pair<Class<?>, List<Type>>, EvaluatedType>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public EvaluatedType
get(Class<T> cls)

public EvaluatedType
private Pair<Class<?>, List<Type>>
getKey(Class<T> cls)

private Pair<Class<?>, List<Type>>
public void
put(Class<T> cls, EvaluatedType et)

public void
public void
remove(Class<T> cls)

public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

tableback to summary
private Map<Pair<Class<?>, List<Type>>, EvaluatedType> table

Constructor Detail

PartialDefinitionsback to summary
private PartialDefinitions()

Method Detail

getback to summary
public EvaluatedType get(Class<T> cls)
getback to summary
public EvaluatedType get(ParameterizedType pt)
getKeyback to summary
private Pair<Class<?>, List<Type>> getKey(Class<T> cls)
getKeyback to summary
private Pair<Class<?>, List<Type>> getKey(ParameterizedType pt)
putback to summary
public void put(Class<T> cls, EvaluatedType et)
putback to summary
public void put(ParameterizedType pt, EvaluatedType et)
removeback to summary
public void remove(Class<T> cls)
removeback to summary
public void remove(ParameterizedType pt)
org.glassfish.gmbal.typelib back to summary

private Class TypeEvaluator.TypeEvaluationVisitor

extends Object
Class Inheritance
  • java.lang.Object
  • org.glassfish.gmbal.typelib.TypeEvaluator.TypeEvaluationVisitor
Annotations
@TraceTypelibEval
@TraceTypelib

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
private final Display<String, EvaluatedType>
private final TypeEvaluator.PartialDefinitions

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
describe(String msg, Object data)

public EvaluatedType
private void
private TypeEvaluator.TypeEvaluationVisitor.OrderedResult<String, EvaluatedType>
getBindings(Class<T> decl)

private TypeEvaluator.TypeEvaluationVisitor.OrderedResult<String, EvaluatedType>
private EvaluatedType
private List<Type>
private EvaluatedType
private void
private void
processClass(final EvaluatedClassDeclaration newDecl, final Map<String, EvaluatedType> bindings, final Class<T> decl)

private EvaluatedType
private EvaluatedFieldDeclaration
private EvaluatedType
private EvaluatedMethodDeclaration
private EvaluatedType
private EvaluatedType
private EvaluatedType
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

displayback to summary
private final Display<String, EvaluatedType> display
partialDefinitionsback to summary
private final TypeEvaluator.PartialDefinitions partialDefinitions

Constructor Detail

TypeEvaluationVisitorback to summary
public TypeEvaluationVisitor()

Method Detail

describeback to summary
private void describe(String msg, Object data)
Annotations
@InfoMethod
evaluateTypeback to summary
public EvaluatedType evaluateType(Object type)
Annotations
@TraceTypelibEval
fieldExceptionback to summary
private void fieldException(Exception exc, Field fld)
Annotations
@InfoMethod
getBindingsback to summary
private TypeEvaluator.TypeEvaluationVisitor.OrderedResult<String, EvaluatedType> getBindings(Class<T> decl)
getBindingsback to summary
private TypeEvaluator.TypeEvaluationVisitor.OrderedResult<String, EvaluatedType> getBindings(ParameterizedType pt)
getCorrectDeclarationback to summary
private EvaluatedType getCorrectDeclaration(TypeEvaluator.TypeEvaluationVisitor.OrderedResult<String, EvaluatedType> bindings, Class<T> decl, EvaluatedClassDeclaration newDecl)
Annotations
@TraceTypelib
getInheritanceback to summary
private List<Type> getInheritance(Class<T> cls)
Annotations
@TraceTypelib
lookupback to summary
private EvaluatedType lookup(TypeVariable<D extends GenericDeclaration> tvar)
Annotations
@TraceTypelib
messageback to summary
private void message(String msg)
Annotations
@InfoMethod
processClassback to summary
private void processClass(final EvaluatedClassDeclaration newDecl, final Map<String, EvaluatedType> bindings, final Class<T> decl)
Annotations
@TraceTypelib
visitClassDeclarationback to summary
private EvaluatedType visitClassDeclaration(Class<T> decl)
Annotations
@TraceTypelib
visitFieldDeclarationback to summary
private EvaluatedFieldDeclaration visitFieldDeclaration(final EvaluatedClassDeclaration cdecl, final Field fld)
Annotations
@TraceTypelib
visitGenericArrayTypeback to summary
private EvaluatedType visitGenericArrayType(GenericArrayType at)
Annotations
@TraceTypelib
visitMethodDeclarationback to summary
private EvaluatedMethodDeclaration visitMethodDeclaration(final EvaluatedClassDeclaration cdecl, final Method mdecl)
Annotations
@TraceTypelib
visitParameterizedTypeback to summary
private EvaluatedType visitParameterizedType(ParameterizedType pt)
Annotations
@TraceTypelib
visitTypeVariableback to summary
private EvaluatedType visitTypeVariable(TypeVariable<D extends GenericDeclaration> tvar)
Annotations
@TraceTypelib
visitWildcardTypeback to summary
private EvaluatedType visitWildcardType(WildcardType wt)
Annotations
@TraceTypelib
org.glassfish.gmbal.typelib back to summary

public Class TypeEvaluator.TypeEvaluationVisitor.OrderedResult<K, V>

extends Object
Class Inheritance
  • java.lang.Object
  • org.glassfish.gmbal.typelib.TypeEvaluator.TypeEvaluationVisitor.OrderedResult

Field Summary

Modifier and TypeField and Description
private List<V>
private Map<K, V>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
add(K key, V value)

public List<V>
public Map<K, V>
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

listback to summary
private List<V> list
mapback to summary
private Map<K, V> map

Constructor Detail

OrderedResultback to summary
public OrderedResult()

Method Detail

addback to summary
public void add(K key, V value)
getListback to summary
public List<V> getList()
getMapback to summary
public Map<K, V> getMap()