com.atlassian.util.concurrent
Class ConcurrentOperationMapImpl<K,R>

java.lang.Object
  extended by com.atlassian.util.concurrent.ConcurrentOperationMapImpl<K,R>
All Implemented Interfaces:
ConcurrentOperationMap<K,R>

@ThreadSafe
public class ConcurrentOperationMapImpl<K,R>
extends java.lang.Object
implements ConcurrentOperationMap<K,R>


Constructor Summary
ConcurrentOperationMapImpl()
           
 
Method Summary
 R runOperation(K key, java.util.concurrent.Callable<R> operation)
          The operation will be keyed on the name .
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConcurrentOperationMapImpl

public ConcurrentOperationMapImpl()
Method Detail

runOperation

public R runOperation(K key,
                      java.util.concurrent.Callable<R> operation)
               throws java.util.concurrent.ExecutionException
Description copied from interface: ConcurrentOperationMap
The operation will be keyed on the name .

Specified by:
runOperation in interface ConcurrentOperationMap<K,R>
Parameters:
key - the key, like any map key this should be an immutable object that correctly implements #hashCode() and #equals(Object)
operation - is the operation to execute whose result will be accessible to any concurrent callers with the same key.
Returns:
result of the operation
Throws:
java.util.concurrent.ExecutionException - if the callable generated a checked exception, otherwise a runtime exception or error will be thrown


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.