All Packages Class Hierarchy This Package Previous Next Index
Class JavaGroups.JChannel
java.lang.Object
|
+----JavaGroups.Channel
|
+----JavaGroups.JChannel
- public class JChannel
- extends Channel
JChannel is a pure Java implementation of Channel.
-
JChannel()
-
-
JChannel(Object)
-
-
BlockOk()
- Called to acknowledge a Block (callback in
MembershipListener
or
BlockEvent
received from call to Receive
).
-
Close()
- Destroys the channel.
-
Connect(Object)
-
Connects the channel to a group.
-
Disconnect()
- Disconnects the channel from the current group (if connected), leaving the group.
-
Down(Event)
-
-
finalize()
-
-
GetAllStates(long)
- Retrieves the current group state.
-
GetGroupAddress()
- Returns the group address of the group of which the channel is a member.
-
GetLocalAddress()
-
Returns the channel's own address.
-
GetOpt(int)
-
Gets an option.
-
GetState(long)
- Retrieves the current group state.
-
GetView()
- Gets the current view.
-
Peek(long)
- Just peeks at the next message, view or block.
-
Receive(long)
- Receives a message, a view change or a block event.
-
ReturnState(Serializable)
- Called by the application is response to receiving a
GetState
object when
calling Receive
.
-
Send(Message)
- Sends a message to a destination.
-
SetOpt(int, Object)
-
Sets an option.
-
Up(Event)
- Called by the ProtocolStack when a message is received.
JChannel
public JChannel() throws ChannelException
JChannel
public JChannel(Object properties) throws ChannelException
Connect
public synchronized void Connect(Object group_address) throws ChannelClosed
- Connects the channel to a group.
- Parameters:
- group_address - A
String
denoting the group name.
- Overrides:
- Connect in class Channel
Disconnect
public synchronized void Disconnect()
- Disconnects the channel from the current group (if connected), leaving the group.
- Overrides:
- Disconnect in class Channel
Close
public synchronized void Close()
- Destroys the channel. After this method has been called, the channel us unusable.
- Overrides:
- Close in class Channel
finalize
public synchronized void finalize()
- Overrides:
- finalize in class Object
Send
public void Send(Message msg) throws ChannelNotConnected, ChannelClosed
- Sends a message to a destination.
- Overrides:
- Send in class Channel
Receive
public Object Receive(long timeout) throws ChannelNotConnected, ChannelClosed, Timeout
- Receives a message, a view change or a block event.
- Overrides:
- Receive in class Channel
Peek
public Object Peek(long timeout) throws ChannelNotConnected, ChannelClosed, Timeout
- Just peeks at the next message, view or block. Does not install new view if
view is received
- Overrides:
- Peek in class Channel
GetView
public View GetView()
- Gets the current view.
- Overrides:
- GetView in class Channel
GetLocalAddress
public Object GetLocalAddress()
- Returns the channel's own address.
- Overrides:
- GetLocalAddress in class Channel
GetGroupAddress
public Object GetGroupAddress()
- Returns the group address of the group of which the channel is a member.
- Overrides:
- GetGroupAddress in class Channel
SetOpt
public void SetOpt(int option,
Object value)
- Sets an option.
- Overrides:
- SetOpt in class Channel
GetOpt
public Object GetOpt(int option)
- Gets an option.
- Overrides:
- GetOpt in class Channel
BlockOk
public void BlockOk()
- Called to acknowledge a Block (callback in
MembershipListener
or
BlockEvent
received from call to Receive
).
- Overrides:
- BlockOk in class Channel
GetState
public boolean GetState(long timeout)
- Retrieves the current group state. Sends GET_STATE event down to STATE_TRANSFER layer.
Blocks until STATE_TRANSFER sends up a GET_STATE_OK event or until
timeout
milliseconds have elapsed. The argument of GET_STATE_OK should be a single object.
- Overrides:
- GetState in class Channel
GetAllStates
public boolean GetAllStates(long timeout)
- Retrieves the current group state. Sends GET_STATE event down to STATE_TRANSFER layer.
Blocks until STATE_TRANSFER sends up a GET_STATE_OK event or until
timeout
milliseconds have elapsed. The argument of GET_STATE_OK should be a vector of objects.
- Overrides:
- GetAllStates in class Channel
ReturnState
public void ReturnState(Serializable state)
- Called by the application is response to receiving a
GetState
object when
calling Receive
.
- Overrides:
- ReturnState in class Channel
Up
public void Up(Event evt)
- Called by the ProtocolStack when a message is received. It will be added to the message
queue from which subsequent
Receive
s will dequeue it.
Down
public void Down(Event evt)
All Packages Class Hierarchy This Package Previous Next Index