com.atlassian.jira
Class DefaultHostContextAccessor

java.lang.Object
  extended by 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>
 
Constructor Summary
DefaultHostContextAccessor()
           
 
Method Summary
<T> T
doInTransaction(com.atlassian.sal.spi.HostContextAccessor.HostTransactionCallback<T> hostTransactionCallback)
          No transactions in JIRA so this is effectively a NoOp.
<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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultHostContextAccessor

public DefaultHostContextAccessor()
Method Detail

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)
No transactions in JIRA so this is effectively a NoOp.

Specified by:
doInTransaction in interface com.atlassian.sal.spi.HostContextAccessor
Parameters:
hostTransactionCallback - the action to be executed.
Returns:
Result of the 'transaction'


Copyright © 2002-2014 Atlassian. All Rights Reserved.