com.kuka.roboticsAPI.controllerModel
Class RequestService

java.lang.Object
  extended by com.kuka.roboticsAPI.controllerModel.ControllerService
      extended by com.kuka.roboticsAPI.controllerModel.RequestService
Direct Known Subclasses:
SunriseRequestService

public abstract class RequestService
extends ControllerService

A request service is a part of a controller. Each controller must implement it's own request service.

This service must be able to handle given requests. If it cannot handle a request (because it does not know it's type) it must leave the request untouched. The more requests this service can handle, the better the integration within the RoboticsAPI.

This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

Constructor Summary
RequestService()
           
 
Method Summary
protected  void initialize()
          Initializes this service.
protected  void onPerformRequest(IRequest request)
          Default handling inside the concrete request service.
 Object performRequest(IRequest request)
          Performs the given request.
 void register(IRequestHandler handler)
          Registers a new handler for a request type on the service.
 void unregister(IRequestHandler handler)
          Unregisters the request handler.
 
Methods inherited from class com.kuka.roboticsAPI.controllerModel.ControllerService
dispose, getContext, getController
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RequestService

public RequestService()
Method Detail

initialize

protected void initialize()
Description copied from class: ControllerService
Initializes this service. May be overridden by subclasses.

Please note that when the method is called, the controller of the service is not yet initialized. This means that there are no guarantees that the controller is operable.

Overrides:
initialize in class ControllerService

onPerformRequest

protected void onPerformRequest(IRequest request)
Default handling inside the concrete request service. Tells the service, that the request should be performed. If the service cannot handle the request, it should leave it untouched.

Note that the base implementation does nothing with the request.

Parameters:
request - The request which should be performed. Will never be null.

register

public void register(IRequestHandler handler)
Registers a new handler for a request type on the service.

The handler will get called when a request of a type supported by the handler is issued to the service and it has no default handler for the request type.

Parameters:
handler - The handler.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

unregister

public void unregister(IRequestHandler handler)
Unregisters the request handler.

Parameters:
handler - The handler.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

performRequest

public Object performRequest(IRequest request)
Performs the given request.

Parameters:
request - The request which should be performed by this service. null is not allowed.
Returns:
The result of the request (this can also be obtained from the request itself).
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.


Copyright © 2019. All rights reserved.