org.interledger.link.StatefulLink Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of link-core Show documentation
Show all versions of link-core Show documentation
A Link abstraction for connecting Interledger peers.
package org.interledger.link;
import org.interledger.link.events.LinkConnectionEventListener;
/**
* Defines a {@link Link} that holds connection state and possibly other stateful data. Because this type of {@link
* Link} holds a connection, it cannot be load-balance in the typical fashion. For example, a Link with an underlying
* Websocket connection cannot easily be transitioned and serviced by another ILP node instance in a different
* runtime.
*/
public interface StatefulLink extends Link, Connectable {
/**
* Add an event listener to this link.
*
* Care should be taken when adding multiple listeners to ensure that they perform distinct operations, otherwise
* duplicate functionality might be unintentionally introduced.
*
* @param eventListener A {@link LinkConnectionEventListener} that can listen for and response to various types of
* events emitted by this link.
*/
void addLinkEventListener(LinkConnectionEventListener eventListener);
/**
* Removes an event listener from the collection of listeners registered with this link.
*
* @param eventListener A {@link LinkConnectionEventListener} representing the listener to remove.
*/
void removeLinkEventListener(LinkConnectionEventListener eventListener);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy