Class ResolveInterceptor
- java.lang.Object
- 
- jadex.bridge.service.component.interceptors.AbstractApplicableInterceptor
- 
- jadex.bridge.service.component.interceptors.ResolveInterceptor
 
 
- 
- All Implemented Interfaces:
- IServiceInvocationInterceptor
 
 public class ResolveInterceptor extends AbstractApplicableInterceptor The resolve interceptor is responsible for determining the object on which the method invocation is finally performed. Checks whether the object is a ServiceInfo. In this case it delegates method calls of I(Internal)Service to the automatically created BasicService instance and all other calls to the domain object. // todo: much annotation stuff and injection of objects to the pojo.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classResolveInterceptor.SerializedValueStruct for serialized value.
 - 
Field SummaryFields Modifier and Type Field Description protected IInternalAccessiaThe component.protected static java.lang.reflect.MethodINVOKE_METHODstatic java.util.Set<java.lang.reflect.Method>SERVICEMETHODSThe static map of subinterceptors (method -> interceptor).protected static java.lang.reflect.MethodSHUTDOWN_METHODprotected static java.lang.reflect.MethodSTART_METHOD
 - 
Constructor SummaryConstructors Constructor Description ResolveInterceptor(IInternalAccess ia)Create a new ResolveInterceptor.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.ObjectconvertFromJsonString(java.lang.String val, java.lang.Class<?> type)Convert json to object representation.protected java.lang.ObjectconvertFromString(java.lang.String val, java.lang.Class<?> type)Convert to object representation.protected java.lang.ObjectconvertParameter(java.lang.Object value, java.lang.reflect.Type targettype)Convert a parameter to a target type.protected java.lang.StringconvertToJsonString(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, boolean ignorenotfound)Invoke double methods.protected booleanisSupportedBasicType(java.lang.Class<?> type)Test if basic converter can handle this type.protected java.lang.reflect.MethodsearchMethod(java.lang.Class<?> impl, java.lang.Class<? extends java.lang.annotation.Annotation> annotation)Search an annotation method.- 
Methods inherited from class jadex.bridge.service.component.interceptors.AbstractApplicableInterceptorisApplicable
 
- 
 
- 
- 
- 
Field Detail- 
SERVICEMETHODSpublic static final java.util.Set<java.lang.reflect.Method> SERVICEMETHODS The static map of subinterceptors (method -> interceptor).
 - 
START_METHODprotected static final java.lang.reflect.Method START_METHOD 
 - 
SHUTDOWN_METHODprotected static final java.lang.reflect.Method SHUTDOWN_METHOD 
 - 
INVOKE_METHODprotected static final java.lang.reflect.Method INVOKE_METHOD 
 - 
iaprotected IInternalAccess ia The component.
 
- 
 - 
Constructor Detail- 
ResolveInterceptorpublic ResolveInterceptor(IInternalAccess ia) Create a new ResolveInterceptor.
 
- 
 - 
Method Detail- 
executepublic IFuture<java.lang.Void> execute(ServiceInvocationContext sic) Execute the interceptor.- Parameters:
- context- The invocation context.
 
 - 
searchMethodprotected java.lang.reflect.Method searchMethod(java.lang.Class<?> impl, java.lang.Class<? extends java.lang.annotation.Annotation> annotation)Search an annotation method.
 - 
invokeDoubleMethodprotected 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, boolean ignorenotfound) Invoke double methods. The boolean 'firstorig' determines if basicservice method is called first.
 - 
findMethodprotected 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. The parameter values are half-evaluated, i.e. if they are deserialized as far as possible. Still serialized parameters are saved as SerialiedObject. Those are deserialized using the parameter class as hint.- Parameters:
- decparams- Partially decoded parameters.
- serclazz- The target class.
- methodname- The method name
- Returns:
- The method and further decoded parameters.
 
 - 
generateParametersprotected java.lang.Object[] generateParameters(java.lang.Object[] vals, java.lang.reflect.Method m) throws java.lang.ExceptionGenerate call parameters.- Parameters:
- vals- The current parameters.
- Returns:
- The adapted method call parameters.
- Throws:
- java.lang.Exception
 
 - 
convertParameterprotected java.lang.Object convertParameter(java.lang.Object value, java.lang.reflect.Type targettype) throws java.lang.ExceptionConvert a parameter to a target type.- Throws:
- java.lang.Exception
 
 - 
convertToJsonStringprotected java.lang.String convertToJsonString(java.lang.Object val) Convert an object to the json string representation.- Parameters:
- val- The value.
- Returns:
- The string representation.
 
 - 
convertFromJsonStringprotected java.lang.Object convertFromJsonString(java.lang.String val, java.lang.Class<?> type)Convert json to object representation.- Parameters:
- val- The json value.
- Returns:
- The object.
 
 - 
convertFromStringprotected java.lang.Object convertFromString(java.lang.String val, java.lang.Class<?> type)Convert to object representation.- Parameters:
- val- The string value.
- Returns:
- The object.
 
 - 
isSupportedBasicTypeprotected boolean isSupportedBasicType(java.lang.Class<?> type) Test if basic converter can handle this type.- Parameters:
- type- The type.
- Returns:
- True if it can handle this type.
 
 
- 
 
-