Package org.glassfish.internal.embedded
Class ScatteredArchive.Builder
java.lang.Object
org.glassfish.internal.embedded.ScatteredArchive.Builder
- Enclosing class:
- ScatteredArchive
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumSupported types of scattered archives. -
Constructor Summary
ConstructorsConstructorDescriptionConstruct a new scattered archive builder with the minimum information By default, a scattered archive is not different from any other archive where all the files are located under a top level directory (topDir).Builder(String name, Collection<URL> urls) Construct a new scattered archive builder with a set of URLs as repository for locating archive resources (like .class files). -
Method Summary
Modifier and TypeMethodDescriptionaddClassPath(File location) Adds a directory to the classes classpath.addClassPath(URL classpath) Adds a URL for the classes classpath.addMetadata(File metadata) Add a new metadata locator for this scattered archive.addMetadata(String name, File metadata) Add a new metadata locator for this scattered archive.buildJar()Creates a new scattered jar file using this builder instance configuration.buildWar()Creates a new scattered war file using this builder instance configuration.Sets the location of resources files
-
Constructor Details
-
Builder
Construct a new scattered archive builder with the minimum information By default, a scattered archive is not different from any other archive where all the files are located under a top level directory (topDir). Some files can then be scattered in different locations and be specified through the appropriate setters. Alternatively, topDir can be null to specify a truely scattered archive and all the locations must be specified.- Parameters:
name- archive nametopDir- top level directory
-
Builder
Construct a new scattered archive builder with a set of URLs as repository for locating archive resources (like .class files).- Parameters:
name- archive nameurls- set of resources repository
-
-
Method Details
-
resources
Sets the location of resources files- Parameters:
resources- the resources directory- Returns:
- itself
-
addMetadata
Add a new metadata locator for this scattered archive. A metadata is identified by its name (like WEB-INF/web.xml) and the location of the metadata is used when the embedded server is requesting the metadata file. The name for this metadata will be obtained by doing metadata.getName()- Parameters:
metadata- the metadata file location- Returns:
- itself
-
addMetadata
Add a new metadata locator for this scattered archive. A metadata is identified by its name (like WEB-INF/web.xml) and the location of the metadata is used when the embedded server is requesting the metadata file.- Parameters:
name- name of the metadata (eg WEB-INF/web.xml or web.xml or META-INF/ejb.xml or ejb.xml).metadata- the metadata file location- Returns:
- itself
-
addClassPath
Adds a directory to the classes classpath. Will be used to retrieve requested .class files.- Parameters:
location- must be a directory location- Returns:
- itself
-
addClassPath
Adds a URL for the classes classpath. Will be used to retrieve requested .class files- Parameters:
classpath- the new classpath element.- Returns:
- itself
-
buildJar
Creates a new scattered jar file using this builder instance configuration. The resulting instance will behave like a jar file when introspected by the embedded instance.- Returns:
- new scattered instance jar file
-
buildWar
Creates a new scattered war file using this builder instance configuration. The resulting instance will behave like a war file when introspected by the embedded instance.- Returns:
- the scattered instance war file
-