com.mycompany.myproject.api
Class MyFunction

java.lang.Object
  extended byorg.xins.common.manageable.Manageable
      extended byorg.xins.server.Function
          extended bycom.mycompany.myproject.api.MyFunction
Direct Known Subclasses:
MyFunctionImpl

public abstract class MyFunction
extends Function

Abstract base class for MyFunction function implementation.


Nested Class Summary
static class MyFunction.Request
          Container for the input parameters of the MyFunction function.
static interface MyFunction.Result
          Result of a call to the MyFunction function.
static class MyFunction.SuccessfulResult
          Successful result of a call to the MyFunction function.
static interface MyFunction.UnsuccessfulResult
          Unsuccessful result of a call to the MyFunction function.
 
Nested classes inherited from class org.xins.common.manageable.Manageable
Manageable.State
 
Field Summary
 
Fields inherited from class org.xins.common.manageable.Manageable
BOOTSTRAPPED, BOOTSTRAPPING, DEINITIALIZING, INITIALIZING, UNUSABLE, USABLE
 
Constructor Summary
protected MyFunction(APIImpl api)
          Constructs a new MyFunction instance.
 
Method Summary
abstract  MyFunction.Result call(MyFunction.Request request)
          Calls this function.
protected  FunctionResult handleCall(CallContext _context)
           
 
Methods inherited from class org.xins.server.Function
getAPI, getName, isEnabled, setEnabled
 
Methods inherited from class org.xins.common.manageable.Manageable
assertUsable, bootstrap, bootstrapImpl, deinit, deinitImpl, getState, init, initImpl, isBootstrapped, isUsable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MyFunction

protected MyFunction(APIImpl api)
Constructs a new MyFunction instance.

Parameters:
api - the API to which this function belongs, guaranteed to be not null.
Method Detail

handleCall

protected final FunctionResult handleCall(CallContext _context)
                                   throws Throwable
Throws:
Throwable

call

public abstract MyFunction.Result call(MyFunction.Request request)
                                throws Throwable
Calls this function. If the function fails, it may throw any kind of exception. All exceptions will be handled by the caller.

Parameters:
request - the request, never null.
Returns:
the result of the function call, should never be null.
Throws:
Throwable - if anything went wrong.