public List < ServiceComponentImpl > buildComponents ( String serviceDescriptorFileName , JarFile deployableUnitJar ) throws DeploymentException { // make component jar entry JarEntry componentDescriptor = deployableUnitJar . getJarEntry ( serviceDescriptorFileName ) ; InputStream componentDescriptorInputStream = null ; List < ServiceComponentImpl > result = new ArrayList < ServiceComponentImpl > ( ) ; try { componentDescriptorInputStream = deployableUnitJar . getInputStream ( componentDescriptor ) ; ServiceDescriptorFactoryImpl descriptorFactory = componentManagement . getComponentDescriptorFactory ( ) . getServiceDescriptorFactory ( ) ; for ( ServiceDescriptorImpl descriptor : descriptorFactory . parse ( componentDescriptorInputStream ) ) { result . add ( new ServiceComponentImpl ( descriptor ) ) ; } } catch ( IOException e ) { throw new DeploymentException ( "failed to parse service descriptor from " + componentDescriptor . getName ( ) , e ) ; } finally { if ( componentDescriptorInputStream != null ) { try { componentDescriptorInputStream . close ( ) ; } catch ( IOException e ) { logger . error ( "failed to close inputstream of descriptor for jar " + componentDescriptor . getName ( ) ) ; } } } return result ; }
Builds a service component contained in the specified du jar file with the specified and adds it to the specified deployable unit .