public class ResolveInterceptor extends AbstractApplicableInterceptor
Modifier and Type | Class and Description |
---|---|
static class |
ResolveInterceptor.SerializedValue
Struct for serialized value.
|
Modifier and Type | Field and Description |
---|---|
protected IInternalAccess |
ia
The component.
|
protected static java.lang.reflect.Method |
INVOKE_METHOD |
static java.util.Set<java.lang.reflect.Method> |
SERVICEMETHODS
The static map of subinterceptors (method -> interceptor).
|
protected static java.lang.reflect.Method |
SHUTDOWN_METHOD |
protected static java.lang.reflect.Method |
START_METHOD |
Constructor and Description |
---|
ResolveInterceptor(IInternalAccess ia)
Create a new ResolveInterceptor.
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.Object |
convertFromJsonString(java.lang.String val,
java.lang.Class<?> type)
Convert json to object representation.
|
protected java.lang.Object |
convertFromString(java.lang.String val,
java.lang.Class<?> type)
Convert to object representation.
|
protected java.lang.Object |
convertParameter(java.lang.Object value,
java.lang.reflect.Type targettype)
Convert a parameter to a target type.
|
protected java.lang.String |
convertToJsonString(java.lang.Object val)
Convert an object to the json string representation.
|
IFuture<java.lang.Void> |
execute(ServiceInvocationContext sic)
Execute the interceptor.
|
protected Tuple2<java.lang.reflect.Method,java.lang.Object[]> |
findMethod(java.lang.Object[] params,
ClassInfo[] argtypes,
java.lang.Class<?> serclazz,
java.lang.String methodname)
Find the correct method by its name and parameter values.
|
protected java.lang.Object[] |
generateParameters(java.lang.Object[] vals,
java.lang.reflect.Method m)
Generate call parameters.
|
protected IFuture<java.lang.Void> |
invokeDoubleMethod(ServiceInvocationContext sic,
ServiceInfo si,
java.lang.reflect.Method m,
java.lang.Class<? extends java.lang.annotation.Annotation> annotation,
boolean firstorig)
Invoke double methods.
|
protected boolean |
isSupportedBasicType(java.lang.Class<?> type)
Test if basic converter can handle this type.
|
isApplicable
public static final java.util.Set<java.lang.reflect.Method> SERVICEMETHODS
protected static final java.lang.reflect.Method START_METHOD
protected static final java.lang.reflect.Method SHUTDOWN_METHOD
protected static final java.lang.reflect.Method INVOKE_METHOD
protected IInternalAccess ia
public ResolveInterceptor(IInternalAccess ia)
public IFuture<java.lang.Void> execute(ServiceInvocationContext sic)
context
- The invocation context.protected IFuture<java.lang.Void> invokeDoubleMethod(ServiceInvocationContext sic, ServiceInfo si, java.lang.reflect.Method m, java.lang.Class<? extends java.lang.annotation.Annotation> annotation, boolean firstorig)
protected Tuple2<java.lang.reflect.Method,java.lang.Object[]> findMethod(java.lang.Object[] params, ClassInfo[] argtypes, java.lang.Class<?> serclazz, java.lang.String methodname)
decparams
- Partially decoded parameters.serclazz
- The target class.methodname
- The method nameprotected java.lang.Object[] generateParameters(java.lang.Object[] vals, java.lang.reflect.Method m) throws java.lang.Exception
vals
- The current parameters.java.lang.Exception
protected java.lang.Object convertParameter(java.lang.Object value, java.lang.reflect.Type targettype) throws java.lang.Exception
java.lang.Exception
protected java.lang.String convertToJsonString(java.lang.Object val)
val
- The value.protected java.lang.Object convertFromJsonString(java.lang.String val, java.lang.Class<?> type)
val
- The json value.protected java.lang.Object convertFromString(java.lang.String val, java.lang.Class<?> type)
val
- The string value.protected boolean isSupportedBasicType(java.lang.Class<?> type)
type
- The type.