Interface ExtensionPointScriptObject
- 
- All Superinterfaces:
- com.redwood.scheduler.api.session.RestrictedSchedulerSessionSupport
 
 public interface ExtensionPointScriptObject extends com.redwood.scheduler.api.session.RestrictedSchedulerSessionSupport
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanaddToCloseList(AutoCloseable o, String name, boolean log)Close the object when the action completes.voidclearRetainedActionSubjectSchedulerSession()Clear an earlier requested retained SchedulerSessoin.voidclearRetainedUserSchedulerSession()Clear an earlier requested retained SchedulerSessoin.SchedulerSessioncreateActionSubjectSchedulerSession()Create an additional SchedulerSesison that has the context of the Act ion Subject as defined by the Extension Point These SchedulerSessions are detached and invalidated after the execution of the request, and should therefore NOT be held on to (by storing them in the session or otherwise).SchedulerSessioncreateUserSchedulerSession()Create an additional SchedulerSesison that has the context of the user performing the action.voidexecuteActionWithLock(String name, Runnable action)Execute the action when the lock with name has been acquired.voidforceCloseListLogging()Force logging of all objects in close list.StringgetBootStrapURL()Retrieve the URL to the javascript that will contain the javascript api object jcsExtension to be used in javascript.ExtensionPointgetExtensionPoint()Get the extension point that defined this action.LonggetExtensionPointUniqueId()Get the extension point Unique Id that defined this action.List<JobChainCall>getJobChainCalls()Return a list of JobChainCalls that make up the path from the last call that points to the JobDefinition of which the JobDefinitionParameter is being edited to the call of the root chain.StringgetJobDefinitionBootStrapURL()Retrieve the URL to the javascript that will contain the javascript api object jceJobDefinition extension to be used in javascript.JobDefinitionParametergetJobDefinitionParameter()Get the JobDefinitionParameter that this Extension Point was invoked from.intgetMaxRetries()Get maximum retries.intgetMaxSpins()Get maximum spins.StringgetOriginalValue()Return the original value of the field that initiated this ExtensionPointSchedulerSessiongetRetainedActionSubjectSchedulerSession()Get (or create if one does not exist yet) a SchedulerSession that will be available in consequent requests for this user for the same ExtensionPoint execution.SchedulerSessiongetRetainedUserSchedulerSession()Get (or create if one does not exist yet) a SchedulerSession that will be available in consequent requests for this user for the same ExtensionPoint execution.SchedulerSessiongetSharedSchedulerSession()Return a SchedulerSession that is being used on an edit page, and contains the objects being edited.StringgetThemeCSSUrl()Retrieve the URL to the CSS that will contain theming information that can be used to style the page like the rest of the product<T extends Exception>
 voidperformUnitOfWorkActionSubjectSession(SchedulerSessionUnitOfWork<T> uow)Perform a unit of work, by calling it with a new Action Subject session.<T extends Exception>
 voidperformUnitOfWorkUserSession(SchedulerSessionUnitOfWork<T> uow)Perform a unit of work, by calling it with a new User session.voidreleaseSharedSchedulerSession()Once an Extension Point is done with the shared SchedulerSession and no longer needs access to it, then this method can be called to release the SchedulerSession so it can be garbage collected.voidsetMaxRetries(int newMaxRetries)Set the maximum number of retries for units of work.voidsetMaxSpins(int newMaxSpins)Set the maximum number of spins for units of work.
 
- 
- 
- 
Method Detail- 
executeActionWithLockvoid executeActionWithLock(String name, Runnable action) throws InterruptedException Execute the action when the lock with name has been acquired. Each extension point has its own lock that an Extension Point can use. Within each Extension Point, multiple locks can be created by giving them different names.- Parameters:
- name- of the lock to acquire before running the action
- action- to run when the lock has been acquired.
- Throws:
- InterruptedException- when the thread is interrupted while waiting for a lock.
 
 - 
getExtensionPointUniqueIdLong getExtensionPointUniqueId() Get the extension point Unique Id that defined this action.- Returns:
- the Extension Point Unique Id that defined this action.
 
 - 
getExtensionPointExtensionPoint getExtensionPoint() Get the extension point that defined this action.- Returns:
- the Extension Point that defined this action.
 
 - 
createUserSchedulerSessionSchedulerSession createUserSchedulerSession() Create an additional SchedulerSesison that has the context of the user performing the action. These SchedulerSessions are detached and invalidated after the execution of the request, and should therefore NOT be held on to (by storing them in the session or otherwise). Use getRetainedUserSchedulerSession() instead.- Returns:
- a user SchedulerSession
 
 - 
createActionSubjectSchedulerSessionSchedulerSession createActionSubjectSchedulerSession() Create an additional SchedulerSesison that has the context of the Act ion Subject as defined by the Extension Point These SchedulerSessions are detached and invalidated after the execution of the request, and should therefore NOT be held on to (by storing them in the session or otherwise). Use getRetainedActionSubjectSchedulerSession() instead.- Returns:
- an Action Subject SchedulerSession, or null if Action Subject is not defined
 
 - 
getRetainedUserSchedulerSessionSchedulerSession getRetainedUserSchedulerSession() Get (or create if one does not exist yet) a SchedulerSession that will be available in consequent requests for this user for the same ExtensionPoint execution. Unlike the SchedulerSession returned by createUserSchedulerSession(), this SchedulerSession is not invalidated after the execution has ended, and can be used to store modified Scheduler Entities that the user is editing.- Returns:
- a user SchedulerSession that can be used over multiple requests.
 
 - 
clearRetainedUserSchedulerSessionvoid clearRetainedUserSchedulerSession() Clear an earlier requested retained SchedulerSessoin. The retained SchedulerSession will be invalidated, and SchedulerEntities retrieved from this SchedulerSession will not be usable anymore. All changes made to SchedulerEntities will also be discarded. Has no effect when getRetainedUserSchedulerSession() has not been called before for this user/ExtensionPoint combination
 - 
getRetainedActionSubjectSchedulerSessionSchedulerSession getRetainedActionSubjectSchedulerSession() Get (or create if one does not exist yet) a SchedulerSession that will be available in consequent requests for this user for the same ExtensionPoint execution. Unlike the SchedulerSession returned by createUserSchedulerSession(), this SchedulerSession is not invalidated after the execution has ended, and can be used to store modified Scheduler Entities that the user is editing.- Returns:
- an Action Subject based SchedulerSession that can be used over multiple requests, or null if an Action Subject is not defined
 
 - 
clearRetainedActionSubjectSchedulerSessionvoid clearRetainedActionSubjectSchedulerSession() Clear an earlier requested retained SchedulerSessoin. The retained SchedulerSession will be invalidated, and SchedulerEntities retrieved from this SchedulerSession will not be usable anymore. All changes made to SchedulerEntities will also be discarded. Has no effect when getRetainedActionSubjectSchedulerSession() has not been called before for this user/ExtensionPoint combination
 - 
getMaxRetriesint getMaxRetries() Get maximum retries.- Returns:
- maximum retries.
 
 - 
getMaxSpinsint getMaxSpins() Get maximum spins.- Returns:
- maximum spins.
 
 - 
setMaxRetriesvoid setMaxRetries(int newMaxRetries) Set the maximum number of retries for units of work.- Parameters:
- newMaxRetries- the new maximum number of retries, must be > 1.
 
 - 
setMaxSpinsvoid setMaxSpins(int newMaxSpins) Set the maximum number of spins for units of work.- Parameters:
- newMaxSpins- the new maximum number of spins, must be > 1.
 
 - 
performUnitOfWorkUserSession<T extends Exception> void performUnitOfWorkUserSession(SchedulerSessionUnitOfWork<T> uow) throws com.redwood.scheduler.api.exception.SchedulerAPIPersistenceException, T extends Exception Perform a unit of work, by calling it with a new User session. If the initial call fails with a no rows updated exception, call it again with a new session. If it fails with any other exception, or fails too many times with no rows updated, throw the last exception thrown. Retries can be configured withsetMaxRetries(int). Spins can be configured withsetMaxSpins(int).- Parameters:
- uow- the unit of work to perform. Generic in the type of Exception its performWork method it throws. See- SchedulerSessionUnitOfWorkfor the problems with using a raw type here.
- Throws:
- com.redwood.scheduler.api.exception.SchedulerAPIPersistenceException- if the unit of work fails with a no rows updated exception maxretries times.
- T- if the unit of work throws an exception.
- T extends Exception
 
 - 
performUnitOfWorkActionSubjectSession<T extends Exception> void performUnitOfWorkActionSubjectSession(SchedulerSessionUnitOfWork<T> uow) throws com.redwood.scheduler.api.exception.SchedulerAPIPersistenceException, T extends Exception Perform a unit of work, by calling it with a new Action Subject session. If the initial call fails with a no rows updated exception, call it again with a new session. If it fails with any other exception, or fails too many times with no rows updated, throw the last exception thrown. Retries can be configured withsetMaxRetries(int). Spins can be configured withsetMaxSpins(int).- Parameters:
- uow- the unit of work to perform. Generic in the type of Exception its performWork method it throws. See- SchedulerSessionUnitOfWorkfor the problems with using a raw type here.
- Throws:
- com.redwood.scheduler.api.exception.SchedulerAPIPersistenceException- if the unit of work fails with a no rows updated exception maxretries times.
- T- if the unit of work throws an exception.
- T extends Exception
 
 - 
addToCloseListboolean addToCloseList(AutoCloseable o, String name, boolean log) Close the object when the action completes.- Parameters:
- o- the object to close.
- name- the name of the object.
- log- should information about this object be logged by default.
- Returns:
- true if the object was added, false if it was not closable.
 
 - 
forceCloseListLoggingvoid forceCloseListLogging() Force logging of all objects in close list.
 - 
getThemeCSSUrlString getThemeCSSUrl() Retrieve the URL to the CSS that will contain theming information that can be used to style the page like the rest of the product- Returns:
- the URL to be used in a <link> tag
 
 - 
getOriginalValueString getOriginalValue() Return the original value of the field that initiated this ExtensionPoint- Returns:
- the original value
 
 - 
getSharedSchedulerSessionSchedulerSession getSharedSchedulerSession() Return a SchedulerSession that is being used on an edit page, and contains the objects being edited. Depending on the type of Extension Point, this SchedulerSession has restrictions with regards to modifying objects or persisting the session. The Jobchain Editor Extension point gets a readonly copy of the session, any modifications will result in an exception. Object page extension points get a modifiable session, but persist is not allowed, exception for type window.- Returns:
- the SchedulerSession being used by the edit page that initiated the ExtensionPoint
 
 - 
releaseSharedSchedulerSessionvoid releaseSharedSchedulerSession() Once an Extension Point is done with the shared SchedulerSession and no longer needs access to it, then this method can be called to release the SchedulerSession so it can be garbage collected. Keep in mind that after this call, the getSharedSchedulerSession will return null.
 - 
getBootStrapURLString getBootStrapURL() Retrieve the URL to the javascript that will contain the javascript api object jcsExtension to be used in javascript.- Returns:
- the URL to be used in the <script> tag
 
 - 
getJobDefinitionParameterJobDefinitionParameter getJobDefinitionParameter() Get the JobDefinitionParameter that this Extension Point was invoked from. The JobDefintionParameter will be attached to the shared SchedulerSession, and will be read only- Returns:
- the JobDefinitionParameter
 
 - 
getJobChainCallsList<JobChainCall> getJobChainCalls() Return a list of JobChainCalls that make up the path from the last call that points to the JobDefinition of which the JobDefinitionParameter is being edited to the call of the root chain. All objects are attached to the shared SchedulerSession but are read only.- Returns:
- the list of JobChainCalls
 
 - 
getJobDefinitionBootStrapURLString getJobDefinitionBootStrapURL() Retrieve the URL to the javascript that will contain the javascript api object jceJobDefinition extension to be used in javascript.- Returns:
- the URL to be used in the <script> tag
 
 
- 
 
-