private void checkObjectCache ( ClassDescriptorDef classDef , String checkLevel ) throws ConstraintException { if ( ! CHECKLEVEL_STRICT . equals ( checkLevel ) ) { return ; } ObjectCacheDef objCacheDef = classDef . getObjectCache ( ) ; if ( objCacheDef == null ) { return ; } String objectCacheName = objCacheDef . getName ( ) ; if ( ( objectCacheName == null ) || ( objectCacheName . length ( ) == 0 ) ) { throw new ConstraintException ( "No class specified for the object-cache of class " + classDef . getName ( ) ) ; } try { InheritanceHelper helper = new InheritanceHelper ( ) ; if ( ! helper . isSameOrSubTypeOf ( objectCacheName , OBJECT_CACHE_INTERFACE ) ) { throw new ConstraintException ( "The class " + objectCacheName + " specified as object-cache of class " + classDef . getName ( ) + " does not implement the interface " + OBJECT_CACHE_INTERFACE ) ; } } catch ( ClassNotFoundException ex ) { throw new ConstraintException ( "Could not find the class " + ex . getMessage ( ) + " on the classpath while checking the object-cache class " + objectCacheName + " of class " + classDef . getName ( ) ) ; } }
Checks the given class descriptor for correct object cache setting .