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(org.glassfish.hk2.api.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(org.glassfish.hk2.api.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()
ResourceModelComponent
getComponents
in interface ResourceModelComponent
public void accept(ResourceModelVisitor visitor)
ResourceModelComponent
accept
in interface ResourceModelComponent
visitor
- resource model visitor.protected abstract Object getHandlerInstance()
null
if the handler is
class-based
.Copyright © 2007-2015, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.