Package com.atlassian.sal.spi
Interface HostContextAccessor
public interface HostContextAccessor
Interface for accessing host information, meant to be exposed as a host component
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceThe interface to implement for code that needs to be ran inside a host transaction -
Method Summary
Modifier and TypeMethodDescription<T> TRuns an action in a transaction and returns a optional value.getComponentsOfType(Class<T> iface) Gets all beans of a given type
-
Method Details
-
getComponentsOfType
Gets all beans of a given type- Parameters:
iface- The interface to use- Returns:
- A map of String keys and object instances
-
doInTransaction
Runs an action in a transaction and returns a optional value.- Parameters:
callback- The callback class to execute- Returns:
- Optional result of the operation. May be null
- Throws:
RuntimeException- if anything went wrong. The caller will be responsible for rolling back.
-