|
JXTA | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.jxta.impl.endpoint.mcast.McastTransport
public class McastTransport
This class implements the IP Multicast Message Transport.
Important Note: This implementation was formerly a portion of the TCP Message Transport and currently uses the TCP Transport's configuration advertisement.
MessageTransport
,
MessagePropagater
,
EndpointService
,
JXTA Protocols Specification : Standard JXTA Transport BindingsField Summary | |
---|---|
static ModuleClassID |
MCAST_TRANSPORT_CLASSID
Well known service class identifier: mcast message transport |
static ModuleSpecID |
MCAST_TRANSPORT_SPECID
Well known service spec identifier: mcast message transport |
Fields inherited from interface net.jxta.platform.Module |
---|
START_AGAIN_PROGRESS, START_AGAIN_STALLED, START_DISABLED, START_OK |
Constructor Summary | |
---|---|
McastTransport()
Construct a new McastTransport instance |
Method Summary | |
---|---|
boolean |
equals(Object target)
|
EndpointService |
getEndpointService()
Returns the endpoint service with which this MessageTransport is registered. |
(package private) TransportBindingMeter |
getMulticastTransportBindingMeter(EndpointAddress destinationAddress)
|
String |
getProtocolName()
Returns a String containing the name of the protocol used by this MessageTransport. |
EndpointAddress |
getPublicAddress()
Returns the EndpointAddress which will be used as the source
address for all messages sent by this message sender. |
int |
hashCode()
|
void |
init(PeerGroup group,
ID assignedID,
Advertisement impl)
Initialize the module, passing it its peer group and advertisement. |
(package private) void |
processMulticast(DatagramPacket packet)
Handle a byte buffer from a multi-cast. |
boolean |
propagate(Message message,
String pName,
String pParams,
int initalTTL)
Propagates a Message via this Message Transport. |
void |
run()
Handles incoming multicasts and enqueues them with the datagram processor. |
int |
startApp(String[] arg)
Complete any remaining initialization of the module. |
void |
stopApp()
Stop a module. |
Object |
transportControl(Object operation,
Object Value)
Pass a transport control object to a message transport. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final ModuleClassID MCAST_TRANSPORT_CLASSID
public static final ModuleSpecID MCAST_TRANSPORT_SPECID
Constructor Detail |
---|
public McastTransport()
Method Detail |
---|
public boolean equals(Object target)
equals
in class Object
public int hashCode()
hashCode
in class Object
public void init(PeerGroup group, ID assignedID, Advertisement impl) throws PeerGroupException
init
in interface Module
group
- The PeerGroup from which this Module can obtain services.
If this module is a Service, this is also the PeerGroup of which this
module is a service.assignedID
- Identity of Module within group.
modules can use it as a the root of their namespace to create
names that are unique within the group but predictable by the
same module on another peer. This is normally the ModuleClassID
which is also the name under which the module is known by other
modules. For a group it is the PeerGroupID itself.
The parameters of a service, in the Peer configuration, are indexed
by the assignedID of that service, and a Service must publish its
run-time parameters in the Peer Advertisement under its assigned ID.impl
- The implementation advertisement for this
Module. It is permissible to pass null if no implementation
advertisement is available. This may happen if the
implementation was selected by explicit class name rather than
by following an implementation advertisement. Modules are not
required to support that style of loading, but if they do, then
their documentation should mention it.
PeerGroupException
- This module failed to initialize.public int startApp(String[] arg)
startApp()
is completed. That is
also the opportunity to supply arbitrary arguments (mostly to
applications).
If this module is a PeerGroup
service, it may be invoked
several times depending on its return value.
startApp
in interface Module
arg
- An array of Strings forming the parameters for this
Module.
Module.START_OK
, Module.START_AGAIN_PROGRESS
,
Module.START_AGAIN_STALLED
, which indicates partial or complete
success, or any other value (negative values are
recommended for future compatibility), which indicates failure.public void stopApp()
init()
completes and should not assume that startApp()
has been
called or completed.
The Module cannot be forced to comply, but in the future
we might be able to deny it access to anything after some timeout.
stopApp
in interface Module
public String getProtocolName()
EndpointAddress
.
getProtocolName
in interface MessageTransport
public EndpointAddress getPublicAddress()
EndpointAddress
which will be used as the source
address for all messages sent by this message sender. This is the
"preferred" address to which replies should be sent. This address is not
necessarily the best or only address by which the peer may be reached.
The public address may also be for a different message transport.
getPublicAddress
in interface MessagePropagater
public EndpointService getEndpointService()
getEndpointService
in interface MessageTransport
public Object transportControl(Object operation, Object Value)
transportControl
in interface MessageTransport
operation
- Object that specifies the type of control operation
to be performedValue
- Object that specifies a value object associated
with the control operation
public void run()
run
in interface Runnable
public boolean propagate(Message message, String pName, String pParams, int initalTTL)
propagate
in interface MessagePropagater
message
- The Message to be propagated.pName
- Contains the name of the destination service, if any.
This will be integrated into the destination address.pParams
- Contains the parameters associated with the service,
if any. This will be integrated into the destination address.initalTTL
- The requested initial TTL for this message. This value
may be reduced by the implementation.
true
if the Message was propagated otherwise
false
.void processMulticast(DatagramPacket packet)
packet
- the message packet.TransportBindingMeter getMulticastTransportBindingMeter(EndpointAddress destinationAddress)
|
JXSE | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |