org.universAAL.middleware.api.impl
Class ServiceCalleeWrapper
java.lang.Object
org.universAAL.middleware.bus.member.BusMember
org.universAAL.middleware.bus.member.Callee
org.universAAL.middleware.service.ServiceCallee
org.universAAL.middleware.api.impl.ServiceCalleeWrapper
public class ServiceCalleeWrapper
- extends ServiceCallee
Basic class for wrapping ServiceCallee. It acts as a proxy for actual
implementation which was annotated by UniversAALService annotation. During
handleCall it invokes original service by reflection and create proper
ServiceResponse object.
- Author:
- dzmuda
Constructor Summary |
ServiceCalleeWrapper(ModuleContext context,
ServiceProfile[] realizedServices,
Object wrappedObject,
String namespace,
String serviceURI,
Map<String,Method> annotatedMethods,
Map<String,List<String>> annotatedOutputNames,
Map<String,List<Output>> annotatedOutputs,
Map<String,List<String>> annotatedMethodsParametersNames,
Map<String,List<Input>> annotatedMethodsParameters)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ServiceCalleeWrapper
public ServiceCalleeWrapper(ModuleContext context,
ServiceProfile[] realizedServices,
Object wrappedObject,
String namespace,
String serviceURI,
Map<String,Method> annotatedMethods,
Map<String,List<String>> annotatedOutputNames,
Map<String,List<Output>> annotatedOutputs,
Map<String,List<String>> annotatedMethodsParametersNames,
Map<String,List<Input>> annotatedMethodsParameters)
communicationChannelBroken
public void communicationChannelBroken()
- Description copied from class:
ServiceCallee
- This abstract method is called for each member of the bus when the bus is
being stopped.
- Specified by:
communicationChannelBroken
in class ServiceCallee
handleCall
public ServiceResponse handleCall(ServiceCall call)
- Handles the incoming ServiceCall and check if it fits to methods declared
by wrapped object. If so, it invoke such method with reflection and
create proper ServiceResponse
It is crucial to remember that Output in ServiceResponse has to be either
List or RDF object because TypeMapper.asLiteral does not support other
types. If output is an Array it is automatically converted into a List.
- Specified by:
handleCall
in class ServiceCallee
- Parameters:
call
- the call that needs to be serviced.
- Returns:
- the result of the call execution.
- See Also:
ServiceCallee.handleCall(org.universAAL.middleware.service.ServiceCall)
setProfiles
public void setProfiles(ServiceProfile[] profiles)
getProfiles
public ServiceProfile[] getProfiles()
Copyright © 2014 universAAL Consortium. All Rights Reserved.