org.objectweb.jonas.server.discovery
Class DiscMessage

java.lang.Object
  extended byorg.objectweb.jonas.server.discovery.DiscMessage
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
DiscEvent

public class DiscMessage
extends java.lang.Object
implements java.io.Serializable

Version:
1.0
Author:
Takoua Abdellatif
See Also:
Serialized Form

Constructor Summary
DiscMessage(java.lang.String sourceAddress, int sourcePort)
          Creates a new DiscoveryRequest
 
Method Summary
static java.net.DatagramPacket getDatagram(java.io.Serializable o)
          Concerts the current object to a Datagram
 java.lang.String getSourceAddress()
          Returns the destinationAddress value in String type.
 int getSourcePort()
          Returns the sourcePort value.
static byte[] objectToBytes(java.io.Serializable obj)
          Converts the given object to an array of bytes.
 void setSourceAddress(java.lang.String sourceAddress)
          Sets the source address.
 void setSourcePort(int sourcePort)
          Sets the source port.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DiscMessage

public DiscMessage(java.lang.String sourceAddress,
                   int sourcePort)
Creates a new DiscoveryRequest

Parameters:
sourceAddress - source address to use to send discovery responses.
sourcePort - source port to use to send disovery responses.
Method Detail

getSourceAddress

public java.lang.String getSourceAddress()
Returns the destinationAddress value in String type.

Returns:
Returns the destinationAddress.

getSourcePort

public int getSourcePort()
Returns the sourcePort value.

Returns:
Returns the sourcePort.

setSourceAddress

public void setSourceAddress(java.lang.String sourceAddress)
Sets the source address.

Parameters:
sourceAddress -

setSourcePort

public void setSourcePort(int sourcePort)
Sets the source port.

Parameters:
sourcePort -

objectToBytes

public static byte[] objectToBytes(java.io.Serializable obj)
Converts the given object to an array of bytes.

Parameters:
obj - the object to convert
Returns:
an array of bytes

getDatagram

public static java.net.DatagramPacket getDatagram(java.io.Serializable o)
Concerts the current object to a Datagram

Parameters:
o -
Returns:
a datagramPacket

toString

public java.lang.String toString()
Returns:
the object trandformed into a String