com.atlassian.jira.service.services.file
Class AbstractMessageHandlingService

java.lang.Object
  extended by com.atlassian.jira.service.AbstractService
      extended by com.atlassian.jira.service.services.file.AbstractMessageHandlingService
All Implemented Interfaces:
ObjectConfigurable, JiraService, Runnable
Direct Known Subclasses:
FileService, MailFetcherService

public abstract class AbstractMessageHandlingService
extends AbstractService

An abstract service to be subclassed by any service which wants to use MessageHandlers.


Field Summary
protected  EntityCreationHandler entityCreationHandler
           
protected  MessageHandler handler
          This field is volatile to ensure that the handler is "safely published".
static String KEY_HANDLER
           
static String KEY_HANDLER_PARAMS
           
protected  MailHandlerExecutionMonitor mailHandlerExecutionMonitor
           
 
Fields inherited from class com.atlassian.jira.service.AbstractService
name
 
Fields inherited from interface com.atlassian.jira.service.JiraService
NAME_COMPARATOR
 
Constructor Summary
AbstractMessageHandlingService()
           
 
Method Summary
 MessageHandler getHandler()
           
 void init(com.opensymphony.module.propertyset.PropertySet props)
          Initialise the service.
protected  boolean isDryRunMode()
           
 void setEntityCreationHandler(EntityCreationHandler entityCreationHandler)
           
 void setMailHandlerExecutionMonitor(MailHandlerExecutionMonitor mailHandlerExecutionMonitor)
           
 
Methods inherited from class com.atlassian.jira.service.AbstractService
destroy, getDefaultProperty, getDescription, getKey, getLongProperty, getName, getObjectConfiguration, getProperties, getProperty, getTextProperty, hasProperty, isInternal, isUnique, run, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.configurable.ObjectConfigurable
getObjectConfiguration
 

Field Detail

KEY_HANDLER

public static final String KEY_HANDLER
See Also:
Constant Field Values

KEY_HANDLER_PARAMS

public static final String KEY_HANDLER_PARAMS
See Also:
Constant Field Values

mailHandlerExecutionMonitor

protected volatile MailHandlerExecutionMonitor mailHandlerExecutionMonitor

entityCreationHandler

protected volatile EntityCreationHandler entityCreationHandler

handler

protected volatile MessageHandler handler
This field is volatile to ensure that the handler is "safely published". Since the handlers are effectively immutable, this is sufficient to ensure changes made by init() in one thread are visible in other threads.

Constructor Detail

AbstractMessageHandlingService

public AbstractMessageHandlingService()
Method Detail

setMailHandlerExecutionMonitor

public void setMailHandlerExecutionMonitor(MailHandlerExecutionMonitor mailHandlerExecutionMonitor)

setEntityCreationHandler

public void setEntityCreationHandler(EntityCreationHandler entityCreationHandler)

isDryRunMode

protected boolean isDryRunMode()

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

getHandler

public MessageHandler getHandler()


Copyright © 2002-2011 Atlassian. All Rights Reserved.