Class SimpleMember<E>
java.lang.Object
org.axonframework.commandhandling.distributed.SimpleMember<E>
- Type Parameters:
E- The type of the identifier of this entry in the set of nodes
- All Implemented Interfaces:
Member
An endpoint in the network for a command handling service.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BooleanDenotes that aSimpleMemberis a representation of a Local Member, thus a representation of the instance itself.static final BooleanDenotes that aSimpleMemberis a representation of a Remote Member. -
Constructor Summary
ConstructorsConstructorDescriptionSimpleMember(String name, E endpoint, boolean local, Consumer<SimpleMember<E>> suspectHandler) Create the service member -
Method Summary
Modifier and TypeMethodDescriptionendpoint()Returns this Member's endpoint.boolean<T> Optional<T> getConnectionEndpoint(Class<T> protocol) Get the endpoint of this Member given aprotocol.inthashCode()booleanlocal()name()Returns the name of this Member.voidsuspect()Mark this member as suspect, i.e. suspected of being (temporarily) unavailable.toString()
-
Field Details
-
LOCAL_MEMBER
Denotes that aSimpleMemberis a representation of a Local Member, thus a representation of the instance itself. -
REMOTE_MEMBER
Denotes that aSimpleMemberis a representation of a Remote Member.
-
-
Constructor Details
-
SimpleMember
public SimpleMember(String name, E endpoint, boolean local, Consumer<SimpleMember<E>> suspectHandler) Create the service member- Parameters:
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 suspect
-
-
Method Details
-
name
Description copied from interface:MemberReturns the name of this Member. -
getConnectionEndpoint
Description copied from interface:MemberGet the endpoint of this Member given aprotocol. Returns an empty optional if the protocol is not a supported endpoint of this member.- Specified by:
getConnectionEndpointin interfaceMember- Type Parameters:
T- the protocol type- Parameters:
protocol- the expected- Returns:
- the endpoint if this member supports the protocol. An empty optional otherwise.
-
suspect
public void suspect()Description copied from interface:MemberMark this member as suspect, i.e. suspected of being (temporarily) unavailable. -
endpoint
Returns this Member's endpoint.- Returns:
- the endpoint of this member
-
local
public boolean local() -
equals
-
hashCode
public int hashCode() -
toString
-