|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--rtpi.services.latejoin.LateJoin
The class LateJoin is the main API interface for using the generic late join service.
The main idea of this generic late join service is to use a separate RTP/I session for requesting and transmitting late join information. This session is called the late join RTP/I session. The late join RTP/I session must be provided by the application and should operate on a network address that is distinct from the base RTP/I session which is used for the regular transmission of media ADUs (e.g. events and states). The application is responsible for creating and terminating the late join RTP/I session as well as setting QoS parameters. The late join service will join and leave the session as appropriate.
The late join service needs to see the messages that arrive from the base RTP/I session. Therefore it will register as recipient to the base RTP/I session. The application in turn is registered as recipient of the late join service. The application must hand outgoing ADUs directly to the base RTP/I session. Incoming ADUs and information (such as loss notifications and RTCP/I information) is forwarded by the late join service to the application that registered as recipient to the late join service.
This late join service basically works as follows: whenever a new subcomponent is discovered by means of an RTCP/I subrep packet the application will be queried what to do. The application then sets a certain late join policy for that subcomponent. According to this policy the late join service will try to query the state of the subcomponent at an appropriate time in a scalable way. For example if the late join policy is chosen to be EVENT, then the late join service will monitor incoming ADUs of the base RTP/I session. As soon as an event for the subcomponent is discovered the late join service will try to query the state of the subcomponent using a random timer based query and response suppression sceme similar to that of SRM.
The late join service leaves the late join RTP/I session when all subcomponents have been dealt with according to the application defined policies and when it has not helped with a late join of another participant for a certain period of time. The late join service rejoins the late join RTP/I session when it is required to help another late comer with its late join. In order to be able to do so a late comer will query the state of a subcomponent for a number of times using the late join RTP/I session. If it has not received any reply it is likely that no participant that is member of the late join RTP/I session holds the state of the subcomponent. Therefore the late join service will use a specific Transport session to request that someone should join the late join RTP/I session who is able to reply to the state query. Every late join service that holds the state of the requested subcomponent and that has received this request performs a drawing of a random number. If the result is below a certain threshold it will join the late join RTP/I session and transmit the requested state. In this way a join implosion is prevented.
The late join service is highly customizable to support the different needs of distributed interactive media. Most importantly an application may choose to use the algorithm described above for determining if it should join the RTP/I late join session when a late comer needs the state of a certain sub-component. As an alternative the application may decide for which sub-components it is responsible. For example if a floor control mechanism is used, the floor holder could always be responsible for transmitting the state of a sub-component. To support this the late join service allows the application to decide for which sub-components it is responsible. When a late join service receives a message that the state of this subcomponent is required to perform a late join, then it will automatically join the late join RTP/I session and transmit the state of the sub-component.
Furthermore the application may opt to set a default late join policy for all sub-components. In this case the application is never asked to specify a late join policy. Instead the late join service automatically uses the default policy.
Please note that it is not the task of the late join service to guarantee consistency. It is expected that the application has some way to monitor and ensure consistency. The late join serves merely provides an initial state for the subcomponents in a scalable and policy driven way.
This late join service works in its own thread. The communication with other threads (such as the application) is done via message passing, so as to avoid dead locks and race conditions. Therefore the methods of the late join service do not have return values. Also, the application should not block any method calls from the late join service. It should either use message passing or some other way to prevent dead locks and race conditions.
For publications about RTP/I and related issues, please refer to: http://www.informatik.uni-mannheim.de/informatik/pi4/projects/RTPI/index.html
Field Summary | |
static int |
APPLICATION
This join policy indicates exclusive server responsibiltiy for a particular subcomponent implicating both replies without reply-implosion-avoidance and instant joining of the late join multicast group. |
static int |
AT_ONCE
This policy instructs the late join service to get the state of the subcomponent as fast as possible. |
static int |
AUTOMATIC
This join policy selects servers automatically by computed probabilities. |
static int |
EVENT
With this policy the late join service waits for the first event or delta state it sees for the subcomponent before it tries to recover the state of the subcomponent. |
static int |
NOT_INTERESTED
This policy is used by the application when it does not need the state of the subcomponent. |
Fields inherited from class java.lang.Thread |
MAX_PRIORITY,
MIN_PRIORITY,
NORM_PRIORITY |
Constructor Summary | |
LateJoin(LateJoinRecipient ljRecipient,
Rtpi r,
Rtpi ljR,
RtpiSourceInfo ljParticipant,
int payloadType,
Transport genericServices,
int joinPolicy,
int minMembershipTime,
int maxMembershipTime,
long maxStateTransmissionTime)
This creates a new late join service instance. |
|
LateJoin(LateJoinRecipient ljRecipient,
Rtpi r,
Rtpi ljR,
RtpiSourceInfo ljParticipant,
int payloadType,
Transport genericServices,
int joinPolicy,
int minMembershipTime,
int maxMembershipTime,
long maxStateTransmissionTime,
int defaultPolicy)
This creates a new late join service instance. |
|
LateJoin(LateJoinRecipient ljRecipient,
Rtpi r,
Rtpi ljR,
RtpiSourceInfo ljParticipant,
int payloadType,
Transport genericServices,
int joinPolicy,
int minMembershipTime,
int maxMembershipTime,
long maxStateTransmissionTime,
int defaultPolicy,
int initRequ,
int joinRequ,
float joinProb)
This creates a LateJoin instance in the most flexible way that is possible. |
Method Summary | |
void |
acknowledgeTransmitState(long id)
This method is called by the application when it has been notified that the late join service needs the state of a certain subcomponent and the application is able and willing to extract the state of the subcomponent. |
void |
activateSubcomponent(Rtpi r,
long id)
This is called by an RTP/I instance when a subcomponent has become active for a remote participant. |
void |
addSubcomponent(long id)
This method is called by the application to signal that it has created a new subcomponent. |
void |
addSubcomponent(Rtpi r,
long id,
boolean active,
byte[] name)
This is called by an RTP/I instance when a new subcomponent has been discovered via an RTCP/I SUBREP packet. |
void |
changeSourceInfo(Rtpi r,
RtpiSourceInfo participant)
This is called by an RTP/I instance when the information about a remote source has changed via an RTCP/I SDES packet. |
void |
claimSubcomponentResponsibility(long id)
This is called by the application to indicate that it is responsible for the management of a certain subcomponents state. |
void |
connectionClosed(Rtpi r)
This is called when an RTP/I session dies unexpectantly. |
void |
deactivateSubcomponent(Rtpi r,
long id)
This is called by an RTP/I instance when a subcomponent has been deactivated for the session. |
void |
quit()
This terminates the late join service. |
void |
receiveDeltaState(Rtpi r,
RtpiDeltaState state)
This is called by the RTP/I instances when a delta state has been received. |
void |
receiveEvent(Rtpi r,
RtpiEvent event)
This is called by the RTP/I instances when an event has been received. |
void |
receiveState(Rtpi r,
RtpiState state)
This is called by the RTP/I instances when a state has been received. |
void |
receiveStateQuery(Rtpi r,
RtpiStateQuery query)
This is called by the RTP/I instances when a state query has been received. |
void |
releaseSubcomponentResponsibility(long id)
This is called by the application to indicate that it is no longer responsible for the management of a certain subcomponents state. |
void |
removeSource(Rtpi r,
RtpiSourceInfo participant)
This is called by an RTP/I instance when a remote source has timed out. |
void |
removeSubcomponent(Rtpi r,
long id)
This is called by an RTP/I instance when a subcomponent has timed out. |
void |
rtpiAduLost(Rtpi r,
int participantID,
long subID,
int type,
int sequenceNumber,
int timestamp)
This is called by an RTP/I instance when a packet got lost. |
void |
rtpiCouldNotRecover(Rtpi r,
int participantID,
long subID,
int type,
int sequenceNumber,
int timestamp)
This is called by an RTP/I instance when it could not recover a lost packet, even though it was instructed to do so. |
void |
run()
|
void |
setPolicy(long id,
int policy)
This is used by the application to set the late join policy for a given subcomponent. |
void |
transmitState(RtpiState state)
This is called by the application when it has been requested by the late join servie to extract the state of a certian subcomponent in order to help a late comer. |
Methods inherited from class java.lang.Thread |
activeCount,
checkAccess,
countStackFrames,
currentThread,
destroy,
dumpStack,
enumerate,
getContextClassLoader,
getName,
getPriority,
getThreadGroup,
interrupt,
interrupted,
isAlive,
isDaemon,
isInterrupted,
join,
join,
join,
resume,
setContextClassLoader,
setDaemon,
setName,
setPriority,
sleep,
sleep,
start,
stop,
stop,
suspend,
toString,
yield |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
public static final int NOT_INTERESTED
public static final int AT_ONCE
public static final int EVENT
public static final int APPLICATION
public static final int AUTOMATIC
Constructor Detail |
public LateJoin(LateJoinRecipient ljRecipient, Rtpi r, Rtpi ljR, RtpiSourceInfo ljParticipant, int payloadType, Transport genericServices, int joinPolicy, int minMembershipTime, int maxMembershipTime, long maxStateTransmissionTime, int defaultPolicy, int initRequ, int joinRequ, float joinProb)
ljRecipient
- The recipient of information from this instance. Commonly this is the application.r
- The base RTP/I session. The late join service will not transmit anything over this session. However
it needs to monitor incoming RTP/I ADUs and the RTCP/I information.ljR
- The late join RTP/I session. The late join service uses this session to transmit state queries and
states. This RTP/I session is created and destroyed by the application. The application is also responsible
for the QoS settings of the underlying reliability service. The late join service joins and leaves this session
as it is appropriate.ljParticipant
- This information is used for the RTCP/I SDES reporting in the late join session. It should be minimal.
That is only the CNAME should be set.payloadType
- This is the payload type use by the application.genericServices
- This is the generic services channel. In the current version this is a Transport session which is
exclusively used by the late join service to signal that someone should join the late join RTP/I session
and provide the state of a certain subcomponent. The application providing this Transport object is responsible
for creating and cleaning up this Transport instance.joinPolicy
- This may be AUTOMATIC if the lateJoin group should be joined automatically using the random number
mechanisms described above. Or it can be APPLICATION if the application decides for which subcomponents
this late join should be responsible. The latter should only be chosen if the responsibility for a subcomponent
rests with exactly one participant in the session.minMembershipTime
- This is the minimal time that a late join service will stay in the late join RTP/I session once it joins.
At the startup of the late join service it will automatically join the late join RTP/I session. Once it has
left the late join RTP/I session it may rejoin in order to help a late comer.maxMembershipTime
- This is the maximal time tat a late join service will stay in the late join RTP/I session once it joins.
The late join service will choose a value between the minMembershipTime and the maxMembership time for
leaving the late join session if it has finished its late join for all discovered subcomponents and if it
has not transmitted any subcomponent state to help another latecomer.maxStateTransmissionTime
- This is the maximum time required by the application to extract and succesfully transmit the state
of a subcomponent. Obviously this has to bee an estimate, since the successfull transmission may require
retransmissions of lost packets. If this value is too low than the late join service will repeatedly
ask for the state of a subcomponent while a member in the late join RTP/I session is already extracting
and transmitting the state. If it is set too large, then it takes longer to discover that a state transmission
has got lost, or the sender of the state has crashed before it could finish transmitting the state.
Therefore this value should be set to a loarge amount if reliable communication is used for the transmission
of states over the late join RTP/I session.defaultPolicy
- One of NO_POLICY_YET, NOT_INTERESTED, AT_ONCE or EVENT. NO_POLICY_YET signals that there is
no default policy. The meaning of the other policies is explained in the description of the constants. If the defaultPolicy
is different from NO_POLICY_YET, then this policy is automatically used for all subcomponents wihtout asking the application.initRequ
- This specifies the number of state query requests that should be sent to the late join RTP/I session before asking someone to join
the late join RTP/I session via the generic services channel (the separate transport session). It should always be a value larger
than 3, even when reliable transmission is used. A higher value should be used when the state queries and/or the states are
transmitted unreliably. The minimum of 3 is required since there may be brief periods of times when no application is able to
answer a state query (for example when the responsibility for relying to state quieries is assigned to the floor holder of a
subcomponent and that floor is currently being transferred to a new floor holder. The default of this value is 5.joinRequ
- This specifies the number of join requests the late join service will transmit to the generic services channel before ginving up.
This value defaults to 10. It should only be changed if you know how exactly the mechanism for joining the late join RTP/I session
works (join implosion avoidance!).joinProb
- This specifies the likeliness that a round of the join implosion avoidance algorithm will be successfull. The default is 0.7.
Change this value only if you know how the mechanism for joining the late join RTP/I session works (join implosion avoidance).public LateJoin(LateJoinRecipient ljRecipient, Rtpi r, Rtpi ljR, RtpiSourceInfo ljParticipant, int payloadType, Transport genericServices, int joinPolicy, int minMembershipTime, int maxMembershipTime, long maxStateTransmissionTime, int defaultPolicy)
ljRecipient
- The recipient of information from this instance. Commonly this is the application.r
- The base RTP/I session. The late join service will not transmit anything over this session. However
it needs to monitor incoming RTP/I ADUs and the RTCP/I information.ljR
- The late join RTP/I session. The late join service uses this session to transmit state queries and
states. This RTP/I session is created and destroyed by the application. The application is also responsible
for the QoS settings of the underlying reliability service. The late join service joins and leaves this session
as it is appropriate.ljParticipant
- This information is used for the RTCP/I SDES reporting in the late join session. It should be minimal.
That is only the CNAME should be set.payloadType
- This is the payload type use by the application.genericServices
- This is the generic services channel. In the current version this is a Transport session which is
exclusively used by the late join service to signal that someone should join the late join RTP/I session
and provide the state of a certain subcomponent. The application providing this Transport object is responsible
for creating and cleaning up this Transport instance.joinPolicy
- This may be AUTOMATIC if the lateJoin group should be joined automatically using the random number
mechanisms described above. Or it can be APPLICATION if the application decides for which subcomponents
this late join should be responsible. The latter should only be chosen if the responsibility for a subcomponent
rests with exactly one participant in the session.minMembershipTime
- This is the minimal time that a late join service will stay in the late join RTP/I session once it joins.
At the startup of the late join service it will automatically join the late join RTP/I session. Once it has
left the late join RTP/I session it may rejoin in order to help a late comer.maxMembershipTime
- This is the maximal time tat a late join service will stay in the late join RTP/I session once it joins.
The late join service will choose a value between the minMembershipTime and the maxMembership time for
leaving the late join session if it has finished its late join for all discovered subcomponents and if it
has not transmitted any subcomponent state to help another latecomer.maxStateTransmissionTime
- This is the maximum time required by the application to extract and succesfully transmit the state
of a subcomponent. Obviously this has to bee an estimate, since the successfull transmission may require
retransmissions of lost packets. If this value is too low than the late join service will repeatedly
ask for the state of a subcomponent while a member in the late join RTP/I session is already extracting
and transmitting the state. If it is set too large, then it takes longer to discover that a state transmission
has got lost, or the sender of the state has crashed before it could finish transmitting the state.
Therefore this value should be set to a loarge amount if reliable communication is used for the transmission
of states over the late join RTP/I session.defaultPolicy
- One of NO_POLICY_YET, NOT_INTERESTED, AT_ONCE or EVENT. NO_POLICY_YET signals that there is
no default policy. The meaning of the other policies is explained in the description of the constants. If the defaultPolicy
is different from NO_POLICY_YET, then this policy is automatically used for all subcomponents wihtout asking the application.public LateJoin(LateJoinRecipient ljRecipient, Rtpi r, Rtpi ljR, RtpiSourceInfo ljParticipant, int payloadType, Transport genericServices, int joinPolicy, int minMembershipTime, int maxMembershipTime, long maxStateTransmissionTime)
ljRecipient
- The recipient of information from this instance. Commonly this is the application.r
- The base RTP/I session. The late join service will not transmit anything over this session. However
it needs to monitor incoming RTP/I ADUs and the RTCP/I information.ljR
- The late join RTP/I session. The late join service uses this session to transmit state queries and
states. This RTP/I session is created and destroyed by the application. The application is also responsible
for the QoS settings of the underlying reliability service. The late join service joins and leaves this session
as it is appropriate.ljParticipant
- This information is used for the RTCP/I SDES reporting in the late join session. It should be minimal.
That is only the CNAME should be set.payloadType
- This is the payload type use by the application.genericServices
- This is the generic services channel. In the current version this is a Transport session which is
exclusively used by the late join service to signal that someone should join the late join RTP/I session
and provide the state of a certain subcomponent. The application providing this Transport object is responsible
for creating and cleaning up this Transport instance.joinPolicy
- This may be AUTOMATIC if the lateJoin group should be joined automatically using the random number
mechanisms described above. Or it can be APPLICATION if the application decides for which subcomponents
this late join should be responsible. The latter should only be chosen if the responsibility for a subcomponent
rests with exactly one participant in the session.minMembershipTime
- This is the minimal time that a late join service will stay in the late join RTP/I session once it joins.
At the startup of the late join service it will automatically join the late join RTP/I session. Once it has
left the late join RTP/I session it may rejoin in order to help a late comer.maxMembershipTime
- This is the maximal time tat a late join service will stay in the late join RTP/I session once it joins.
The late join service will choose a value between the minMembershipTime and the maxMembership time for
leaving the late join session if it has finished its late join for all discovered subcomponents and if it
has not transmitted any subcomponent state to help another latecomer.maxStateTransmissionTime
- This is the maximum time required by the application to extract and succesfully transmit the state
of a subcomponent. Obviously this has to bee an estimate, since the successfull transmission may require
retransmissions of lost packets. If this value is too low than the late join service will repeatedly
ask for the state of a subcomponent while a member in the late join RTP/I session is already extracting
and transmitting the state. If it is set too large, then it takes longer to discover that a state transmission
has got lost, or the sender of the state has crashed before it could finish transmitting the state.
Therefore this value should be set to a loarge amount if reliable communication is used for the transmission
of states over the late join RTP/I session.Method Detail |
public void run()
public void quit()
public void setPolicy(long id, int policy)
id
- The subcomponent ID of the subcomponent for which the policy should be set.policy
- The new late join policy (see class Policy for possible values).public void addSubcomponent(long id)
id
- The subcomponent ID of the subcomponent.public void acknowledgeTransmitState(long id)
id
- The subcomponent ID of the subcomponent.public void transmitState(RtpiState state)
state
- The state of the subcomponent.public void claimSubcomponentResponsibility(long id)
id
- The subcomponentID of the subcomponent.public void releaseSubcomponentResponsibility(long id)
id
- The subcomponentID of the subcomponent.public void receiveEvent(Rtpi r, RtpiEvent event)
r
- The RTP/I instance that received the event.event
- The event.public void receiveState(Rtpi r, RtpiState state)
r
- The RTP/I instance that received the state.state
- The state.public void receiveDeltaState(Rtpi r, RtpiDeltaState state)
r
- The RTP/I instance that received the delta state.state
- The delta state.public void receiveStateQuery(Rtpi r, RtpiStateQuery query)
r
- The RTP/I instance that received the state query.query
- The state query.public void addSubcomponent(Rtpi r, long id, boolean active, byte[] name)
r
- The RTP/I instance that discovered the new subcomponent.id
- The subcomponent ID of the discovered subcomponent.active
- A flag indicating whether the discovered subcomponent was reported as active.name
- The application level name (if any) of the subcomponent.public void removeSubcomponent(Rtpi r, long id)
r
- The RTP/I instance for which the subcomponent did time out.id
- The subcomponent ID of the timed out subcomponent.public void activateSubcomponent(Rtpi r, long id)
r
- The RTP/I instance for which the subcomponent became active.id
- The subcomponent ID of the activated subcomponent.public void deactivateSubcomponent(Rtpi r, long id)
r
- The RTP/I instance for which the subcomponent was deactivated.id
- The subcomponent ID of the deactivated subcomponent.public void changeSourceInfo(Rtpi r, RtpiSourceInfo participant)
r
- The RTP/I instance for which the information changed.participant
- The new information about the source.public void removeSource(Rtpi r, RtpiSourceInfo participant)
r
- The RTP/I instance for which the source timed out.participant
- The source that timed out.public void rtpiAduLost(Rtpi r, int participantID, long subID, int type, int sequenceNumber, int timestamp)
r
- The RTP/I session that experienced the loss.participantID
- The ID of the sender of the lost ADU.subID
- The subcomponent ID that this ADU refers to.type
- The type of the ADU (e.g. state, event, etc.).sequenceNumber
- The most recent sequencenumber that got lost.timestamp
- The timestamp of the most recent ADU that got lost.public void rtpiCouldNotRecover(Rtpi r, int participantID, long subID, int type, int sequenceNumber, int timestamp)
r
- The RTP/I session that experienced the loss.participantID
- The ID of the sender of the lost ADU.subID
- The subcomponent ID that this ADU refers to.type
- The type of the ADU (e.g. state, event, etc.).sequenceNumber
- The most recent sequencenumber that got lost.timestamp
- The timestamp of the most recent ADU that got lost.public void connectionClosed(Rtpi r)
r
- The RTP/I session that died.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |