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

@Internal public abstract class AbstractMessageHandlingService extends AbstractService
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.
  • Field Details

  • Constructor Details

    • AbstractMessageHandlingService

      public AbstractMessageHandlingService()
  • Method Details

    • setContext

      public void setContext(MessageHandlerContext context)
    • 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:
      destroy in interface JiraService
      Overrides:
      destroy in class AbstractService
    • init

      public void init(com.opensymphony.module.propertyset.PropertySet props) throws ObjectConfigurationException
      Description copied from interface: JiraService
      Initialise 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:
      init in interface JiraService
      Overrides:
      init in class AbstractService
      Parameters:
      props - initialisation parameters
      Throws:
      ObjectConfigurationException - in case of an error with initialisation parameters
      See Also:
    • runImpl

      protected abstract void runImpl(MessageHandlerContext context)
    • run

      public void run()
      Description copied from class: AbstractService
      This 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:
      run in interface JiraService
      Specified by:
      run in interface Runnable
      Specified by:
      run in class AbstractService
      See Also:
    • getHandler

      public MessageHandler getHandler()
    • addHandlerInfo

      protected abstract String addHandlerInfo(String msg)
    • getLogger

      protected abstract org.apache.log4j.Logger getLogger()
    • asString

      protected final String asString(javax.mail.Message message)