Package com.composum.sling.core.script
Class GroovyJobExecutor
- java.lang.Object
-
- com.composum.sling.core.concurrent.AbstractJobExecutor<Object>
-
- com.composum.sling.core.script.GroovyJobExecutor
-
- All Implemented Interfaces:
org.apache.sling.event.jobs.consumer.JobExecutor,org.osgi.service.event.EventHandler
public class GroovyJobExecutor extends AbstractJobExecutor<Object>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceGroovyJobExecutor.Configurationprotected classGroovyJobExecutor.GroovyRunnerCallable-
Nested classes/interfaces inherited from class com.composum.sling.core.concurrent.AbstractJobExecutor
AbstractJobExecutor.UserContextCallable
-
-
Field Summary
-
Fields inherited from class com.composum.sling.core.concurrent.AbstractJobExecutor
AUDIT_ROOT_PATH, CRUD_AUDIT_FOLDER_PROPS, JOB_OUTFILE_PROPERTY, JOB_REFRENCE_PROPERTY, JOB_USERID_PROPERTY
-
-
Constructor Summary
Constructors Constructor Description GroovyJobExecutor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidactivate(GroovyJobExecutor.Configuration configuration)protected StringbuildAuditPathIntern(String reference, Calendar eventJobStartedTime)protected Callable<Object>createCallable(org.apache.sling.event.jobs.Job job, org.apache.sling.event.jobs.consumer.JobExecutionContext context, org.apache.sling.api.resource.ResourceResolver serviceResolver, PrintWriter out)The Callable does the job which is prepared by the executor.protected voiddeactivate()protected @NotNull StringgetAuditBasePath()protected @NotNull org.apache.sling.commons.classloader.DynamicClassLoaderManagergetDynamicClassLoaderManager()protected @NotNull StringgetJobTopic()protected @NotNull org.apache.sling.api.resource.ResourceResolverFactorygetResolverFactory()protected @NotNull SequencerService<SequencerService.Token>getSequencer()protected booleanjobExecutionEnabled(org.apache.sling.event.jobs.Job job)protected voidjobExecutionFinished(org.apache.sling.event.jobs.Job job, org.apache.sling.event.jobs.consumer.JobExecutionContext context, org.apache.sling.api.resource.Resource auditResource)Can be overwritten to handle some cleanup or logging when job is finished.-
Methods inherited from class com.composum.sling.core.concurrent.AbstractJobExecutor
getProperty, handleEvent, process
-
-
-
-
Method Detail
-
getResolverFactory
@NotNull protected @NotNull org.apache.sling.api.resource.ResourceResolverFactory getResolverFactory()
- Specified by:
getResolverFactoryin classAbstractJobExecutor<Object>
-
getSequencer
@NotNull protected @NotNull SequencerService<SequencerService.Token> getSequencer()
- Specified by:
getSequencerin classAbstractJobExecutor<Object>
-
getDynamicClassLoaderManager
@NotNull protected @NotNull org.apache.sling.commons.classloader.DynamicClassLoaderManager getDynamicClassLoaderManager()
- Specified by:
getDynamicClassLoaderManagerin classAbstractJobExecutor<Object>
-
activate
protected void activate(GroovyJobExecutor.Configuration configuration)
-
deactivate
protected void deactivate()
-
getJobTopic
@NotNull protected @NotNull String getJobTopic()
- Specified by:
getJobTopicin classAbstractJobExecutor<Object>
-
getAuditBasePath
@NotNull protected @NotNull String getAuditBasePath()
- Specified by:
getAuditBasePathin classAbstractJobExecutor<Object>
-
jobExecutionEnabled
protected boolean jobExecutionEnabled(org.apache.sling.event.jobs.Job job)
- Specified by:
jobExecutionEnabledin classAbstractJobExecutor<Object>
-
buildAuditPathIntern
protected String buildAuditPathIntern(String reference, Calendar eventJobStartedTime)
- Overrides:
buildAuditPathInternin classAbstractJobExecutor<Object>
-
createCallable
protected Callable<Object> createCallable(org.apache.sling.event.jobs.Job job, org.apache.sling.event.jobs.consumer.JobExecutionContext context, org.apache.sling.api.resource.ResourceResolver serviceResolver, PrintWriter out) throws Exception
Description copied from class:AbstractJobExecutorThe Callable does the job which is prepared by the executor.- Specified by:
createCallablein classAbstractJobExecutor<Object>- Throws:
Exception
-
jobExecutionFinished
protected void jobExecutionFinished(org.apache.sling.event.jobs.Job job, org.apache.sling.event.jobs.consumer.JobExecutionContext context, org.apache.sling.api.resource.Resource auditResource) throws IOExceptionDescription copied from class:AbstractJobExecutorCan be overwritten to handle some cleanup or logging when job is finished.- Overrides:
jobExecutionFinishedin classAbstractJobExecutor<Object>- Throws:
IOException
-
-