com.atlassian.bamboo.core
Class ScopedExclusionServiceHelper

java.lang.Object
  extended by com.atlassian.bamboo.core.ScopedExclusionServiceHelper

public class ScopedExclusionServiceHelper
extends java.lang.Object

Provides helper methods that provide higher level of abstraction over object locked by $ScopedExclusionService.


Method Summary
static
<S> ScopedExclusionService.ExclusiveFunction<S,java.lang.Void,java.lang.Exception>
adapt(java.util.concurrent.Callable<S> callable)
          Adapts the supplied parameter to $ScopedExclusionService.ExclusiveFunction
static
<S,V> ScopedExclusionService.ExclusiveFunction<S,V,java.lang.RuntimeException>
adapt(com.google.common.base.Function<S,V> function)
          Adapts the supplied parameter to $ScopedExclusionService.ExclusiveFunction
static
<S> ScopedExclusionService.ExclusiveFunction<S,java.lang.Void,java.lang.RuntimeException>
adapt(java.lang.Runnable runnable)
          Adapts the supplied parameter to $ScopedExclusionService.ExclusiveFunction
static
<S,V> ScopedExclusionService.ExclusiveFunction<S,V,java.lang.RuntimeException>
adapt(com.google.common.base.Supplier<V> supplier)
          Adapts the supplied parameter to $ScopedExclusionService.ExclusiveFunction
static
<S,V> ScopedExclusionService.ExclusiveFunction<S,V,java.lang.RuntimeException>
adapt(com.atlassian.util.concurrent.Supplier<V> supplier)
          Adapts the supplied parameter to $ScopedExclusionService.ExclusiveFunction
static
<S,V> ScopedExclusionService.ExclusiveFunction<S,V,java.lang.RuntimeException>
clearSession(ScopedExclusionService.ExclusiveFunction<S,V,java.lang.RuntimeException> function)
          Delegates a call to the supplied function, first flushing and clearing the Hibernate session.
static
<V,E extends java.lang.Throwable>
V
withLockedJob(ScopedExclusionService exclusionService, PlanKey planKey, ScopedExclusionService.ExclusiveFunction<PlanKey,V,E> functor)
          Executes the function while holding an exclusive lock on planKey interpreted as job key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

withLockedJob

public static <V,E extends java.lang.Throwable> V withLockedJob(ScopedExclusionService exclusionService,
                                                                PlanKey planKey,
                                                                ScopedExclusionService.ExclusiveFunction<PlanKey,V,E> functor)
                       throws E extends java.lang.Throwable
Executes the function while holding an exclusive lock on planKey interpreted as job key.

Parameters:
exclusionService -
planKey -
functor -
Throws:
E extends java.lang.Throwable

clearSession

public static <S,V> ScopedExclusionService.ExclusiveFunction<S,V,java.lang.RuntimeException> clearSession(ScopedExclusionService.ExclusiveFunction<S,V,java.lang.RuntimeException> function)
Delegates a call to the supplied function, first flushing and clearing the Hibernate session.


adapt

public static <S,V> ScopedExclusionService.ExclusiveFunction<S,V,java.lang.RuntimeException> adapt(com.google.common.base.Function<S,V> function)
Adapts the supplied parameter to $ScopedExclusionService.ExclusiveFunction


adapt

public static <S,V> ScopedExclusionService.ExclusiveFunction<S,V,java.lang.RuntimeException> adapt(com.google.common.base.Supplier<V> supplier)
Adapts the supplied parameter to $ScopedExclusionService.ExclusiveFunction


adapt

public static <S,V> ScopedExclusionService.ExclusiveFunction<S,V,java.lang.RuntimeException> adapt(com.atlassian.util.concurrent.Supplier<V> supplier)
Adapts the supplied parameter to $ScopedExclusionService.ExclusiveFunction


adapt

public static <S> ScopedExclusionService.ExclusiveFunction<S,java.lang.Void,java.lang.RuntimeException> adapt(java.lang.Runnable runnable)
Adapts the supplied parameter to $ScopedExclusionService.ExclusiveFunction


adapt

public static <S> ScopedExclusionService.ExclusiveFunction<S,java.lang.Void,java.lang.Exception> adapt(java.util.concurrent.Callable<S> callable)
Adapts the supplied parameter to $ScopedExclusionService.ExclusiveFunction



Copyright © 2012 Atlassian. All Rights Reserved.