Package chemaxon.marvin.services
Class ServiceHandler<DT extends ServiceDescriptor>
java.lang.Object
chemaxon.marvin.services.ServiceHandler<DT>
- Type Parameters:
DT
- the descriptor type
- Direct Known Subclasses:
HTTPServiceHandler
,JsonServiceHandler
,LocalServiceHandler
,SoapServiceHandler
,XMLRPCServiceHandler
Manages service calls.
ServiceHandler keeps track of the previous call and if it is not yet finished cancels it. This ensures that fast consecutive editing in automatic update mode even in the face of slow service calls gets its result timely updated. This works when a ServiceHandler instance is assigned to a single service instance (as defined by a service descriptor).
ServiceHandler keeps track of the previous call and if it is not yet finished cancels it. This ensures that fast consecutive editing in automatic update mode even in the face of slow service calls gets its result timely updated. This works when a ServiceHandler instance is assigned to a single service instance (as defined by a service descriptor).
- Since:
- 5.6
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<T> void
callService
(DT descriptor, AsyncCallback<T> handler, Object... arguments) Performs thread-safe asynchronous service call.abstract <T> T
callService
(DT descriptor, Object... arguments) Performs a service call.
-
Constructor Details
-
ServiceHandler
public ServiceHandler()
-
-
Method Details
-
callService
Performs thread-safe asynchronous service call.- Type Parameters:
T
- the return type- Parameters:
descriptor
- the service descriptorhandler
- the response handlerarguments
- the service call arguments
-
callService
Performs a service call.- Parameters:
descriptor
- the service descriptorarguments
- the service call arguments- Returns:
- result of service call
- Throws:
ServiceException
- on failure
-