public interface ExtendedCallback extends Callback
For example, the following code can be used to detect an optional callback instead of failing if the callback is unrecognized:
if (callback instanceof ExtendedCallback && ((ExtendedCallback) callback).isOptional()) {
// The callback is harmless
return;
}
// Let the caller know that we failed to support this callback
throw new UnsupportedCallbackException(callback);
Or, the utility method in CallbackUtil
can be used:
CallbackUtils.unsupported(callback);
Modifier and Type | Method and Description |
---|---|
default boolean |
isOptional()
Determine if this callback is optional.
|
default boolean |
needsInformation()
Determine if this callback is requesting information.
|
default boolean isOptional()
true
if the callback is optional, false
if it is mandatorydefault boolean needsInformation()
true
if the callback is requesting information, false
if it is only providing informationCopyright © 2017 JBoss by Red Hat. All rights reserved.