org.jboss.cache.aop
Class CachedType

java.lang.Object
  extended by org.jboss.cache.aop.CachedType

public class CachedType
extends java.lang.Object

Represent a cached object type, e.g., whether it is primitive or not. Note: need to pay special attention not to leak classloader.

Author:
Harald Gliebe, Ben Wang

Field Summary
protected static java.util.Map CachedClassWithAnnotation_
           
protected static java.util.Map CachedClassWithNoAnnotation_
           
protected  java.util.Map fieldMap
           
protected  java.util.List fields
           
protected  boolean immediate
           
protected static java.util.Set immediates
           
protected  boolean immutable
           
protected  java.lang.ref.WeakReference type
           
 
Constructor Summary
CachedType()
           
CachedType(java.lang.Class type)
           
 
Method Summary
protected  java.lang.String attributeName(java.lang.String methodName)
           
protected  CachedAttribute getAttribute(java.lang.reflect.Method method, java.util.Map map, boolean create)
           
 java.lang.reflect.Field getField(java.lang.String name)
           
 java.util.List getFields()
          A List of all of this type's replicatable fields.
 java.util.Iterator getFieldsIterator()
          Returns an iterator over this CachedType's fields.
 java.lang.Class getType()
           
protected static boolean hasAnnotation(java.lang.Class clazz, org.jboss.aop.Advisor advisor, CachedType type)
          We check whether this class has any field annotation declaration.
protected static boolean hasFieldAnnotation(java.lang.reflect.Field field, org.jboss.aop.Advisor advisor)
           
static boolean hasSerializableAnnotation(java.lang.reflect.Field field, org.jboss.aop.Advisor advisor)
           
static boolean hasSerializableAnnotation(org.jboss.aop.joinpoint.FieldInvocation invocation)
           
protected static boolean hasTransientAnnotation(java.lang.reflect.Field field, org.jboss.aop.Advisor advisor)
           
protected static boolean hasTransientAnnotation(org.jboss.aop.joinpoint.FieldInvocation invocation)
          Check if we have @Transient annotation.
protected  boolean isGet(java.lang.reflect.Method method)
           
 boolean isImmediate()
           
static boolean isImmediate(java.lang.Class clazz)
           
 boolean isImmutable()
           
static boolean isNonReplicatable(org.jboss.aop.joinpoint.FieldInvocation fieldInvocation)
           
protected static boolean isPrimitiveNonReplicatable(java.lang.reflect.Field f)
           
protected  boolean isSet(java.lang.reflect.Method method)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

immediates

protected static final java.util.Set immediates

type

protected java.lang.ref.WeakReference type

immutable

protected boolean immutable

immediate

protected boolean immediate

CachedClassWithNoAnnotation_

protected static java.util.Map CachedClassWithNoAnnotation_

CachedClassWithAnnotation_

protected static java.util.Map CachedClassWithAnnotation_

fields

protected java.util.List fields

fieldMap

protected java.util.Map fieldMap
Constructor Detail

CachedType

public CachedType()

CachedType

public CachedType(java.lang.Class type)
Method Detail

getType

public java.lang.Class getType()

isImmediate

public boolean isImmediate()

isImmediate

public static boolean isImmediate(java.lang.Class clazz)

isImmutable

public boolean isImmutable()

getFields

public java.util.List getFields()
A List of all of this type's replicatable fields.

See Also:
isPrimitiveNonReplicatable(Field)

getFieldsIterator

public java.util.Iterator getFieldsIterator()
Returns an iterator over this CachedType's fields. If an iterator is all that is wanted, this is more efficient than calling getFields().iterator(), as it saves the step of making a defensive copy of the fields list. Note that the iterator does not support remove()


getField

public java.lang.reflect.Field getField(java.lang.String name)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hasAnnotation

protected static boolean hasAnnotation(java.lang.Class clazz,
                                       org.jboss.aop.Advisor advisor,
                                       CachedType type)
We check whether this class has any field annotation declaration. We assume that there is only one such declaring class per vm and it is static.


isPrimitiveNonReplicatable

protected static boolean isPrimitiveNonReplicatable(java.lang.reflect.Field f)

hasTransientAnnotation

protected static boolean hasTransientAnnotation(org.jboss.aop.joinpoint.FieldInvocation invocation)
Check if we have @Transient annotation.

Parameters:
invocation -
Returns:
true if @Transient is present.

hasFieldAnnotation

protected static boolean hasFieldAnnotation(java.lang.reflect.Field field,
                                            org.jboss.aop.Advisor advisor)

hasTransientAnnotation

protected static boolean hasTransientAnnotation(java.lang.reflect.Field field,
                                                org.jboss.aop.Advisor advisor)

hasSerializableAnnotation

public static boolean hasSerializableAnnotation(java.lang.reflect.Field field,
                                                org.jboss.aop.Advisor advisor)

hasSerializableAnnotation

public static boolean hasSerializableAnnotation(org.jboss.aop.joinpoint.FieldInvocation invocation)

isNonReplicatable

public static boolean isNonReplicatable(org.jboss.aop.joinpoint.FieldInvocation fieldInvocation)

attributeName

protected java.lang.String attributeName(java.lang.String methodName)

getAttribute

protected CachedAttribute getAttribute(java.lang.reflect.Method method,
                                       java.util.Map map,
                                       boolean create)

isGet

protected boolean isGet(java.lang.reflect.Method method)

isSet

protected boolean isSet(java.lang.reflect.Method method)


Copyright 1998-2005 JBoss Inc . All Rights Reserved.