net.sf.lucis.core.impl
Class MayFail<T>

java.lang.Object
  extended by net.sf.lucis.core.impl.MayFail<T>
Type Parameters:
T - Result type.

public abstract class MayFail<T>
extends java.lang.Object

A writer is the object that applies the operations into a store.

Author:
Andres Rodriguez.

Method Summary
 IndexException getException()
           
 T getResult()
           
abstract  IndexStatus getStatus()
           
static
<V> MayFail<V>
of(java.util.concurrent.Callable<V> callabe)
          Runs a possibly failed result from the execution of a callable.
static
<V> V
run(java.util.concurrent.Callable<V> callabe)
          Runs a callable translating the exceptions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getStatus

public abstract IndexStatus getStatus()

getResult

public T getResult()

getException

public IndexException getException()

run

public static <V> V run(java.util.concurrent.Callable<V> callabe)
Runs a callable translating the exceptions.

Type Parameters:
V - Result type.
Parameters:
callabe - Callable to run.
Returns:
The callable result.
Throws:
IndexException - If an error occurs.

of

public static <V> MayFail<V> of(java.util.concurrent.Callable<V> callabe)
Runs a possibly failed result from the execution of a callable.

Type Parameters:
V - Result type.
Parameters:
callabe - Callable to run.
Returns:
The possible failed callable result.


Copyright © 2009. All Rights Reserved.