Class AbstractMessageHandlingService
java.lang.Object
com.atlassian.jira.service.AbstractService
com.atlassian.jira.service.services.file.AbstractMessageHandlingService
- All Implemented Interfaces:
ObjectConfigurable,JiraService,Runnable
- Direct Known Subclasses:
FileService,MailFetcherService
An abstract service to be subclassed by any service which wants to use MessageHandlers.
This class is hopefully going to be moved to the JIRA Mail Plugin.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThis class only purpose is to respond quickly to possible disablement of a plugin module which defines the handler used by descendants of AbstractMessageHandlingService class. -
Field Summary
FieldsFields inherited from class com.atlassian.jira.service.AbstractService
log, name, SERVICE_EVENTFields inherited from interface com.atlassian.jira.service.JiraService
NAME_COMPARATOR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract StringaddHandlerInfo(String msg) protected final StringasString(javax.mail.Message message) voiddestroy()This method is not really called when JIRA Service manager discards the instance of this service.protected abstract org.apache.log4j.Loggervoidinit(com.opensymphony.module.propertyset.PropertySet props) Initialise the service.voidrun()This method must be implemented in a subclass, and performs the functionality that the service performs.protected abstract voidrunImpl(MessageHandlerContext context) voidsetContext(MessageHandlerContext context) Methods inherited from class com.atlassian.jira.service.AbstractService
getDefaultProperty, getDescription, getKey, getLongProperty, getName, getObjectConfiguration, getProperties, getProperty, getTextProperty, hasProperty, isInternal, isUnique, setNameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.atlassian.jira.service.JiraService
initMethods inherited from interface com.atlassian.configurable.ObjectConfigurable
getObjectConfiguration
-
Field Details
-
KEY_HANDLER
- See Also:
-
KEY_HANDLER_PARAMS
- See Also:
-
MAX_READ_MESSAGES_DRY_RUN
public static final int MAX_READ_MESSAGES_DRY_RUN- See Also:
-
-
Constructor Details
-
AbstractMessageHandlingService
public AbstractMessageHandlingService()
-
-
Method Details
-
setContext
-
destroy
public void destroy()This method is not really called when JIRA Service manager discards the instance of this service. That's why we have to play with weak references in the disablement listener Anyway, for the sake of completeness, we are cleaning the stuff also here.- Specified by:
destroyin interfaceJiraService- Overrides:
destroyin classAbstractService
-
init
public void init(com.opensymphony.module.propertyset.PropertySet props) throws ObjectConfigurationException Description copied from interface:JiraServiceInitialise the service. This method is guaranteed to be called before the first call to run().As the parameters are gained from the user's interaction with the website, it is not guaranteed to be called with the correct, or indeed with any parameters.
init() may be called multiple times during the services lifetime.
- Specified by:
initin interfaceJiraService- Overrides:
initin classAbstractService- Parameters:
props- initialisation parameters- Throws:
ObjectConfigurationException- in case of an error with initialisation parameters- See Also:
-
runImpl
-
run
public void run()Description copied from class:AbstractServiceThis method must be implemented in a subclass, and performs the functionality that the service performs. This method is called after the duration specified through the administration web interface.- Specified by:
runin interfaceJiraService- Specified by:
runin interfaceRunnable- Specified by:
runin classAbstractService- See Also:
-
getHandler
-
addHandlerInfo
-
getLogger
protected abstract org.apache.log4j.Logger getLogger() -
asString
-