Class ResolveInterceptor
java.lang.Object
jadex.providedservice.impl.service.interceptors.AbstractApplicableInterceptor
jadex.providedservice.impl.service.interceptors.ResolveInterceptor
- All Implemented Interfaces:
IServiceInvocationInterceptor
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 Summary
Nested ClassesModifier and TypeClassDescriptionstatic classStruct for serialized value. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionResolveInterceptor(jadex.core.impl.Component ia) Create a new ResolveInterceptor. -
Method Summary
Modifier and TypeMethodDescriptionprotected ObjectconvertFromJsonString(String val, Class<?> type) Convert json to object representation.protected ObjectconvertFromString(String val, Class<?> type) Convert to object representation.protected ObjectconvertParameter(Object value, Type targettype) Convert a parameter to a target type.protected StringConvert an object to the json string representation.jadex.future.IFuture<Void> Execute the interceptor.findMethod(Object[] params, jadex.common.ClassInfo[] argtypes, Class<?> serclazz, String methodname) Find the correct method by its name and parameter values.protected Object[]generateParameters(Object[] vals, Method m) Generate call parameters.final jadex.serialization.ISerializationServicesprotected jadex.future.IFuture<Void> invokeDoubleMethod(ServiceInvocationContext sic, ServiceInfo si, Method m, Class<? extends Annotation> annotation, boolean firstorig, boolean ignorenotfound) Invoke double methods.protected booleanisSupportedBasicType(Class<?> type) Test if basic converter can handle this type.static MethodsearchMethod(Class<?> impl, Class<? extends Annotation> annotation) Search an annotation method.Methods inherited from class jadex.providedservice.impl.service.interceptors.AbstractApplicableInterceptor
isApplicable
-
Field Details
-
SERVICEMETHODS
The static map of subinterceptors (method -> interceptor). -
START_METHOD
-
SHUTDOWN_METHOD
-
INVOKE_METHOD
-
ia
protected jadex.core.impl.Component iaThe component.
-
-
Constructor Details
-
ResolveInterceptor
public ResolveInterceptor(jadex.core.impl.Component ia) Create a new ResolveInterceptor.
-
-
Method Details
-
execute
Execute the interceptor.- Parameters:
sic- The invocation context.context- The invocation context.
-
searchMethod
Search an annotation method. -
invokeDoubleMethod
protected jadex.future.IFuture<Void> invokeDoubleMethod(ServiceInvocationContext sic, ServiceInfo si, Method m, Class<? extends Annotation> annotation, boolean firstorig, boolean ignorenotfound) Invoke double methods. The boolean 'firstorig' determines if basicservice method is called first. -
findMethod
protected jadex.common.Tuple2<Method,Object[]> findMethod(Object[] params, jadex.common.ClassInfo[] argtypes, Class<?> serclazz, 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:
serclazz- The target class.methodname- The method namedecparams- Partially decoded parameters.- Returns:
- The method and further decoded parameters.
-
generateParameters
Generate call parameters.- Parameters:
vals- The current parameters.- Returns:
- The adapted method call parameters.
- Throws:
Exception
-
convertParameter
Convert a parameter to a target type.- Throws:
Exception
-
getSerializationServices
public final jadex.serialization.ISerializationServices getSerializationServices() -
convertToJsonString
Convert an object to the json string representation.- Parameters:
val- The value.- Returns:
- The string representation.
-
convertFromJsonString
Convert json to object representation.- Parameters:
val- The json value.- Returns:
- The object.
-
convertFromString
Convert to object representation.- Parameters:
val- The string value.- Returns:
- The object.
-
isSupportedBasicType
Test if basic converter can handle this type.- Parameters:
type- The type.- Returns:
- True if it can handle this type.
-