private synchronized Set < ExtensionArchive > getExtensionArchives ( ) throws CDIException { if ( runtimeExtensionSet == null ) { runtimeExtensionSet = new HashSet < ExtensionArchive > ( ) ; // get hold of the container for extension bundle //add create the bean deployment archive from the container Iterator < ServiceAndServiceReferencePair < WebSphereCDIExtension > > extensions = cdiRuntime . getExtensionServices ( ) ; while ( extensions . hasNext ( ) ) { ServiceAndServiceReferencePair < WebSphereCDIExtension > extension = extensions . next ( ) ; ServiceReference < WebSphereCDIExtension > sr = extension . getServiceReference ( ) ; Bundle bundle = null ; if ( sr == null ) { continue ; } bundle = sr . getBundle ( ) ; String extra_classes_blob = ( String ) sr . getProperty ( EXTENSION_API_CLASSES ) ; Set < String > extra_classes = new HashSet < String > ( ) ; //parse the list if ( extra_classes_blob != null ) { String [ ] classes = extra_classes_blob . split ( EXTENSION_API_CLASSES_SEPARATOR ) ; if ( ( classes != null ) && ( classes . length > 0 ) ) { Collections . addAll ( extra_classes , classes ) ; } } String extraAnnotationsBlob = ( String ) sr . getProperty ( EXTENSION_BEAN_DEFINING_ANNOTATIONS ) ; Set < String > extraAnnotations = new HashSet < String > ( ) ; if ( extraAnnotationsBlob != null ) { String [ ] annotations = extraAnnotationsBlob . split ( EXTENSION_API_CLASSES_SEPARATOR ) ; if ( ( annotations != null ) && ( annotations . length > 0 ) ) { Collections . addAll ( extraAnnotations , annotations ) ; } } String applicationBDAsVisibleStr = ( String ) sr . getProperty ( EXTENSION_APP_BDAS_VISIBLE ) ; boolean applicationBDAsVisible = Boolean . parseBoolean ( applicationBDAsVisibleStr ) ; String extClassesOnlyStr = ( String ) sr . getProperty ( EXTENSION_CLASSES_ONLY_MODE ) ; boolean extClassesOnly = Boolean . parseBoolean ( extClassesOnlyStr ) ; ExtensionArchive extensionArchive = cdiRuntime . getExtensionArchiveForBundle ( bundle , extra_classes , extraAnnotations , applicationBDAsVisible , extClassesOnly ) ; runtimeExtensionSet . add ( extensionArchive ) ; } if ( CDIUtils . isDevelopementMode ( ) ) { //add the probeExcension runtimeExtensionSet . add ( new ProbeExtensionArchive ( cdiRuntime , null ) ) ; } } return runtimeExtensionSet ; }
Returns the extension container info with ContainerInfo classloader and container name