THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
PlantUML |
---|
@startuml "geode-core" --> geode-membership "geode-core" --> geode-serialization "geode-core" --> geode-tcp-server "geode-membership" --> geode-serialization "geode-membership" --> geode-tcp-server "geode-tcp-server" --> geode-serialization @enduml |
...
- Move the dependencies to a separate subproject - serialization is and tcp-server (Locator infrastructure) are moving to separate subproject subprojects so that membership can depend directly on thatthem
- Inject dependencies at runtime - dependencies such as gemfire stats can be injected into the membership system by providing interfaces such as MembershipStatistics (see below) that geode core must provide when creating the membership system.
...
PlantUML |
---|
@startuml interface MembershipBuilder { + static newMembershipBuilder() ---- + set...() } interface Membership { Core class of a running membership system. + getMembershipView(): MembershipView } interface Messenger { + send(Message) } interface MembershipView { + getMembers(): List<MemberIdentifier> } interface MemberIdentifier { A single member of the system } interface MembershipListener { } interface MessageHandler { } interface Authenticator { } interface MembershipStatistics { } interface Config { } interface MembershipView { } MembershipBuilder --> Membership : creates MembershipBuilder *-- Authenticator MembershipBuilder *-- MembershipStatistics MembershipBuilder *-- MessageHandler MembershipBuilder *-- Config MembershipBuilder *-- MembershipListener Membership *-- Messenger Membership *-- MembershipView MembershipView *-- MemberIdentifier @enduml |
...
Code Block | ||
---|---|---|
| ||
/** * Creates the membership system, given the provided configuration */ interface MembershipBuilder { static MembershipBuilder newMembershipBuilder() MembershipBuilder setConfig(Config) MembershipBuilder setAuthenticator(Authenticator) MembershipBuilder setMembershipListener(MembershipListener) MembershipBuilder setMessageHandler(MessageHandler) MembershipBuilder setMembershipStatistics(MembershipStatistics) MembershipBuilder setMemberIDFactory(MemberIdentifierFactory) create() : Membership } /** * Core class of a running membership system. */ interface Membership { getMembershipView(): MembershipView getMessenger(): Messenger getLocalMember(): MemberIdentifier contactedBy(MemberIdentifier) isShunned(MemberIdentifier) close() isClosed() } /** * API for sending messages to other members, using memberships messaging system * Membership currently allows geode-core to send messages over it's UDP messaging system. * This interface provides that functionality. */ interface Messenger { send(Message) /** Get an object the represents what messages have been sent to to the given * MemberIdentifier. This is used in waitForMessengerState to wait for these messages * to arrive on the remote side */ getMessengerState(MemberIdentifer): MessengerState waitForMessengerState(MessengerState) } /** * A Message that will be sent to the returned recipients. */ interface Message { Set<MemberIdentifier>List<MemberIdentifier> getRecipients() } /** * An object which represents the state of the sending side of a communication * channel at a point in time. This object can be passed to the waitForMessengerState * method on the receiving side to ensure all messages have been received on * the receiving side */ interface MessengerState extends DataSerializableFixedID { }/** * Interface used to create a MemberIdentifier from a set of properties * This API is provided solely to allow geode-core to add additional * properties to the MemberIdentifier that are not relevant to membership * For example DurableClientAttributes. Membership will provide * A default MemberIdentifier which just has the membership relevant attributes */ interface MemberIdentifierFactory { MemberIdentifier create(memberData) } /** * A single member of the system. In practice, this will * be implemented by InternalDistributedMember */ interface MemberIdentifier { } /** * Provides the current members of the system */ interface MembershipView { List<MemberIdentifier> getMembers() } /** * Receives notifications about changes to membership */ interface MembershipListener { memberJoined(MemberIdentifier) memberDeparted(MemberIdentifier) memberCrashed(MemberIdentifier) forceDisconnected(String reason) } /** * Receives all messages sent from other members */ interface MessageHandler { processMessage(Message) } /** * Interface used by membership to authenticate other members */ interface Authenticator { /** * Authenticate peer member * * @return null if authentication succeed (including no authenticator case), otherwise, return * failure message */ String authenticate(MemberIdentifier member, Properties credentials); /** * Get credential object for the given GemFire distributed member. */ Properties getCredentials(MemberIdentifier member); } /** * Interface to notify statistics systems about membership changes */ interface MembershipStatistics { memberJoined() memberDeparted() ... } /** * Primitive configuration options for membership * - timeouts, etc. */ interface Config { getJoinTimeout() ... } |
...