Class DefaultHostContextAccessor

java.lang.Object
com.atlassian.jira.DefaultHostContextAccessor
All Implemented Interfaces:
com.atlassian.sal.spi.HostContextAccessor

public class DefaultHostContextAccessor extends Object implements com.atlassian.sal.spi.HostContextAccessor
This is necessary to provide a generic way for SAL to access a component that may not have been published the plugins 2.0 way.
Since:
v4.0
  • Nested Class Summary

    Nested classes/interfaces inherited from interface com.atlassian.sal.spi.HostContextAccessor

    com.atlassian.sal.spi.HostContextAccessor.HostTransactionCallback<T extends Object>
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor called by Pico.
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> T
    doInTransaction(com.atlassian.sal.spi.HostContextAccessor.HostTransactionCallback<T> hostTransactionCallback)
    JDEV-32949: This has been reverted to a NO-OP until we figure out if we can do this in safe way.
    <T> Map<String,T>
    Returns a mapping of all the component keys to instances that are registered in pico for the given iface class.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DefaultHostContextAccessor

      public DefaultHostContextAccessor()
      Constructor called by Pico.
  • Method Details

    • getComponentsOfType

      public <T> Map<String,T> getComponentsOfType(Class<T> iface)
      Returns a mapping of all the component keys to instances that are registered in pico for the given iface class.
      Specified by:
      getComponentsOfType in interface com.atlassian.sal.spi.HostContextAccessor
      Parameters:
      iface - The class that components returned need to implement.
      Returns:
      A map of component key -> instance.
    • doInTransaction

      public <T> T doInTransaction(com.atlassian.sal.spi.HostContextAccessor.HostTransactionCallback<T> hostTransactionCallback)
      JDEV-32949: This has been reverted to a NO-OP until we figure out if we can do this in safe way.
      Specified by:
      doInTransaction in interface com.atlassian.sal.spi.HostContextAccessor
      Parameters:
      hostTransactionCallback - the action to be executed.
      Returns:
      Result of the 'transaction'