gov.virginia.dcjs.jini.service
Class BroadcastService

java.lang.Object
  extended byjava.rmi.server.RemoteObject
      extended byjava.rmi.server.RemoteServer
          extended byjava.rmi.server.UnicastRemoteObject
              extended bygov.virginia.dcjs.jini.service.GenericService
                  extended bygov.virginia.dcjs.jini.service.GenericOutputService
                      extended bygov.virginia.dcjs.jini.service.BroadcastService
All Implemented Interfaces:
net.jini.admin.Administrable, AdministrableRMI, BroadcastControl, com.sun.jini.admin.DestroyAdmin, java.util.EventListener, OutputService, OutputServiceRMI, java.rmi.Remote, java.io.Serializable, ServiceAdmin, net.jini.lookup.ServiceIDListener

public class BroadcastService
extends GenericOutputService
implements OutputServiceRMI, BroadcastControl, AdministrableRMI

See Also:
Serialized Form

Field Summary
 
Fields inherited from class gov.virginia.dcjs.jini.service.GenericService
r_name
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
BroadcastService(java.lang.String config)
           
 
Method Summary
 void addClient(IpBroadcastServer thread, java.lang.String name)
          Add the specified client thread to those being listenned on.
protected  void close(java.lang.Object destination)
          Close communications with the specified output object.
protected  java.lang.Object createDestination(java.lang.String name)
          Create a new destination object which can receive messages.
protected  void initializeServiceName()
          Specify this service's name from JiniServices.
protected  void logWrite(java.lang.String apName, java.lang.String message)
          Queue up the specified message to be written to the log.
static void main(java.lang.String[] args)
           
protected  void newLine(java.lang.Object destination)
          Add a new line to the specified destination.
 void removeClient(IpBroadcastServer thread, java.lang.String name)
          Remove the specified client thread from those being listenned to.
 void start()
          Bring the service online
 void stop()
          Take the service offline
protected  void write(java.lang.Object destination, java.lang.String message)
          Add the specified text to the output destination.
 
Methods inherited from class gov.virginia.dcjs.jini.service.GenericOutputService
addDestination, close, close, destinations, getDestination, write, writeln
 
Methods inherited from class gov.virginia.dcjs.jini.service.GenericService
destroy, getAdmin, serviceIDNotify
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface gov.virginia.dcjs.jini.shared.OutputService
close, close, destinations, write, writeln
 
Methods inherited from interface net.jini.admin.Administrable
getAdmin
 

Constructor Detail

BroadcastService

public BroadcastService(java.lang.String config)
                 throws java.rmi.RemoteException
Parameters:
config - URL of server configuration file conforming to the * IpServer.dtd at that site.
Method Detail

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception

initializeServiceName

protected void initializeServiceName()
Specify this service's name from JiniServices.

Specified by:
initializeServiceName in class GenericService

write

protected void write(java.lang.Object destination,
                     java.lang.String message)
Add the specified text to the output destination. * The next entry will be on this same line. * @param destination Intended audience to send the output to. * @param message Text to add to the output destination.

Specified by:
write in class GenericOutputService

newLine

protected void newLine(java.lang.Object destination)
Add a new line to the specified destination. * Not used, but defined to make it non abstract. * @param destination Object to receive the new line.

Specified by:
newLine in class GenericOutputService

logWrite

protected void logWrite(java.lang.String apName,
                        java.lang.String message)
Queue up the specified message to be written to the log. * @param message Text to be written to the log.


close

protected void close(java.lang.Object destination)
Close communications with the specified output object. * @param destination Output object to close communication with.

Specified by:
close in class GenericOutputService

start

public void start()
           throws java.rmi.RemoteException
Bring the service online

Specified by:
start in interface ServiceAdmin
Overrides:
start in class GenericService
Throws:
java.rmi.RemoteException

stop

public void stop()
          throws java.rmi.RemoteException
Take the service offline

Specified by:
stop in interface ServiceAdmin
Overrides:
stop in class GenericOutputService
Throws:
java.rmi.RemoteException

createDestination

protected java.lang.Object createDestination(java.lang.String name)
Create a new destination object which can receive messages. * @param name Unique name of destination object to be created. * @return Destination object corresponding to the provided name.

Specified by:
createDestination in class GenericOutputService

addClient

public void addClient(IpBroadcastServer thread,
                      java.lang.String name)
Add the specified client thread to those being listenned on. * @param thread Client connection. * @param name Pool the client belongs to.

Specified by:
addClient in interface BroadcastControl

removeClient

public void removeClient(IpBroadcastServer thread,
                         java.lang.String name)
Remove the specified client thread from those being listenned to. * @param thread Client connection. * @param name Pool the client belongs to.

Specified by:
removeClient in interface BroadcastControl