Class ServiceHandler<DT extends chemaxon.marvin.services.ServiceDescriptor>

java.lang.Object
chemaxon.marvin.services.ServiceHandler<DT>
Type Parameters:
DT - the descriptor type

@PublicAPI public abstract class ServiceHandler<DT extends chemaxon.marvin.services.ServiceDescriptor> extends Object
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).
Since:
5.6
  • Constructor Details

    • ServiceHandler

      public ServiceHandler()
  • Method Details

    • callService

      public <T> void callService(DT descriptor, AsyncCallback<T> handler, Object... arguments)
      Performs thread-safe asynchronous service call.
      Type Parameters:
      T - the return type
      Parameters:
      descriptor - the service descriptor
      handler - the response handler
      arguments - the service call arguments
    • callService

      public abstract <T> T callService(DT descriptor, Object... arguments) throws ServiceException
      Performs a service call.
      Parameters:
      descriptor - the service descriptor
      arguments - the service call arguments
      Returns:
      result of service call
      Throws:
      ServiceException - on failure