protected synchronized ResourceRoot getSeamIntResourceRoot ( ) throws DeploymentUnitProcessingException { try { if ( seamIntResourceRoot == null ) { final ModuleLoader moduleLoader = Module . getBootModuleLoader ( ) ; Module extModule = moduleLoader . loadModule ( EXT_CONTENT_MODULE ) ; URL url = extModule . getExportedResource ( SEAM_INT_JAR ) ; if ( url == null ) throw ServerLogger . ROOT_LOGGER . noSeamIntegrationJarPresent ( extModule ) ; File file = new File ( url . toURI ( ) ) ; VirtualFile vf = VFS . getChild ( file . toURI ( ) ) ; final Closeable mountHandle = VFS . mountZip ( file , vf , TempFileProviderService . provider ( ) ) ; Service < Closeable > mountHandleService = new Service < Closeable > ( ) { public void start ( StartContext startContext ) throws StartException { } public void stop ( StopContext stopContext ) { VFSUtils . safeClose ( mountHandle ) ; } public Closeable getValue ( ) throws IllegalStateException , IllegalArgumentException { return mountHandle ; } } ; ServiceBuilder < Closeable > builder = serviceTarget . addService ( ServiceName . JBOSS . append ( SEAM_INT_JAR ) , mountHandleService ) ; builder . setInitialMode ( ServiceController . Mode . ACTIVE ) . install ( ) ; serviceTarget = null ; // our cleanup service install work is done MountHandle dummy = MountHandle . create ( null ) ; // actual close is done by the MSC service above seamIntResourceRoot = new ResourceRoot ( vf , dummy ) ; } return seamIntResourceRoot ; } catch ( Exception e ) { throw new DeploymentUnitProcessingException ( e ) ; } }
Lookup Seam integration resource loader .