public abstract class AbstractFunctionHandler<IN,OUT> extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
FORKED_BRANCH |
| Constructor and Description |
|---|
AbstractFunctionHandler() |
| Modifier and Type | Method and Description |
|---|---|
protected Output<OUT> |
delegate(String functionHandlerClassname,
Input<IN> input)
Delegate the execution of the function to the
AbstractFunctionHandler specified
in the arguments in the context of the default branch |
protected Output<OUT> |
delegate(String branchName,
String functionHandlerClassname,
Input<IN> input)
Delegate the execution of the function to the
AbstractFunctionHandler specified
in the arguments in the context of the specified branch |
protected step.grid.contextbuilder.ApplicationContextBuilder.ApplicationContext |
getCurrentContext() |
protected step.grid.contextbuilder.ApplicationContextBuilder.ApplicationContext |
getCurrentContext(String branch) |
protected step.grid.filemanager.FileVersionId |
getFileVersionId(String properyName,
Map<String,String> properties) |
protected FunctionHandlerFactory |
getFunctionHandlerFactory() |
abstract Class<IN> |
getInputPayloadClass() |
abstract Class<OUT> |
getOutputPayloadClass() |
protected Map<String,String> |
getProperties() |
protected step.grid.agent.tokenpool.TokenReservationSession |
getTokenReservationSession() |
protected step.grid.agent.tokenpool.TokenSession |
getTokenSession() |
protected abstract Output<OUT> |
handle(Input<IN> input) |
void |
initialize() |
protected Map<String,String> |
mergeAllProperties(Input<?> input) |
protected void |
pushLocalApplicationContext(ClassLoader classLoader,
String resourceName)
Push a new context based on a local file (jar or zip) to the default branch.
|
protected void |
pushLocalApplicationContext(String branch,
ClassLoader classLoader,
String resourceName)
Push a new context based on a local file (jar or zip) to the branch specified as argument.
|
protected void |
pushLocalFolderApplicationContext(File libFolder)
Push a new context based on a local folder containing a list of jars to the master branch.
|
protected void |
pushLocalFolderApplicationContext(String branch,
File libFolder)
Push a new context based on a local folder containing a list of jars to the branch specified as argument.
|
protected void |
pushRemoteApplicationContext(String fileId,
Map<String,String> properties)
Push a new remote context to the default branch.
|
protected void |
pushRemoteApplicationContext(String branch,
String fileId,
Map<String,String> properties)
Push a new remote context to the branch specified as argument.
|
protected File |
retrieveFileVersion(String properyName,
Map<String,String> properties) |
protected <T> T |
runInContext(Callable<T> callable)
Executes the callable using the
ClassLoader associated to the current ApplicationContextBuilder.ApplicationContext as context classloader |
protected <T> T |
runInContext(String branch,
Callable<T> callable)
Executes the callable in the current context of the branch specified as argument
|
protected void |
setApplicationContextBuilder(step.grid.contextbuilder.ApplicationContextBuilder applicationContextBuilder) |
protected void |
setFileManagerClient(step.grid.filemanager.FileManagerClient fileManagerClient) |
protected void |
setFunctionHandlerFactory(FunctionHandlerFactory functionHandlerFactory) |
protected void |
setProperties(Map<String,String> properties) |
protected void |
setTokenReservationSession(step.grid.agent.tokenpool.TokenReservationSession tokenReservationSession) |
protected void |
setTokenSession(step.grid.agent.tokenpool.TokenSession tokenSession) |
public static final String FORKED_BRANCH
protected FunctionHandlerFactory getFunctionHandlerFactory()
protected void setFunctionHandlerFactory(FunctionHandlerFactory functionHandlerFactory)
protected void setApplicationContextBuilder(step.grid.contextbuilder.ApplicationContextBuilder applicationContextBuilder)
protected void setFileManagerClient(step.grid.filemanager.FileManagerClient fileManagerClient)
protected step.grid.agent.tokenpool.TokenSession getTokenSession()
protected void setTokenSession(step.grid.agent.tokenpool.TokenSession tokenSession)
protected step.grid.agent.tokenpool.TokenReservationSession getTokenReservationSession()
protected void setTokenReservationSession(step.grid.agent.tokenpool.TokenReservationSession tokenReservationSession)
public void initialize()
protected step.grid.contextbuilder.ApplicationContextBuilder.ApplicationContext getCurrentContext()
ApplicationContextBuilder.ApplicationContext of the default branchprotected step.grid.contextbuilder.ApplicationContextBuilder.ApplicationContext getCurrentContext(String branch)
branch - ApplicationContextBuilder.ApplicationContext of the branch specified in the argumentprotected <T> T runInContext(Callable<T> callable) throws Exception
ClassLoader associated to the current ApplicationContextBuilder.ApplicationContext as context classloadercallable - the callable to be executed in the current ApplicationContextBuilder.ApplicationContextExceptionprotected <T> T runInContext(String branch, Callable<T> callable) throws Exception
branch - the name of the branch to be used for executioncallable - the callable to be executed in the current ApplicationContextBuilder.ApplicationContextExceptionprotected void pushLocalApplicationContext(ClassLoader classLoader, String resourceName) throws step.grid.contextbuilder.ApplicationContextBuilderException
ApplicationContextBuilder for detailsclassLoader - the classloader to be used to search the fileresourceName - the name of the resource to be pushedstep.grid.contextbuilder.ApplicationContextBuilderExceptionprotected void pushLocalApplicationContext(String branch, ClassLoader classLoader, String resourceName) throws step.grid.contextbuilder.ApplicationContextBuilderException
ApplicationContextBuilder for detailsbranch - the name of the branch on which the context has to be pushedclassLoader - the classloader to be used to search the fileresourceName - the name of the resource to be pushedstep.grid.contextbuilder.ApplicationContextBuilderExceptionprotected void pushLocalFolderApplicationContext(File libFolder) throws step.grid.contextbuilder.ApplicationContextBuilderException
ApplicationContextBuilder for detailslibFolder - the folder containing the jars to be pushed to the contextstep.grid.contextbuilder.ApplicationContextBuilderExceptionprotected void pushLocalFolderApplicationContext(String branch, File libFolder) throws step.grid.contextbuilder.ApplicationContextBuilderException
ApplicationContextBuilder for detailsbranch - the name of the branch on which the context has to be pushedlibFolder - the folder containing the jars to be pushed to the contextstep.grid.contextbuilder.ApplicationContextBuilderExceptionprotected void pushRemoteApplicationContext(String fileId, Map<String,String> properties) throws step.grid.contextbuilder.ApplicationContextBuilderException
ApplicationContextBuilder for detailsfileId - the id of the remote file (jar or folder) to be pushedproperties - step.grid.contextbuilder.ApplicationContextBuilderExceptionprotected void pushRemoteApplicationContext(String branch, String fileId, Map<String,String> properties) throws step.grid.contextbuilder.ApplicationContextBuilderException
ApplicationContextBuilder for detailsbranch - the name of the branch on which the context has to be pushedfileId - the id of the remote file (jar or folder) to be pushedproperties - step.grid.contextbuilder.ApplicationContextBuilderExceptionprotected Output<OUT> delegate(String branchName, String functionHandlerClassname, Input<IN> input) throws Exception
AbstractFunctionHandler specified
in the arguments in the context of the specified branchbranchName - functionHandlerClassname - input - Exceptionprotected Output<OUT> delegate(String functionHandlerClassname, Input<IN> input) throws Exception
AbstractFunctionHandler specified
in the arguments in the context of the default branchfunctionHandlerClassname - input - Exceptionprotected File retrieveFileVersion(String properyName, Map<String,String> properties) throws step.grid.filemanager.FileManagerException
step.grid.filemanager.FileManagerExceptionprotected step.grid.filemanager.FileVersionId getFileVersionId(String properyName, Map<String,String> properties)
Copyright © 2019. All rights reserved.