static ImmutableAttributes loadAttributes ( String repoType , File featureFile , ProvisioningDetails details ) throws IOException { // This will throw exceptions if required attributes mismatch or are missing details . ensureValid ( ) ; // retrieve the symbolic name and feature manifest version String symbolicName = details . getNameAttribute ( null ) ; int featureVersion = details . getIBMFeatureVersion ( ) ; // Directive names are name attributes, but end with a colon Visibility visibility = Visibility . fromString ( details . getNameAttribute ( "visibility:" ) ) ; boolean isSingleton = Boolean . parseBoolean ( details . getNameAttribute ( "singleton:" ) ) ; // ignore short name for features that are not public String shortName = ( visibility != Visibility . PUBLIC ? null : details . getMainAttributeValue ( SHORT_NAME ) ) ; // retrieve the feature/subsystem version Version version = VersionUtility . stringToVersion ( details . getMainAttributeValue ( VERSION ) ) ; // retrieve the app restart header AppForceRestart appRestart = AppForceRestart . fromString ( details . getMainAttributeValue ( IBM_APP_FORCE_RESTART ) ) ; String subsystemType = details . getMainAttributeValue ( TYPE ) ; String value = details . getCachedRawHeader ( IBM_PROVISION_CAPABILITY ) ; boolean isAutoFeature = value != null && SubsystemContentType . FEATURE_TYPE . getValue ( ) . equals ( subsystemType ) ; value = details . getCachedRawHeader ( IBM_API_SERVICE ) ; boolean hasApiServices = value != null ; value = details . getCachedRawHeader ( IBM_API_PACKAGE ) ; boolean hasApiPackages = value != null ; value = details . getCachedRawHeader ( IBM_SPI_PACKAGE ) ; boolean hasSpiPackages = value != null ; EnumSet < ProcessType > processTypes = ProcessType . fromString ( details . getCachedRawHeader ( IBM_PROCESS_TYPES ) ) ; ImmutableAttributes iAttr = new ImmutableAttributes ( emptyIfNull ( repoType ) , symbolicName , nullIfEmpty ( shortName ) , featureVersion , visibility , appRestart , version , featureFile , featureFile == null ? - 1 : featureFile . lastModified ( ) , featureFile == null ? - 1 : featureFile . length ( ) , isAutoFeature , hasApiServices , hasApiPackages , hasSpiPackages , isSingleton , processTypes ) ; // Link the details object and immutable attributes (used for diagnostic purposes: // the immutable attribute values are necessary for meaningful error messages) details . setImmutableAttributes ( iAttr ) ; return iAttr ; }
Create the ImmutableAttributes based on the contents read from a subsystem manifest .