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 interface
GroovyJobExecutor.Configuration
protected class
GroovyJobExecutor.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 void
activate(GroovyJobExecutor.Configuration configuration)
protected String
buildAuditPathIntern(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 void
deactivate()
protected @NotNull String
getAuditBasePath()
protected @NotNull org.apache.sling.commons.classloader.DynamicClassLoaderManager
getDynamicClassLoaderManager()
protected @NotNull String
getJobTopic()
protected @NotNull org.apache.sling.api.resource.ResourceResolverFactory
getResolverFactory()
protected @NotNull SequencerService<SequencerService.Token>
getSequencer()
protected boolean
jobExecutionEnabled(org.apache.sling.event.jobs.Job job)
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)
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:
getResolverFactory
in classAbstractJobExecutor<Object>
-
getSequencer
@NotNull protected @NotNull SequencerService<SequencerService.Token> getSequencer()
- Specified by:
getSequencer
in classAbstractJobExecutor<Object>
-
getDynamicClassLoaderManager
@NotNull protected @NotNull org.apache.sling.commons.classloader.DynamicClassLoaderManager getDynamicClassLoaderManager()
- Specified by:
getDynamicClassLoaderManager
in classAbstractJobExecutor<Object>
-
activate
protected void activate(GroovyJobExecutor.Configuration configuration)
-
deactivate
protected void deactivate()
-
getJobTopic
@NotNull protected @NotNull String getJobTopic()
- Specified by:
getJobTopic
in classAbstractJobExecutor<Object>
-
getAuditBasePath
@NotNull protected @NotNull String getAuditBasePath()
- Specified by:
getAuditBasePath
in classAbstractJobExecutor<Object>
-
jobExecutionEnabled
protected boolean jobExecutionEnabled(org.apache.sling.event.jobs.Job job)
- Specified by:
jobExecutionEnabled
in classAbstractJobExecutor<Object>
-
buildAuditPathIntern
protected String buildAuditPathIntern(String reference, Calendar eventJobStartedTime)
- Overrides:
buildAuditPathIntern
in 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:AbstractJobExecutor
The Callable does the job which is prepared by the executor.- Specified by:
createCallable
in 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 IOException
Description copied from class:AbstractJobExecutor
Can be overwritten to handle some cleanup or logging when job is finished.- Overrides:
jobExecutionFinished
in classAbstractJobExecutor<Object>
- Throws:
IOException
-
-