@Internal public abstract class

AbstractMessageHandlingService

extends AbstractService
java.lang.Object
   ↳ com.atlassian.jira.service.AbstractService
     ↳ com.atlassian.jira.service.services.file.AbstractMessageHandlingService
Known Direct Subclasses

@Internal

This class is an internal implementation detail and will change without notice.

Clients that depend on @Internal classes and interfaces can not expect to be compatible with any version other than the version they were compiled against (even minor version and milestone releases may break binary compatibility with respect to @Internal elements).

Class Overview

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.

Summary

Nested Classes
class AbstractMessageHandlingService.HandlerDisablementListener This class only purpose is to respond quickly to possible disablement of a plugin module which defines the handler used by descendants of AbstractMessageHandlingService class. 
Constants
String KEY_HANDLER
String KEY_HANDLER_PARAMS
int MAX_READ_MESSAGES_DRY_RUN
[Expand]
Inherited Constants
From class com.atlassian.jira.service.AbstractService
[Expand]
Inherited Fields
From class com.atlassian.jira.service.AbstractService
From interface com.atlassian.jira.service.JiraService
Public Constructors
AbstractMessageHandlingService()
Public Methods
void destroy()
This method is not really called when JIRA Service manager discards the instance of this service.
synchronized MessageHandler getHandler()
void init(PropertySet props)
Initialise the service.
void run()
This method must be implemented in a subclass, and performs the functionality that the service performs.
synchronized void setContext(MessageHandlerContext context)
Protected Methods
abstract String addHandlerInfo(String msg)
final String asString(Message message)
abstract Logger getLogger()
abstract void runImpl(MessageHandlerContext context)
[Expand]
Inherited Methods
From class com.atlassian.jira.service.AbstractService
From class java.lang.Object
From interface com.atlassian.configurable.ObjectConfigurable
From interface com.atlassian.jira.service.JiraService
From interface java.lang.Runnable

Constants

public static final String KEY_HANDLER

Constant Value: "handler"

public static final String KEY_HANDLER_PARAMS

Constant Value: "handler.params"

public static final int MAX_READ_MESSAGES_DRY_RUN

Constant Value: 10 (0x0000000a)

Public Constructors

public AbstractMessageHandlingService ()

Public Methods

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.

public synchronized MessageHandler getHandler ()

public void init (PropertySet props)

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.

Parameters
props initialisation parameters

public void run ()

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.

public synchronized void setContext (MessageHandlerContext context)

Protected Methods

protected abstract String addHandlerInfo (String msg)

protected final String asString (Message message)

protected abstract Logger getLogger ()

protected abstract void runImpl (MessageHandlerContext context)