Class JavaExecutor
java.lang.Object
org.jdrupes.builder.core.AbstractProvider
org.jdrupes.builder.java.JavaExecutor
- All Implemented Interfaces:
Renamable, RequiredResourceSupport, ResourceProvider, ResourceRetriever
public class JavaExecutor
extends AbstractProvider
implements ResourceRetriever, Renamable, RequiredResourceSupport
A provider for execution resultss from invoking a JVM.
The working directory is the project directory.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddFrom(Stream<ResourceProvider> providers) Additionally uses the given providers for building the classpath.addFrom(ResourceProvider... providers) Additionally uses the given providers for building the classpath.Add the given arguments.protected <T extends Resource>
Collection<T> doProvide(ResourceRequest<T> requested) Invoked byResourceProviderSpi.provide(ResourceRequest)after checking if the invocation is allowed.Returns the main class.Sets the main class.Set the new name.Convenience method that adds aFileResourceto the required resources.Convenience method that adds aFileTreeto the required resources.Adds the givenStreamof resources to the required resources.toString()To string.Methods inherited from class AbstractProvider
context, name, of, rename, vavrStreamMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ResourceProvider
context, name, of, resources
-
Constructor Details
-
JavaExecutor
Initializes a new java executor.- Parameters:
project- the project
-
-
Method Details
-
name
-
required
Description copied from interface:RequiredResourceSupportAdds the givenStreamof resources to the required resources.- Specified by:
requiredin interfaceRequiredResourceSupport- Parameters:
resources- the resources- Returns:
- the provider
-
required
Description copied from interface:RequiredResourceSupportConvenience method that adds aFileTreeto the required resources. Ifrootis relative, it is resolved against the project's directory.- Specified by:
requiredin interfaceRequiredResourceSupport- Parameters:
root- the rootpattern- the pattern- Returns:
- the provider
-
required
Description copied from interface:RequiredResourceSupportConvenience method that adds aFileResourceto the required resources. Ifpathis relative, it is resolved against the project's directory.- Specified by:
requiredin interfaceRequiredResourceSupport- Parameters:
root- the file- Returns:
- the provider
-
addFrom
Additionally uses the given providers for building the classpath.- Specified by:
addFromin interfaceResourceRetriever- Parameters:
providers- the providers- Returns:
- the jar generator
-
addFrom
Additionally uses the given providers for building the classpath.- Specified by:
addFromin interfaceResourceRetriever- Parameters:
providers- the providers- Returns:
- the jar generator
-
mainClass
-
mainClass
Sets the main class.- Parameters:
mainClass- the new main class- Returns:
- the jar generator for method chaining
-
args
Add the given arguments.- Parameters:
args- the arguments- Returns:
- the npm executor
-
doProvide
Description copied from class:AbstractProviderInvoked byResourceProviderSpi.provide(ResourceRequest)after checking if the invocation is allowed.- Specified by:
doProvidein classAbstractProvider- Type Parameters:
T- the generic type- Parameters:
requested- the request for resources- Returns:
- the stream
-
toString
To string.- Overrides:
toStringin classAbstractProvider- Returns:
- the string
-