Package jadex.platform.service.wrapper
Class JavaWrapperAgent
- java.lang.Object
-
- jadex.platform.service.wrapper.JavaWrapperAgent
-
- All Implemented Interfaces:
IJavaWrapperService
public class JavaWrapperAgent extends java.lang.Object implements IJavaWrapperService
Wrapper for executing Java programs.
-
-
Field Summary
Fields Modifier and Type Field Description protected IInternalAccess
agent
The agent.protected ILibraryService
libservice
The library service.protected IThreadPoolService
tpservice
The thread pool service.
-
Constructor Summary
Constructors Constructor Description JavaWrapperAgent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IFuture<java.lang.Void>
executeJava(IResourceIdentifier rid, java.lang.String[] args)
Execute a plain Java program from a jar as given by a resource identifier.IFuture<java.lang.Void>
executeJava(java.lang.Class<?> clazz, java.lang.String[] args)
Execute a plain Java program as given by its main class.IFuture<java.lang.Void>
executeJava(java.lang.String jarfile, java.lang.String[] args)
Execute a plain Java program from a jar as given by a file name.
-
-
-
Field Detail
-
agent
protected IInternalAccess agent
The agent.
-
tpservice
protected IThreadPoolService tpservice
The thread pool service.
-
libservice
protected ILibraryService libservice
The library service.
-
-
Method Detail
-
executeJava
public IFuture<java.lang.Void> executeJava(java.lang.Class<?> clazz, java.lang.String[] args)
Execute a plain Java program as given by its main class.- Specified by:
executeJava
in interfaceIJavaWrapperService
- Parameters:
clazz
- The class to be executed as Java program.args
- The arguments to the main method.- Returns:
- A future indication successful execution (result: null) or failure (exception).
-
executeJava
public IFuture<java.lang.Void> executeJava(java.lang.String jarfile, java.lang.String[] args)
Execute a plain Java program from a jar as given by a file name. Uses the main class name as specified in the manifest.- Specified by:
executeJava
in interfaceIJavaWrapperService
- Parameters:
jarfile
- File name of a jar file.args
- The arguments to the main method.- Returns:
- A future indication successful execution (result: null) or failure (exception).
-
executeJava
public IFuture<java.lang.Void> executeJava(IResourceIdentifier rid, java.lang.String[] args)
Execute a plain Java program from a jar as given by a resource identifier. Uses the main class name as specified in the manifest.- Specified by:
executeJava
in interfaceIJavaWrapperService
- Parameters:
rid
- The resource identifier for the jar (global rid for maven artifact id, local rid for local file url).args
- The arguments to the main method.- Returns:
- A future indication successful execution (result: null) or failure (exception).
-
-