Examples of EvaluatedClassDeclaration


Examples of org.glassfish.gmbal.typelib.EvaluatedClassDeclaration

            new WeakHashMap<EvaluatedClassDeclaration,MBeanSkeleton>() ;
        this.typeConverterMap = new WeakHashMap<EvaluatedType,TypeConverter>() ;
        this.addedAnnotations =
            new HashMap<AnnotatedElement, Map<Class, Annotation>>() ;

        final EvaluatedClassDeclaration ecd =
            (EvaluatedClassDeclaration)TypeEvaluator.getEvaluatedType(
                AMXMBeanInterface.class ) ;
        this.amxAttributeNames = new HashSet<String>() ;
        this.amxSkeleton = getSkeleton( ecd ) ;
        for (MBeanAttributeInfo mbi : amxSkeleton.getMBeanInfo().getAttributes()) {
View Full Code Here

Examples of org.glassfish.gmbal.typelib.EvaluatedClassDeclaration

               
                Pair<EvaluatedClassDeclaration,EvaluatedClassAnalyzer> pair =
                    getClassAnalyzer( cls, ManagedObject.class ) ;
                EvaluatedClassAnalyzer ca = pair.second() ;

                EvaluatedClassDeclaration annotatedClass = pair.first() ;
                mm.info( registrationFineDebug(), "Annotated class for skeleton is",
                    annotatedClass ) ;
                if (annotatedClass == null) {
                    throw Exceptions.self.managedObjectAnnotationNotFound(
                        cls.name() ) ;
View Full Code Here

Examples of org.glassfish.gmbal.typelib.EvaluatedClassDeclaration

            return className ;
        }
    }

    public synchronized boolean isManagedObject( Object obj ) {
        final EvaluatedClassDeclaration cdecl =
            (EvaluatedClassDeclaration)TypeEvaluator.getEvaluatedType(
                obj.getClass() ) ;
        final ManagedObject mo = getFirstAnnotationOnClass( cdecl,
            ManagedObject.class ) ;
View Full Code Here

Examples of org.glassfish.gmbal.typelib.EvaluatedClassDeclaration

        mm.enter( registrationDebug(), "constructMean", obj, name ) ;
       
        String objName = name ;
        try {
            final Class<?> cls = obj.getClass() ;
            final EvaluatedClassDeclaration cdecl =
                (EvaluatedClassDeclaration)TypeEvaluator.getEvaluatedType(cls) ;
            final MBeanSkeleton skel = getSkeleton( cdecl ) ;

            AMXMetadata amd = getFirstAnnotationOnClass( cdecl, AMXMetadata.class ) ;
            if (amd == null) {
View Full Code Here

Examples of org.glassfish.gmbal.typelib.EvaluatedClassDeclaration

   
    public synchronized String getDescription( EvaluatedDeclaration element ) {
        // Can be called anytime
        Description desc ;
        if (element instanceof EvaluatedClassDeclaration) {
            EvaluatedClassDeclaration ecd = (EvaluatedClassDeclaration)element;
            desc = getFirstAnnotationOnClass(ecd, Description.class ) ;
        } else {
            desc = getAnnotation( element.element(), Description.class ) ;
        }
View Full Code Here

Examples of org.glassfish.gmbal.typelib.EvaluatedClassDeclaration

            annotationClass ) ;
       
        try {
            final EvaluatedClassAnalyzer clsca = new EvaluatedClassAnalyzer( cls ) ;

            final EvaluatedClassDeclaration annotatedClass = Algorithms.getFirst(
                clsca.findClasses( forAnnotation( annotationClass,
                    EvaluatedClassDeclaration.class ) ),
                new Runnable() {
                    public void run() {
                        throw Exceptions.self.noAnnotationFound(
                            annotationClass.getName(), cls.name() ) ;
                    }
                } ) ;

            mm.info( registrationDebug(), "annotatedClass = " + annotatedClass ) ;
   
            final List<EvaluatedClassDeclaration> classes =
                new ArrayList<EvaluatedClassDeclaration>() ;
            classes.add( cls ) ;

            // XXX Should we construct a union of all @IncludeSubclass contents?
            final IncludeSubclass incsub = getFirstAnnotationOnClass(
                cls, IncludeSubclass.class ) ;
            if (incsub != null) {
                for (Class<?> klass : incsub.value()) {
                    EvaluatedClassDeclaration ecd =
                        (EvaluatedClassDeclaration)TypeEvaluator.getEvaluatedType(klass) ;
                    classes.add( ecd ) ;
                    mm.info( registrationDebug(), "included subclass", klass ) ;
                }
            }
View Full Code Here

Examples of org.glassfish.gmbal.typelib.EvaluatedClassDeclaration

        try {
            final OpenType stype = simpleTypeMap.get( type ) ;
            if (stype != null) {
                result = handleSimpleType( type, stype ) ;
            } else if (type instanceof EvaluatedClassDeclaration) {
                EvaluatedClassDeclaration cls = (EvaluatedClassDeclaration)type ;
                final ManagedObject mo = mom.getFirstAnnotationOnClass( cls,
                    ManagedObject.class ) ;
                final ManagedData md = mom.getFirstAnnotationOnClass( cls,
                    ManagedData.class ) ;

                if (mo != null) {
                    result = handleManagedObject( cls, mom, mo ) ;
                } else if (md != null) {
                    result = handleManagedData( cls, mom, md ) ;
                } else if (cls.cls().isEnum()) {
                    result = handleEnum( cls ) ;
                } else {
                    result = handleClass( cls, mom ) ;
                }
            } else if (type instanceof EvaluatedArrayType) {
View Full Code Here

Examples of org.glassfish.gmbal.typelib.EvaluatedClassDeclaration

        TypeConverter result = null ;
       
        try {
        // Case 1: Some kind of collection.
        if (Iterable.class.isAssignableFrom(type.cls())) {
            EvaluatedClassDeclaration type2 =
                (EvaluatedClassDeclaration)getReturnType( type, "iterator") ;
            if (type2 == null) {
                throw Exceptions.self.iteratorNotFound(type) ;
            }

            EvaluatedType tcType = getReturnType( type2, "next" ) ;
            if (tcType == null) {
                throw Exceptions.self.nextNotFound(type) ;
            }

            TypeConverter tc = mom.getTypeConverter( tcType ) ;

            result = new TypeConverterListBase( type, tc ) {
                protected Iterator getIterator( Object obj ) {
                    if (obj == null) {
                        return emptyIterator() ;
                    } else {
                        return ((Iterable)obj).iterator() ;
                    }
                }
            } ;
        } else if (Collection.class.isAssignableFrom(type.cls())) {
            EvaluatedClassDeclaration type2 =
                (EvaluatedClassDeclaration)getReturnType( type, "iterator") ;
            EvaluatedType tcType = getReturnType( type2, "next" ) ;
            TypeConverter tc = mom.getTypeConverter( tcType ) ;

            result = new TypeConverterListBase( type, tc ) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.