Resource, used for transferring the ownership of the
resource from one thread to another.
Prior to the Send being created, the originating resource is invalidated, to prevent access while it is being
sent. This means it cannot be accessed, closed, or disposed of, while it is in-flight. Once the resource is
received, the new ownership is established.
Care must be taken to ensure that the resource is always received by some thread. Failure to do so can result in a resource leak.
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public static boolean | Returns: true if the candidate object is a Send that would deliver an object of the given type,
otherwise false.The type of object we wish to receive. type, Object The candidate object that might be a candidate)Send of an object of the given type.Determine if the given candidate object is an instance of a |
| public default < The result type of the mapping function. R extends Resource | |
| public T | |
| public boolean | Returns: true if the object received from this Send can be assigned fields or variables of the
given type, otherwise false.The type to check. cls)Determine if the object received from this |
| public static < The type of object being sent. T extends Resource | Returns: ASend which will deliver an object of the given type, from the supplier.The concrete type of the object being sent. Specifically, the object returned from the
concreteObjectType, Supplier<? extends T> Supplier#get() method must be an instance of this class.The supplier of the object being sent, which will be called when the object is ready to
be received. supplier) |
| close | back to summary |
|---|---|
| public void close() Redeclares io. Discard this
| |
| isSendOf | back to summary |
|---|---|
| public static boolean isSendOf(Class<?> type, Object candidate) Determine if the given candidate object is an instance of a | |
| map | back to summary |
|---|---|
| public default <R extends Resource Apply a mapping function to the object being sent. The mapping will occur when the object is received. | |
| receive | back to summary |
|---|---|
| public T receive() Receive the This method can only be called once, and will throw otherwise.
| |
| referentIsInstanceOf | back to summary |
|---|---|
| public boolean referentIsInstanceOf(Class<?> cls) Determine if the object received from this
| |
| sending | back to summary |
|---|---|
| public static <T extends Resource Construct a
| |