com.atlassian.sal.spring.component
Class SpringHostContextAccessor
java.lang.Object
com.atlassian.sal.spring.component.SpringHostContextAccessor
- All Implemented Interfaces:
- HostContextAccessor, org.springframework.context.ApplicationContextAware
public class SpringHostContextAccessor
- extends Object
- implements HostContextAccessor, org.springframework.context.ApplicationContextAware
Implements the host context accessor for Spring environments
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SpringHostContextAccessor
public SpringHostContextAccessor(org.springframework.transaction.PlatformTransactionManager transactionManager)
getComponentsOfType
public <T> Map<String,T> getComponentsOfType(Class<T> iface)
- Description copied from interface:
HostContextAccessor
- Gets all beans of a given type
- Specified by:
getComponentsOfType in interface HostContextAccessor
- Parameters:
iface - The interface to use
- Returns:
- A map of String keys and object instances
doInTransaction
public Object doInTransaction(HostContextAccessor.HostTransactionCallback callback)
- Description copied from interface:
HostContextAccessor
- Runs an action in a transaction and returns a optional value.
- Specified by:
doInTransaction in interface HostContextAccessor
- Parameters:
callback - The callback class to execute
- Returns:
- Optional result of the operation. May be null
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
throws org.springframework.beans.BeansException
- Specified by:
setApplicationContext in interface org.springframework.context.ApplicationContextAware
- Throws:
org.springframework.beans.BeansException
getTransactionDefinition
protected org.springframework.transaction.support.DefaultTransactionDefinition getTransactionDefinition()
Copyright © 2015 Atlassian. All rights reserved.