public class ChainedJobXmlResolver extends Object implements JobXmlResolver
DEFAULT_PATH
Constructor and Description |
---|
ChainedJobXmlResolver(Collection<JobXmlResolver> resolvers)
Creates a new chained job XML resolver.
|
ChainedJobXmlResolver(Iterable<JobXmlResolver> resolvers)
Creates a new chained job XML resolver.
|
ChainedJobXmlResolver(Iterable<JobXmlResolver> resolvers,
JobXmlResolver... additionalResolvers)
Creates a new chained job XML resolver.
|
ChainedJobXmlResolver(JobXmlResolver... resolvers)
Creates a new chained job XML resolver.
|
Modifier and Type | Method and Description |
---|---|
Collection<String> |
getJobXmlNames(ClassLoader classLoader)
Optionally returns a list of job XML names that are allowed to be used.
|
String |
resolveJobName(String jobXml,
ClassLoader classLoader)
Optionally resolves the job name from the job XML.
|
InputStream |
resolveJobXml(String jobXml,
ClassLoader classLoader)
Locates the job XML and creates a stream to the contents.
|
public ChainedJobXmlResolver(JobXmlResolver... resolvers)
resolvers
- the resolvers to usepublic ChainedJobXmlResolver(Iterable<JobXmlResolver> resolvers)
resolvers
- the resolvers to usepublic ChainedJobXmlResolver(Iterable<JobXmlResolver> resolvers, JobXmlResolver... additionalResolvers)
resolvers
- the resolvers to useadditionalResolvers
- any additional resolvers to usepublic ChainedJobXmlResolver(Collection<JobXmlResolver> resolvers)
resolvers
- the resolvers to usepublic InputStream resolveJobXml(String jobXml, ClassLoader classLoader) throws IOException
Each resolver is checked until the first one returns a non-null
value after which no other resolvers are
checked. If no resolver finds the content null
will be returned.
resolveJobXml
in interface JobXmlResolver
jobXml
- the name of the job XML with a .xml
suffixclassLoader
- the class loader for the applicationnull
if the job XML content was not foundIOException
- if an error occurs creating the streampublic Collection<String> getJobXmlNames(ClassLoader classLoader)
An empty collection should be returned if job names can not be resolved.
Gets the names for each resolver and returns all the names found.
getJobXmlNames
in interface JobXmlResolver
classLoader
- the class loader for the applicationpublic String resolveJobName(String jobXml, ClassLoader classLoader)
A null
value can be returned if the name cannot be resolved.
Checks each resolver until a non-null
value is found. If the name could not be resolved by any resolver
null
is returned.
resolveJobName
in interface JobXmlResolver
jobXml
- the name of the xml XML with a .xml
suffixclassLoader
- the class loader for the applicationnull
if not foundCopyright © 2018 JBoss by Red Hat. All rights reserved.