package nl.tudelft.simulation.examples.dsol.terminal; import java.io.Serializable; import java.rmi.RemoteException; import nl.tudelft.simulation.dsol.simtime.SimTime; /** * This interface provides a callback method to the resource. Whenever resource is available this method is invoked on the * requestor.. *

* Copyright (c) 2002-2022 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See * for project information https://simulation.tudelft.nl. The DSOL * project is distributed under a three-clause BSD-style license, which can be found at * * https://simulation.tudelft.nl/dsol/3.0/license.html. *

* @author Peter Jacobs * @param the absolute time type to use in timed events * @param the relative time type * @param the simulation time type. * @since 1.5 */ public interface IntResourceRequestorInterface & Serializable, R extends Number & Comparable, T extends SimTime> { /** * receive the requested resource. * @param requestedCapacity long; reflects the amount requested. * @param resource IntResource<A,R,T>; the requested resource. * @throws RemoteException on network failure. */ void receiveRequestedResource(long requestedCapacity, IntResource resource) throws RemoteException; /** * receive the requested resource. * @param requestedCapacity int; reflects the amount requested. * @param resource IntResource<A,R,T>; the requested resource. * @throws RemoteException on network failure. */ default void receiveRequestedResource(int requestedCapacity, IntResource resource) throws RemoteException { receiveRequestedResource((long) requestedCapacity, resource); } }