com.atlassian.sal.spi
Interface HostContextAccessor

All Known Implementing Classes:
SpringHostContextAccessor, SpringHostContextAccessor

public interface HostContextAccessor

Interface for accessing host information, meant to be exposed as a host component


Nested Class Summary
static interface HostContextAccessor.HostTransactionCallback<T>
          The interface to implement for code that needs to be ran inside a host transaction
 
Method Summary
<T> T
doInTransaction(HostContextAccessor.HostTransactionCallback<T> callback)
          Runs an action in a transaction and returns a optional value.
<T> Map<String,T>
getComponentsOfType(Class<T> iface)
          Gets all beans of a given type
 

Method Detail

getComponentsOfType

<T> Map<String,T> getComponentsOfType(Class<T> iface)
Gets all beans of a given type

Parameters:
iface - The interface to use
Returns:
A map of String keys and object instances

doInTransaction

<T> T doInTransaction(HostContextAccessor.HostTransactionCallback<T> callback)
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.


Copyright © 2010 Atlassian. All Rights Reserved.