org.glassfish.jersey.server.model
Class MethodHandler

java.lang.Object
  extended by org.glassfish.jersey.server.model.MethodHandler
All Implemented Interfaces:
ResourceModelComponent

public abstract class MethodHandler
extends java.lang.Object
implements ResourceModelComponent

Resource method handler model.

Author:
Marek Potociar (marek.potociar at oracle.com)

Constructor Summary
MethodHandler()
           
 
Method Summary
 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(java.lang.Class<?> handlerClass)
          Create a class-based method handler from a class.
static MethodHandler create(java.lang.Class<?> handlerClass, boolean disableParamDecoding)
          Create a class-based method handler from a class.
static MethodHandler create(java.lang.Object handlerInstance)
          Create a instance-based (singleton) method handler from a class.
static MethodHandler create(java.lang.Object handlerInstance, java.lang.Class<?> handlerClass)
          Create a instance-based (singleton) method handler from a class.
 java.util.List<? extends ResourceModelComponent> getComponents()
          Should return all existing resource model sub-components.
 java.util.List<HandlerConstructor> getConstructors()
          Get the resource method handler constructors.
abstract  java.lang.Class<?> getHandlerClass()
          Get the resource method handler class.
abstract  java.lang.Object getInstance(org.glassfish.hk2.inject.Injector injector)
          Get the injected resource method handler instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MethodHandler

public MethodHandler()
Method Detail

create

public static MethodHandler create(java.lang.Class<?> handlerClass)
Create a class-based method handler from a class.

Parameters:
handlerClass - method handler class.
Returns:
new class-based method handler.

create

public static MethodHandler create(java.lang.Class<?> handlerClass,
                                   boolean disableParamDecoding)
Create a class-based method handler from a class.

Parameters:
handlerClass - method handler class.
disableParamDecoding - if set to true, any injected constructor parameters must be kept encoded and must not be automatically decoded.
Returns:
new class-based method handler.

create

public static MethodHandler create(java.lang.Object handlerInstance)
Create a instance-based (singleton) method handler from a class.

Parameters:
handlerInstance - method handler instance (singleton).
Returns:
new instance-based method handler.

create

public static MethodHandler create(java.lang.Object handlerInstance,
                                   java.lang.Class<?> handlerClass)
Create a instance-based (singleton) method handler from a class. This method

Parameters:
handlerInstance - method handler instance (singleton).
handlerClass - declared handler class.
Returns:
new instance-based method handler.

getHandlerClass

public abstract java.lang.Class<?> getHandlerClass()
Get the resource method handler class.

Returns:
resource method handler class.

getConstructors

public java.util.List<HandlerConstructor> getConstructors()
Get the resource method handler constructors. The returned is empty by default. Concrete implementations may override the method to return the actual list of constructors that will be used for the handler initialization.

Returns:
resource method handler constructors.

getInstance

public abstract java.lang.Object getInstance(org.glassfish.hk2.inject.Injector injector)
Get the injected resource method handler instance.

Parameters:
injector - injector that can be used to inject the instance.
Returns:
injected resource method handler instance.

getComponents

public java.util.List<? extends ResourceModelComponent> getComponents()
Description copied from interface: ResourceModelComponent
Should return all existing resource model sub-components.

Specified by:
getComponents in interface ResourceModelComponent
Returns:
list of all sub-components

accept

public void accept(ResourceModelVisitor visitor)
Description copied from interface: ResourceModelComponent
A component should call the visitor back with an appropriate visitor interface method to give it a chance to process.

Specified by:
accept in interface ResourceModelComponent
Parameters:
visitor - resource model visitor.


Copyright © 2007-2012 Oracle Corporation. All Rights Reserved. Use is subject to license terms.