home OpenMash Documentations
Class Index Method Index Class Hierarchy

TCL CLASS

AnnounceListenManager/AS

Base class for AnnounceListenManager in Active Service Framework.

SUPERCLASSES

AnnounceListenManager

SUBCLASSES

AnnounceListenManager/AS/Client, AnnounceListenManager/AS/Service, AnnounceListenManager/AS/HM, AnnounceListenManager/AS/Platform, AnnounceListenManager/AS/SSG, AnnounceListenManager/AS/ASMon, AnnounceListenManager/AS/MeGaMon

MEMBERS

agentbytype_, avgdelta_, aliveid_, lastann_, atype_

agentbytype_

An array of list of agents, indexed by type (srv, client, hm).

avgdelta_

An array indexed by agent spec, that contains average time between announcement from the corresponding agent.

aliveid_

ID to the "after" callback check_alive{}.

lastann_

An array indexed by agent spec, that contains time the last announcement was made to the corresponding agent. Time are stored as absolute time (gettimeofday) and as ascii time ( clock format).

atype_

Type of this agent

METHODS

init, version, send_announcement, announce_death, agent_instance, agent_data, ssg_port, service_location, destroy, recv_announcement, check_alive, delete_agent, agenttab

init

AnnounceListenManager/AS instproc init { netspec bw atype }

Initialize various members and timer.

version

AnnounceListenManager/AS proc version { }

Return the version string of the current Active Service Framework.

send_announcement

AnnounceListenManager/AS public send_announcement { }

Construct an announcement, and send it. Since this method is called periodically, we take this chance to check for liveness in other agent by calling "check_alive 0" before exiting.

announce_death

AnnounceListenManager/AS instproc announce_death { }

Construct a BYE announcement and announce it.

agent_instance

AnnounceListenManager/AS public agent_instance { }

Return a string that represent an instance of the current agent.

agent_data

AnnounceListenManager/AS public agent_data { }

Subclass should overwrite this to return agent specific data.

ssg_port

AnnounceListenManager/AS public ssg_port { }

Subclass should overwrite this to return port number to a soft state gateway.

service_location

AnnounceListenManager/AS instproc service_location { }

Subclass should overwrite this to return the service location.

destroy

AnnounceListenManager/AS instproc destroy { }

Cleanup "after" callback.

recv_announcement

AnnounceListenManager/AS instproc recv_announcement { addr port data size }

Called when an announcement is received. The announcement is parsed and special cases are handled (DEATH, BYE, wrong version). The method "recv_msg {}" is then called to process other general messages.

port

The port number where this announcement came from.

addr

The address where this announcement came from.

size

The length of data in bytes.

data

The data contained in this announcement.

check_alive

AnnounceListenManager/AS instproc check_alive { timer }

Go through all agents and delete agents that hasn't been announcing for a while.

timer

Specify if this is a one time call (timer == 0), or we are gonna doing this periodically (timer == 1)

delete_agent

AnnounceListenManager/AS instproc delete_agent { aspec }

Assume that the agent specified by $aspec is dead. Clean up all states corresponding to that agent.

aspec

Specification to the agent to be deleted.

agenttab

AnnounceListenManager/AS instproc agenttab { aspec }

Return the agent matching specification $aspec, or return "" if no such agent can be found.

aspec

Specification to the agent to be retrieve.

INHERITED METHODS

start, stop, announce, recv, timer, get_timer, set_announcement, get_announcement, ttl

FILENAME

tcl/as/al-as.tcl


Generated on Mon Apr 12 04:04:17 PDT 2004