public class ApiMethodBasedApiInterface extends Object implements ApiInterface
ApiInterface
implementation that uses ApiMethod
Constructor and Description |
---|
ApiMethodBasedApiInterface(InterfaceIdentifier iface)
Constructor.
|
ApiMethodBasedApiInterface(String iface)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
InterfaceDefinition |
getDefinition()
Returns the details for this interface.
|
InterfaceIdentifier |
getIdentifier()
Returns the identifier for this interface.
|
MethodDefinition |
getMethodDefinition(MethodIdentifier methodId)
Returns method definition for the specified method identifier.
|
void |
invoke(ExecutionContext ctx,
MethodIdentifier methodId,
DataValue input,
AsyncHandle<MethodResult> asyncHandle)
Invokes a method and returns the result of that method invocation.
|
public ApiMethodBasedApiInterface(InterfaceIdentifier iface)
iface
- interface identifierpublic ApiMethodBasedApiInterface(String iface)
iface
- interface namepublic InterfaceIdentifier getIdentifier()
ApiInterface
getIdentifier
in interface ApiInterface
public InterfaceDefinition getDefinition()
ApiInterface
getDefinition
in interface ApiInterface
public MethodDefinition getMethodDefinition(MethodIdentifier methodId)
ApiInterface
getMethodDefinition
in interface ApiInterface
methodId
- identifier of the methodMethodDefinition
representing details for the
requested method; or null
method is not availablepublic void invoke(ExecutionContext ctx, MethodIdentifier methodId, DataValue input, AsyncHandle<MethodResult> asyncHandle)
ApiInterface
invoke
in interface ApiInterface
ctx
- execution context for method invocationmethodId
- identifier of the method to invoke; if there is no
such method, an error will be returnedinput
- input data valueasyncHandle
- handle used to return result or errorCopyright © 2015. All Rights Reserved.