public abstract class MethodHandler extends Object implements ResourceModelComponent
| Constructor and Description |
|---|
MethodHandler() |
| Modifier and Type | Method and Description |
|---|---|
void |
accept(ResourceModelVisitor visitor)
A component should call the visitor back with an appropriate
visitor interface method to give it a chance to process.
|
static MethodHandler |
create(Class<?> handlerClass)
Create a class-based method handler from a class.
|
static MethodHandler |
create(Class<?> handlerClass,
boolean disableParamDecoding)
Create a class-based method handler from a class.
|
static MethodHandler |
create(Object handlerInstance)
Create a instance-based (singleton) method handler from a class.
|
static MethodHandler |
create(Object handlerInstance,
Class<?> handlerClass)
Create a instance-based (singleton) method handler from a class.
|
List<? extends ResourceModelComponent> |
getComponents()
Should return all existing resource model sub-components.
|
List<HandlerConstructor> |
getConstructors()
Get the resource method handler constructors.
|
abstract Class<?> |
getHandlerClass()
Get the resource method handler class.
|
protected abstract Object |
getHandlerInstance()
Get the raw handler instance that is backing this method handler.
|
abstract Object |
getInstance(ServiceLocator locator)
Get the injected resource method handler instance.
|
abstract boolean |
isClassBased()
Return whether the method handler
creates instances
based on classes. |
public static MethodHandler create(Class<?> handlerClass)
handlerClass - method handler class.public static MethodHandler create(Class<?> handlerClass, boolean disableParamDecoding)
handlerClass - method handler class.disableParamDecoding - if set to true, any injected constructor
parameters must be kept encoded and must not be automatically decoded.public static MethodHandler create(Object handlerInstance)
handlerInstance - method handler instance (singleton).public static MethodHandler create(Object handlerInstance, Class<?> handlerClass)
handlerInstance - method handler instance (singleton).handlerClass - declared handler class.public abstract Class<?> getHandlerClass()
public List<HandlerConstructor> getConstructors()
public abstract Object getInstance(ServiceLocator locator)
locator - service locator that can be used to inject get the instance.public abstract boolean isClassBased()
creates instances
based on classes.classes given to HK2, false\
otherwise (for example when method handler was initialized from instance)public List<? extends ResourceModelComponent> getComponents()
ResourceModelComponentgetComponents in interface ResourceModelComponentpublic void accept(ResourceModelVisitor visitor)
ResourceModelComponentaccept in interface ResourceModelComponentvisitor - resource model visitor.protected abstract Object getHandlerInstance()
null if the handler is
class-based.Copyright © 2007-2012 Oracle Corporation. All Rights Reserved. Use is subject to license terms.