public enum HookEvent extends Enum<HookEvent>
@RestHook
-annotated Java methods
to be called.
Enum Constant and Description |
---|
DESTROY
Identifies a method that gets called during servlet destroy.
|
END_CALL
Identifies a method that gets called right before we exit the servlet service method.
|
INIT
Identifies a method that gets called during servlet initialization.
|
POST_CALL
Identifies a method that gets called immediately after the
|
POST_INIT
Identifies a method that gets called immediately after servlet initialization.
|
POST_INIT_CHILD_FIRST
Identical to
POST_INIT except the order of execution is child-resources first. |
PRE_CALL
Identifies a method that gets called immediately before the
|
START_CALL
Identifies a method that should be called immediately after the
|
Modifier and Type | Method and Description |
---|---|
static HookEvent |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static HookEvent[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final HookEvent START_CALL
Note that you only have access to the raw request and response objects at this point.
The list of valid parameter types are as follows:
HttpExceptions
can be thrown to cause a particular HTTP error status code.
super .parentMethod(...)
.
public static final HookEvent PRE_CALL
At this point, the RestRequest
object has been fully initialized, and all RestGuard
and
RestMatcher
objects have been called.
The list of valid parameter types are as follows:
HttpExceptions
can be thrown to cause a particular HTTP error status code.
super .parentMethod(...)
.
public static final HookEvent POST_CALL
At this point, the output object returned by the method call has been set on the response, but
RestConverters
have not yet been executed and the response has not yet been written.
The list of valid parameter types are the same as PRE_CALL
.
super .parentMethod(...)
.
public static final HookEvent END_CALL
At this point, the output has been written and flushed.
The list of valid parameter types are as follows:
The following attributes are set on the HttpServletRequest
object that can be useful for logging purposes:
super .parentMethod(...)
.
public static final HookEvent INIT
This method is called from within the Servlet.init(ServletConfig)
method after the RestContextBuilder
object has been created and initialized with the annotations defined on the class, but before the
RestContext
object has been created.
The only valid parameter type for this method is RestContextBuilder
which can be used to configure the servlet.
An example of this is the
super .parentMethod(...)
.
public static final HookEvent POST_INIT
This method is called from within the Servlet.init(ServletConfig)
method after the RestContext
object has been created.
The only valid parameter type for this method is RestContext
which can be used to retrieve information
about the servlet.
super .parentMethod(...)
.
public static final HookEvent POST_INIT_CHILD_FIRST
POST_INIT
except the order of execution is child-resources first.
Use this annotation if you need to perform any kind of initialization on child resources before the parent resource.
This method is called from within the Servlet.init(ServletConfig)
method after the RestContext
object has been created and after the POST_INIT
methods have been called.
The only valid parameter type for this method is RestContext
which can be used to retrieve information
about the servlet.
public static final HookEvent DESTROY
This method is called from within the Servlet.destroy()
.
The only valid parameter type for this method is RestContext
, although typically no arguments will
be specified.
super .parentMethod(...)
.
public static HookEvent[] values()
for (HookEvent c : HookEvent.values()) System.out.println(c);
public static HookEvent valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullCopyright © 2016–2019 The Apache Software Foundation. All rights reserved.