Class SendFromOwned<I extends Resource<I>,​T extends ResourceSupport<I,​T>>

    • Constructor Detail

      • SendFromOwned

        public SendFromOwned​(Owned<T> outgoing,
                             Drop<T> drop,
                             Class<?> concreteType)
    • Method Detail

      • receive

        public I receive()
        Description copied from interface: Send
        Receive the Resource instance being sent, and bind its ownership to the calling thread. The invalidation of the sent resource in the sending thread happens-before the return of this method.

        This method can only be called once, and will throw otherwise.

        Specified by:
        receive in interface Send<I extends Resource<I>>
        Returns:
        The sent resource instance, never null.
      • referentIsInstanceOf

        public boolean referentIsInstanceOf​(Class<?> cls)
        Description copied from interface: Send
        Determine if the object received from this Send is an instance of the given class.
        Specified by:
        referentIsInstanceOf in interface Send<I extends Resource<I>>
        Parameters:
        cls - The type to check.
        Returns:
        true if the object received from this Send can be assigned fields or variables of the given type, otherwise false.
      • close

        public void close()
        Description copied from interface: Send
        Discard this Send and the object it contains. This has no effect if the send-object has already been received.
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface SafeCloseable
        Specified by:
        close in interface Send<I extends Resource<I>>