com.sun.multicast.reliable.simple
Class SimpleSender

java.lang.Object
  |
  +--com.sun.multicast.reliable.simple.SimpleSender

public class SimpleSender
extends java.lang.Object

A simple sender object. This class provides a single class that lets you send data as simply as possible. Multiple senders per channel, security, and out of order delivery are not supported.


Constructor Summary
SimpleSender(java.lang.String channelFileName)
          Creates a SimpleSender a serialized channel stored in a file.
SimpleSender(java.lang.String channelFileName, boolean verbose)
           
SimpleSender(java.lang.String applicationName, java.lang.String channelName, java.util.Date startTime, java.util.Date endTime, Scope scope, byte ttl)
          Creates a SimpleSender with the parameters given.
 
Method Summary
 void close()
          Leaves the multicast transport session gracefully.
 java.io.OutputStream getOutputStream()
          Returns an OutputStream object that may be used to send data.
 TRAMTransportProfile getTRAMTransportProfile()
           
 void waitTill(java.util.Date time)
          Waits until a specific time.
 void waitTill(int numberReceivers)
          Waits until a certain number of receivers are on the channel *** currently unsupported ***
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleSender

public SimpleSender(java.lang.String applicationName,
                    java.lang.String channelName,
                    java.util.Date startTime,
                    java.util.Date endTime,
                    Scope scope,
                    byte ttl)
             throws RMException,
                    java.io.IOException,
                    java.rmi.RemoteException
Creates a SimpleSender with the parameters given. This constructor handles selecting a multicast address, creating a transport profile, creating a channel, and advertising it. All parameters except endTime are required to be not null.
Parameters:
applicationName - the name of the application
channelName - the name of the channel
startTime - the time that the sender expects to start sending data
endTime - the time that the sender expects to stop sending data (null if unknown)
scope - the administrative scope requested (null to choose one based on the ttl)
ttl - the time-to-live value for the data sent (1 is a good default)
Throws:
java.io.IOException - if an I/O error occurs
RMException - if a reliable-multicast-related exception occurs
java.rmi.RemoteException - if an RMI-related exception occurs

SimpleSender

public SimpleSender(java.lang.String channelFileName)
             throws RMException,
                    java.io.IOException
Creates a SimpleSender a serialized channel stored in a file.
Parameters:
channelFileName -  
Throws:
java.io.IOException - if an I/O error occurs
RMException - if a reliable-multicast-related exception occurs

SimpleSender

public SimpleSender(java.lang.String channelFileName,
                    boolean verbose)
             throws RMException,
                    java.io.IOException
Method Detail

waitTill

public void waitTill(java.util.Date time)
Waits until a specific time.
Parameters:
time - the time to wait for

waitTill

public void waitTill(int numberReceivers)
              throws UnsupportedException,
                     RMException
Waits until a certain number of receivers are on the channel *** currently unsupported ***
Parameters:
numberReceivers - the number of receivers to wait for
Throws:
RMException - if a reliable-multicast-related exception occurs

getOutputStream

public java.io.OutputStream getOutputStream()
                                     throws UnsupportedException,
                                            RMException
Returns an OutputStream object that may be used to send data.
Returns:
an OutputStream object
Throws:
RMException - if a reliable-multicast-related exception occurs
UnsupportedException - if the operation is not supported

close

public void close()
Leaves the multicast transport session gracefully. Pending transmissions and outgoing repairs are handled properly. This method may take some time to return.

getTRAMTransportProfile

public TRAMTransportProfile getTRAMTransportProfile()


JavaTM Reliable MulticastTM Service version 1.1
Copyright (c) 2001, Sun Microsystems Laboratories, All rights reserved.