Class ProtonEndpoint<E extends Endpoint<E>>

    • Constructor Detail

      • ProtonEndpoint

        public ProtonEndpoint​(ProtonEngine engine)
        Create a new ProtonEndpoint instance with the given Engine as the owner.
        Parameters:
        engine - The Engine that this Endpoint belongs to.
    • Method Detail

      • getLinkedResource

        public <T> T getLinkedResource()
        Specified by:
        getLinkedResource in interface Endpoint<E extends Endpoint<E>>
        Type Parameters:
        T - The type that the linked resource should be cast to on return.
        Returns:
        the user set linked resource for this Endpoint instance.
      • getLinkedResource

        public <T> T getLinkedResource​(java.lang.Class<T> typeClass)
        Description copied from interface: Endpoint
        Gets the linked resource (if set) and returns it using the type information provided to cast the returned value.
        Specified by:
        getLinkedResource in interface Endpoint<E extends Endpoint<E>>
        Type Parameters:
        T - The type to cast the linked resource to if one is set.
        Parameters:
        typeClass - the type's Class which is used for casting the returned value.
        Returns:
        the user set linked resource for this Context instance.
      • openHandler

        public E openHandler​(EventHandler<E> remoteOpenEventHandler)
        Description copied from interface: Endpoint
        Sets a EventHandler for when an AMQP Open frame is received from the remote peer. Used to process remotely initiated Connections. Locally initiated sessions have their own EventHandler invoked instead. This method is typically used by servers to listen for the remote peer to open its Endpoint, while a client would listen for the server to open its end of the Endpoint once a local open has been performed. Typically used by clients as servers will typically listen to some parent resource event handler to determine if the remote is initiating a resource open.
        Specified by:
        openHandler in interface Endpoint<E extends Endpoint<E>>
        Parameters:
        remoteOpenEventHandler - the EventHandler that will be signaled when the Endpoint has been remotely opened
        Returns:
        this Endpoint instance.
      • closeHandler

        public E closeHandler​(EventHandler<E> remoteCloseEventHandler)
        Description copied from interface: Endpoint
        Sets a EventHandler for when an AMQP Close frame is received from the remote peer.
        Specified by:
        closeHandler in interface Endpoint<E extends Endpoint<E>>
        Parameters:
        remoteCloseEventHandler - the EventHandler that will be signaled when the Endpoint is remotely closed.
        Returns:
        this Endpoint instance.
      • localOpenHandler

        public E localOpenHandler​(EventHandler<E> localOpenEventHandler)
        Description copied from interface: Endpoint
        Sets a EventHandler for when an this Endpoint is opened locally via a call to Endpoint.open() Typically used by clients for logging or other state update event processing. Clients should not perform any blocking calls within this context. It is an error for the handler to throw an exception and the outcome of doing so is undefined.
        Specified by:
        localOpenHandler in interface Endpoint<E extends Endpoint<E>>
        Parameters:
        localOpenEventHandler - The EventHandler to notify when this Endpoint is locally opened.
        Returns:
        this Endpoint instance.
      • localCloseHandler

        public E localCloseHandler​(EventHandler<E> localCloseEventHandler)
        Description copied from interface: Endpoint
        Sets a EventHandler for when an this Endpoint is closed locally via a call to Endpoint.close() Typically used by clients for logging or other state update event processing. Clients should not perform any blocking calls within this context. It is an error for the handler to throw an exception and the outcome of doing so is undefined.
        Specified by:
        localCloseHandler in interface Endpoint<E extends Endpoint<E>>
        Parameters:
        localCloseEventHandler - The EventHandler to notify when this Endpoint is locally closed.
        Returns:
        this Endpoint instance.
      • engineShutdownHandler

        public E engineShutdownHandler​(EventHandler<Engine> engineShutdownEventHandler)
        Description copied from interface: Endpoint
        Sets an EventHandler that is invoked when the engine that supports this Endpoint is shutdown via a call to Engine.shutdown() which indicates a desire to terminate all engine operations. Any Endpoint that has been both locally and remotely closed will not receive this event as it will no longer be tracked by the parent its parent Endpoint. A typical use of this event would be from a locally closed Endpoint that is awaiting response from the remote. If this event fires then there will never be a remote response to any pending operations and the client or server instance should react accordingly to clean up any related resources etc.
        Specified by:
        engineShutdownHandler in interface Endpoint<E extends Endpoint<E>>
        Parameters:
        engineShutdownEventHandler - the EventHandler that will be signaled when this Endpoint's engine is explicitly shutdown.
        Returns:
        this Endpoint instance.