|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjgroup.relacs.gm.MergingLayer
public class MergingLayer
This MergingLayer
class implements the Jgroup state
merging service. It intercepts and delays view change events so
that the reconciliation protocol can complete before passing the
view change on to application member.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface jgroup.core.Layer |
---|
Layer.FinalizeLayer |
Nested classes/interfaces inherited from interface jgroup.core.Layer |
---|
Layer.FinalizeLayer |
Nested classes/interfaces inherited from interface jgroup.core.MembershipListener |
---|
MembershipListener.AllowDuplicateViews |
Method Summary | |
---|---|
void |
addListener(java.lang.Object listener)
Add a listener object for this layer to provide upcalls to, in response to membership and merge events. |
void |
complete(java.lang.Object server)
Post initialization of the MembershipLayer ; invoked once
all group manager layers have been constructed. |
java.lang.Object |
deliverObject(java.lang.Object msg,
MemberId sender,
int seqNo)
Upcall that is invoked by Jgroup to deliver a message msg ,
corresponding to a single serialized object. |
java.lang.Object |
deliverStream(java.io.InputStream stream,
MemberId sender,
int seqNo)
Upcall that is invoked by Jgroup to deliver a message msg ,
corresponding to an input stream from which the message may be read. |
int |
getGid()
Returns the group identifier. |
static MergingLayer |
getLayer(MembershipService membService,
MulticastService mcastService)
|
int |
getMemberIndex()
Position index of this member in the array containing the local members of the current view. |
MemberTable |
getMemberTable()
Returns a MemberTable helper object that will be
notified of changes in the membership. |
MemberId |
getMyIdentifier()
Returns the member identifier of the local member. |
java.lang.String |
getProtocolName()
Returns a string naming the protocol implemented by this multicast listener. |
int |
getViewIndex()
Position index of this member in the array containing the members of the current view. |
void |
hasLeft()
Upcall that is invoked by Jgroup to acknowledge the fact that this object has left the group. |
boolean |
isJoining()
Returns true if the GroupManager is in the process of
joining some group. |
boolean |
isLeader()
Returns true if the local member is the group leader. |
boolean |
isMember()
Returns true if the GroupManager is member of some
group. |
boolean |
isMemberOrJoining()
Returns true if the GroupManager is member of some group
or is in the process of joining some group. |
void |
join()
Requests to join the default group associated with the Jgroup daemon. |
void |
join(int gid)
Requests to join a group identified by groupId . |
void |
leave()
Request to leave a group. |
int |
members()
Return the number of members of this group. |
void |
prepareChange()
Upcall that is invoked by the group membership service to notify that the current view is not valid any more, and the group membership service is trying to reach an agreement on a new view. |
void |
viewChange(View view)
Upcall invoked on members implementing the MembershipListener
interface, when a view change occurs. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static MergingLayer getLayer(MembershipService membService, MulticastService mcastService) throws JgroupException
JgroupException
public void addListener(java.lang.Object listener)
addListener
in interface Layer
listener
- An Object
representation of the listener interface.
This will typically be cast to the appropriate listener interface
type after checking the type with the instanceof operator.public void complete(java.lang.Object server) throws JgroupException
MembershipLayer
; invoked once
all group manager layers have been constructed. This method is defined
in the FinalizeLayer
inherited through the
MembershipSerivce
.
complete
in interface Layer.FinalizeLayer
server
- The server using a layer implementing the FinalizeLayer
interface.
JgroupException
- Thrown if the layer could not be completed.public void join(int gid) throws JgroupException
MembershipService
groupId
.
join
in interface MembershipService
gid
- Non-negative integer identifying the group.
JgroupException
- Raised if the membership service receives a request to join a
group to which it is already a member.public void join() throws JgroupException
MembershipService
Each Jgroup daemon has a default group. If a Jgroup daemon does not need to be shared by multiple groups, the application servers may simply join the default group without having to specify group identifiers.
join
in interface MembershipService
JgroupException
- Raised if the membership service receives a request to join a
group to which it is already a member.public void leave() throws JgroupException
MembershipService
hasLeft
method is invoked. After this invocation,
the member will not receive any further event notification related
to the group.
leave
in interface MembershipService
JgroupException
- Rasied if the server is not member of any group, or is already
leaving its current group.public boolean isMember()
MembershipService
GroupManager
is member of some
group. Otherwise, false is returned.
isMember
in interface MembershipService
public boolean isJoining()
MembershipService
GroupManager
is in the process of
joining some group. Otherwise, false is returned.
isJoining
in interface MembershipService
public boolean isMemberOrJoining()
MembershipService
GroupManager
is member of some group
or is in the process of joining some group. Otherwise, false is returned.
isMemberOrJoining
in interface MembershipService
public boolean isLeader()
MembershipService
isLeader
in interface MembershipService
public MemberId getMyIdentifier()
MembershipService
getMyIdentifier
in interface MembershipService
public int getGid()
MembershipService
getGid
in interface MembershipService
public MemberTable getMemberTable()
MembershipService
MemberTable
helper object that will be
notified of changes in the membership. This is used to provide
application developers with additional information about members
of their current view.
getMemberTable
in interface MembershipService
public int members()
MembershipService
members
in interface MembershipService
public int getViewIndex()
MembershipService
getViewIndex
in interface MembershipService
public int getMemberIndex()
MembershipService
getMemberIndex
in interface MembershipService
@MembershipListener.AllowDuplicateViews public void viewChange(View view)
MembershipListener
MembershipListener
interface, when a view change occurs.
viewChange
in interface MembershipListener
view
- The new view that has been installed.MembershipService
public void hasLeft()
MembershipListener
leave
method has been invoked on the group membership
service.
hasLeft
in interface MembershipListener
MembershipService
public void prepareChange()
MembershipListener
prepareChange
in interface MembershipListener
MembershipService
public java.lang.String getProtocolName()
MulticastListener
getProtocolName
in interface MulticastListener
public java.lang.Object deliverStream(java.io.InputStream stream, MemberId sender, int seqNo)
MulticastListener
msg
,
corresponding to an input stream from which the message may be read.
deliverStream
in interface MulticastListener
stream
- the input stream from which the message can be read.sender
- the sender of the multicast messageseqNo
- the sequence number of this multicast message
public java.lang.Object deliverObject(java.lang.Object msg, MemberId sender, int seqNo)
MulticastListener
msg
,
corresponding to a single serialized object.
deliverObject
in interface MulticastListener
msg
- the object that was multicasted.sender
- the sender of the multicast messageseqNo
- the sequence number of this multicast message
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |