|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xins.common.manageable.Manageable org.xins.server.Function
Base class for function implementation classes.
A function can be enabled or disabled using the
setEnabled(boolean)
method. A function that is enabled can be
invoked, while a function that is disabled cannot. By default a function
is enabled.
Nested Class Summary |
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 |
Fields inherited from interface org.xins.server.DefaultResultCodes |
_DISABLED_FUNCTION, _INTERNAL_ERROR, _INVALID_REQUEST, _INVALID_RESPONSE |
Constructor Summary | |
protected |
Function(API api,
String name,
String version)
Constructs a new Function . |
Method Summary | |
API |
getAPI()
Returns the API that contains this function. |
String |
getName()
Returns the name of this function. |
protected abstract FunctionResult |
handleCall(CallContext context)
Handles a call to this function. |
boolean |
isEnabled()
Checks if this function is currently accessible. |
void |
setEnabled(boolean enabled)
Sets if this function is currently accessible. |
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 |
protected Function(API api, String name, String version) throws IllegalArgumentException
Function
.
api
- the API to which this function belongs, not null
.name
- the name, not null
.version
- the version of the specification this function implements, not
null
.
IllegalArgumentException
- if api == null || name == null || version == null
.Method Detail |
public final API getAPI()
API
, not null
.public final String getName()
null
.public final boolean isEnabled()
true
if this function is currently accessible,
false
otherwise.setEnabled(boolean)
public final void setEnabled(boolean enabled)
enabled
- true
if this function should be accessible,
false
if not.isEnabled()
protected abstract FunctionResult handleCall(CallContext context) throws Throwable
context
- the context for this call, never null
.
null
.
Throwable
- if anything goes wrong.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |