Package com.atlassian.jira
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 -
Method Summary
Modifier and TypeMethodDescription<T> TdoInTransaction(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.getComponentsOfType(Class<T> iface) Returns a mapping of all the component keys to instances that are registered in pico for the given iface class.
-
Constructor Details
-
DefaultHostContextAccessor
public DefaultHostContextAccessor()Constructor called by Pico.
-
-
Method Details
-
getComponentsOfType
Returns a mapping of all the component keys to instances that are registered in pico for the given iface class.- Specified by:
getComponentsOfTypein interfacecom.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:
doInTransactionin interfacecom.atlassian.sal.spi.HostContextAccessor- Parameters:
hostTransactionCallback- the action to be executed.- Returns:
- Result of the 'transaction'
-