All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.opentcs.access.rmi.services.RemoteQueryServiceProxy Maven / Gradle / Ivy

// SPDX-FileCopyrightText: The openTCS Authors
// SPDX-License-Identifier: MIT
package org.opentcs.access.rmi.services;

import java.rmi.RemoteException;
import org.opentcs.components.kernel.Query;
import org.opentcs.components.kernel.services.QueryService;

/**
 * The default implementation of the query service.
 * Delegates method invocations to the corresponding remote service.
 */
class RemoteQueryServiceProxy
    extends
      AbstractRemoteServiceProxy
    implements
      QueryService {

  /**
   * Creates a new instance.
   */
  RemoteQueryServiceProxy() {
  }

  @Override
  public  T query(Query query) {
    checkServiceAvailability();

    try {
      return getRemoteService().query(getClientId(), query);
    }
    catch (RemoteException ex) {
      throw findSuitableExceptionFor(ex);
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy