@PublicApi public class ComponentAccessor extends Object
IllegalStateException
that they
are getting in a unit test should read the documentation for the MockComponentWorker
in the
jira-tests
artifact for instructions.Modifier and Type | Class and Description |
---|---|
static interface |
ComponentAccessor.Worker |
Constructor and Description |
---|
ComponentAccessor() |
Modifier and Type | Method and Description |
---|---|
static ApplicationProperties |
getApplicationProperties() |
static AttachmentManager |
getAttachmentManager() |
static AttachmentPathManager |
getAttachmentPathManager()
Retrieves and returns the attachment path instance
|
static AvatarManager |
getAvatarManager() |
static AvatarService |
getAvatarService() |
static BulkOperationManager |
getBulkOperationManager()
Retrieves and return the bulk operation manager instance
|
static ChangeHistoryManager |
getChangeHistoryManager()
Retrieves and returns the
ChangeHistoryManager manager instance |
static ColumnLayoutManager |
getColumnLayoutManager()
Retrieves and returns the column layout manager instance
|
static CommentManager |
getCommentManager() |
static <T> T |
getComponent(Class<T> componentClass)
Returns the core component which is stored in JIRA's Dependency Injection container under the key that is the given class.
|
static ComponentClassManager |
getComponentClassManager() |
static <T> T |
getComponentOfType(Class<T> componentClass)
Returns the core component of the given Type (a Class or an Interface) which is stored in JIRA's
Dependency Injection container.
|
static <T> ComponentReference<T> |
getComponentReference(Class<T> componentClass)
Returns a thread-safe,
Serializable lazy reference to the core component which is stored in JIRA's
Dependency Injection container under the key that is the given class. |
static ConstantsManager |
getConstantsManager() |
static com.atlassian.crowd.embedded.api.CrowdService |
getCrowdService() |
static CustomFieldManager |
getCustomFieldManager() |
static EventTypeManager |
getEventTypeManager() |
static FieldConfigSchemeManager |
getFieldConfigSchemeManager() |
static FieldLayoutManager |
getFieldLayoutManager()
Retrieves and returns the field layout manager
|
static FieldManager |
getFieldManager() |
static FieldScreenManager |
getFieldScreenManager()
Retrieves and returns the field screen manager instance
|
static FieldScreenRendererFactory |
getFieldScreenRendererFactory()
Retrieves and returns the field screen renderer factory instance
|
static GlobalPermissionManager |
getGlobalPermissionManager() |
static GroupManager |
getGroupManager() |
static I18nHelper.BeanFactory |
getI18nHelperFactory() |
static IndexPathManager |
getIndexPathManager()
Retrieves and returns the index path manager instance
|
static IssueEventManager |
getIssueEventManager() |
static IssueFactory |
getIssueFactory() |
static IssueIndexManager |
getIssueIndexManager()
Returns the IssueIndexManager component.
|
static IssueLinkManager |
getIssueLinkManager()
Returns the IssueLinkManager component.
|
static IssueManager |
getIssueManager() |
static IssueSecurityLevelManager |
getIssueSecurityLevelManager() |
static IssueService |
getIssueService()
Retrieves and returns the issue service instance
|
static IssueTypeSchemeManager |
getIssueTypeSchemeManager()
Retrieves and returns the issue type scheme manager instance
|
static IssueTypeScreenSchemeManager |
getIssueTypeScreenSchemeManager()
Retrieves and returns the issue type screen scheme manager instance
|
static JiraAuthenticationContext |
getJiraAuthenticationContext() |
static JiraDurationUtils |
getJiraDurationUtils() |
static ListenerManager |
getListenerManager() |
static LocaleManager |
getLocaleManager() |
static com.atlassian.mail.queue.MailQueue |
getMailQueue() |
static com.atlassian.mail.server.MailServerManager |
getMailServerManager()
Retrieves and returns the mail server manager instance
|
static MailThreadManager |
getMailThreadManager() |
static MoveSubTaskOperationManager |
getMoveSubTaskOperationManager()
Retrieves and returns the move subtask operation manager instance
|
static NotificationSchemeManager |
getNotificationSchemeManager() |
static OfBizDelegator |
getOfBizDelegator() |
static OptionsManager |
getOptionsManager() |
static <T> T |
getOSGiComponentInstanceOfType(Class<T> componentClass)
Retrieves and returns a public component from OSGi land via its class name.
|
static <T> OsgiComponentReference<T> |
getOsgiComponentReference(Class<T> componentClass)
Returns a thread-safe,
Serializable lazy reference to the OSGi component under the key that is the
given class. |
static PermissionContextFactory |
getPermissionContextFactory() |
static PermissionManager |
getPermissionManager() |
static PermissionSchemeManager |
getPermissionSchemeManager() |
static com.atlassian.plugin.PluginAccessor |
getPluginAccessor() |
static com.atlassian.plugin.PluginController |
getPluginController() |
static com.atlassian.plugin.event.PluginEventManager |
getPluginEventManager() |
static ProjectComponentManager |
getProjectComponentManager()
Retrieves and returns the project component manager instance
|
static ProjectFactory |
getProjectFactory()
Retrieves and returns the project factory instance
|
static ProjectManager |
getProjectManager() |
static RendererManager |
getRendererManager()
Retrieves the RendererManager component.
|
static org.quartz.Scheduler |
getScheduler()
Deprecated.
since v6.2; to be removed in v7.0. Please use the
SchedulerService instead of accessing
Quartz directly. It should be injected if possible; otherwise, use
getComponent(SchedulerService.class) to obtain it. |
static ServiceManager |
getServiceManager() |
static SubscriptionManager |
getSubscriptionManager() |
static SubTaskManager |
getSubTaskManager()
Retrieves and returns the subtask manager instance
|
static TranslationManager |
getTranslationManager()
Retrieves and returns the translation manager instance
|
static UserKeyService |
getUserKeyService() |
static UserManager |
getUserManager() |
static UserPreferencesManager |
getUserPreferencesManager()
Retrieves and returns the user preferences manager instance
|
static UserPropertyManager |
getUserPropertyManager()
Retrieves and returns the user preferences manager instance
|
static UserUtil |
getUserUtil() |
static com.atlassian.velocity.VelocityManager |
getVelocityManager() |
static VelocityParamFactory |
getVelocityParamFactory() |
static VersionManager |
getVersionManager() |
static VoteManager |
getVoteManager()
Retrieves and returns the vote manager instance
|
static WatcherManager |
getWatcherManager()
Retrieves and returns the watcher manager instance
|
static com.atlassian.plugin.webresource.WebResourceManager |
getWebResourceManager()
Retrieves and returns the web resource manager instance
|
static com.atlassian.plugin.webresource.WebResourceUrlProvider |
getWebResourceUrlProvider()
Retrieves and returns the web resource URL provider instance
|
static WorkflowManager |
getWorkflowManager() |
static WorkflowSchemeManager |
getWorkflowSchemeManager()
Retrieves and returns the workflow scheme manager instance
|
static WorklogManager |
getWorklogManager()
Retrieves and returns the worklog manager instance
|
static ComponentAccessor.Worker |
initialiseWorker(ComponentAccessor.Worker componentAccessorWorker)
This is called during system bootstrap to initialise this static helper class.
|
public static <T> T getComponent(Class<T> componentClass)
In practise, this is the same as getComponentOfType(Class)
except it will fail faster if the
given Class is not a known component key (it also has a shorter and more meaningful name).
Please note that this method only gets components from JIRA's core Pico Container. That is, it retrieves core components and components declared in Plugins1 plugins, but not components declared in Plugins2 plugins.
componentClass
- class to find a component instance bygetComponentOfType(Class)
@ExperimentalApi public static <T> ComponentReference<T> getComponentReference(@Nonnull Class<T> componentClass)
Serializable
lazy reference to the core component which is stored in JIRA's
Dependency Injection container under the key that is the given class.componentClass
- class to find a component instance byComponentReference
@ExperimentalApi public static <T> OsgiComponentReference<T> getOsgiComponentReference(@Nonnull Class<T> componentClass)
Serializable
lazy reference to the OSGi component under the key that is the
given class.componentClass
- class to find an OSGi component instance byOsgiComponentReference
public static <T> T getComponentOfType(Class<T> componentClass)
First it tries to find the component using the given Class as a key (like getComponent(Class)
),
however, if this fails then it will try to find a unique component that implements/extends the given Class.
This seems unlikely to be useful, but is included for now, for completeness and backward compatibility.
Please note that this method only gets components from JIRA's core Pico Container. That is, it retrieves core components and components declared in Plugins1 plugins, but not components declared in Plugins2 plugins.
componentClass
- class to find a component instance bygetComponent(Class)
public static <T> T getOSGiComponentInstanceOfType(Class<T> componentClass)
public="true"
declared in their XML configuration. This means that they are available for other plugins to import.
A example use case for this method is the dashboards plugin. In several areas in JIRA we may want to
render gadgets via the GadgetViewFactory
. Whilst the interface for this
component is available in JIRA core, the implementation is provided by the dashboards OSGi bundle. This method
will allow us to access it.componentClass
- the class for which to find an OSGi component instancenull
if it does not existgetComponentOfType(Class)
public static ProjectManager getProjectManager()
public static ApplicationProperties getApplicationProperties()
public static JiraAuthenticationContext getJiraAuthenticationContext()
public static JiraDurationUtils getJiraDurationUtils()
public static ConstantsManager getConstantsManager()
public static com.atlassian.velocity.VelocityManager getVelocityManager()
public static VelocityParamFactory getVelocityParamFactory()
public static I18nHelper.BeanFactory getI18nHelperFactory()
public static FieldManager getFieldManager()
public static IssueManager getIssueManager()
public static AttachmentManager getAttachmentManager()
public static UserManager getUserManager()
public static UserKeyService getUserKeyService()
public static PermissionManager getPermissionManager()
public static PermissionContextFactory getPermissionContextFactory()
public static CustomFieldManager getCustomFieldManager()
public static FieldConfigSchemeManager getFieldConfigSchemeManager()
public static UserUtil getUserUtil()
public static GroupManager getGroupManager()
public static EventTypeManager getEventTypeManager()
public static IssueEventManager getIssueEventManager()
public static WorkflowManager getWorkflowManager()
public static IssueFactory getIssueFactory()
public static VersionManager getVersionManager()
public static CommentManager getCommentManager()
public static MailThreadManager getMailThreadManager()
public static com.atlassian.plugin.webresource.WebResourceManager getWebResourceManager()
public static com.atlassian.plugin.webresource.WebResourceUrlProvider getWebResourceUrlProvider()
public static BulkOperationManager getBulkOperationManager()
public static MoveSubTaskOperationManager getMoveSubTaskOperationManager()
public static WorklogManager getWorklogManager()
public static ProjectFactory getProjectFactory()
public static IssueTypeSchemeManager getIssueTypeSchemeManager()
public static IssueTypeScreenSchemeManager getIssueTypeScreenSchemeManager()
public static SubTaskManager getSubTaskManager()
public static IssueLinkManager getIssueLinkManager()
public static com.atlassian.crowd.embedded.api.CrowdService getCrowdService()
public static FieldLayoutManager getFieldLayoutManager()
public static ColumnLayoutManager getColumnLayoutManager()
public static VoteManager getVoteManager()
public static com.atlassian.plugin.PluginAccessor getPluginAccessor()
public static com.atlassian.plugin.event.PluginEventManager getPluginEventManager()
public static ComponentClassManager getComponentClassManager()
public static com.atlassian.plugin.PluginController getPluginController()
public static RendererManager getRendererManager()
public static FieldScreenRendererFactory getFieldScreenRendererFactory()
public static WorkflowSchemeManager getWorkflowSchemeManager()
public static IssueIndexManager getIssueIndexManager()
public static IssueService getIssueService()
public static IndexPathManager getIndexPathManager()
public static AttachmentPathManager getAttachmentPathManager()
public static TranslationManager getTranslationManager()
public static WatcherManager getWatcherManager()
public static FieldScreenManager getFieldScreenManager()
public static com.atlassian.mail.server.MailServerManager getMailServerManager()
public static ProjectComponentManager getProjectComponentManager()
public static ChangeHistoryManager getChangeHistoryManager()
ChangeHistoryManager
manager instancepublic static UserPreferencesManager getUserPreferencesManager()
public static UserPropertyManager getUserPropertyManager()
public static AvatarService getAvatarService()
public static AvatarManager getAvatarManager()
public static ListenerManager getListenerManager()
public static com.atlassian.mail.queue.MailQueue getMailQueue()
public static NotificationSchemeManager getNotificationSchemeManager()
public static PermissionSchemeManager getPermissionSchemeManager()
@Deprecated public static org.quartz.Scheduler getScheduler()
SchedulerService
instead of accessing
Quartz directly. It should be injected if possible; otherwise, use
getComponent(SchedulerService.class)
to obtain it.public static IssueSecurityLevelManager getIssueSecurityLevelManager()
public static ServiceManager getServiceManager()
public static SubscriptionManager getSubscriptionManager()
public static GlobalPermissionManager getGlobalPermissionManager()
public static LocaleManager getLocaleManager()
public static OptionsManager getOptionsManager()
public static OfBizDelegator getOfBizDelegator()
@Internal public static ComponentAccessor.Worker initialiseWorker(ComponentAccessor.Worker componentAccessorWorker)
componentAccessorWorker
- The worker that this static class delegates to in order to do actual work.Copyright © 2002-2015 Atlassian. All Rights Reserved.