Modifier and Type | Field and Description |
---|---|
static Boolean |
LOCAL_MEMBER
Denotes that a
SimpleMember is a representation of a Local Member, thus a representation of the instance
itself. |
static Boolean |
REMOTE_MEMBER
Denotes that a
SimpleMember is a representation of a Remote Member. |
Constructor and Description |
---|
SimpleMember(String name,
E endpoint,
boolean local,
Consumer<SimpleMember<E>> suspectHandler)
Create the service member
|
Modifier and Type | Method and Description |
---|---|
E |
endpoint()
Returns this Member's endpoint.
|
boolean |
equals(Object o) |
<T> Optional<T> |
getConnectionEndpoint(Class<T> protocol)
Get the endpoint of this Member given a
protocol . |
int |
hashCode() |
boolean |
local() |
String |
name()
Returns the name of this Member.
|
void |
suspect()
Mark this member as suspect, i.e.
|
String |
toString() |
public static final Boolean LOCAL_MEMBER
SimpleMember
is a representation of a Local Member, thus a representation of the instance
itself.public static final Boolean REMOTE_MEMBER
SimpleMember
is a representation of a Remote Member.public SimpleMember(String name, E endpoint, boolean local, Consumer<SimpleMember<E>> suspectHandler)
name
- the member nameendpoint
- The object describing the endpointlocal
- True if the member is local. False if the member is remote or if this information is unknown.suspectHandler
- The operation to execute when this member is marked as a suspectpublic String name()
Member
public <T> Optional<T> getConnectionEndpoint(Class<T> protocol)
Member
protocol
. Returns an empty optional if the protocol is not a
supported endpoint of this member.getConnectionEndpoint
in interface Member
T
- the protocol typeprotocol
- the expectedpublic void suspect()
Member
public E endpoint()
public boolean local()
Copyright © 2010–2020. All rights reserved.