cgl.narada.service.qos.impl
Class CommunicationsService

java.lang.Object
  extended by java.lang.Thread
      extended by cgl.narada.service.qos.impl.CommunicationsService
All Implemented Interfaces:
Handler, Runnable

public class CommunicationsService
extends Thread
implements Handler

This class is responsible for managing communications between the broker and entities


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
CommunicationsService(QosServiceImpl qosServiceImpl)
           
 
Method Summary
 void closeConnection()
           
 void handleData(byte[] data, String sender)
           
 boolean hasPendingTransfers()
          Checks to see if there are pending transfers.
 boolean isClient()
          This method indicates that the node in question is a client
 void loadCommunicationsOfType(Properties props, String commType)
           
static void main(String[] args)
           
 void processConnectionLost()
           
 void processData(byte[] data, String sender)
          This method is responsible for dealing with packets of messages that are received over a link, based on the protocol headers that are contained within the packets.
 void registerEntity(int entityId)
          This method is responsible for registering an entity with a specified broker
 void run()
           
 void sendData(byte[] dataToBeSent)
           
 String setupLink(Properties props, String linkType)
           
 void terminateService()
          Terminating the service
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, 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
 

Constructor Detail

CommunicationsService

public CommunicationsService(QosServiceImpl qosServiceImpl)
Method Detail

isClient

public boolean isClient()
This method indicates that the node in question is a client

Specified by:
isClient in interface Handler

handleData

public void handleData(byte[] data,
                       String sender)
Specified by:
handleData in interface Handler

terminateService

public void terminateService()
                      throws ServiceException
Terminating the service

Throws:
ServiceException

run

public void run()
Specified by:
run in interface Runnable
Overrides:
run in class Thread

processData

public void processData(byte[] data,
                        String sender)
This method is responsible for dealing with packets of messages that are received over a link, based on the protocol headers that are contained within the packets. The DataReceived object is the encapsulation of the data that is received by one of the ReceiverThreads within the transport layer.

Parameters:
_dataReceived - The data that is received by one of the ReceiverThreads

processConnectionLost

public void processConnectionLost()

loadCommunicationsOfType

public void loadCommunicationsOfType(Properties props,
                                     String commType)
                              throws ServiceException
Throws:
ServiceException

registerEntity

public void registerEntity(int entityId)
                    throws ServiceException
This method is responsible for registering an entity with a specified broker

Throws:
ServiceException

setupLink

public String setupLink(Properties props,
                        String linkType)
                 throws ServiceException
Throws:
ServiceException

closeConnection

public void closeConnection()
                     throws ServiceException
Throws:
ServiceException

hasPendingTransfers

public boolean hasPendingTransfers()
Checks to see if there are pending transfers.


sendData

public void sendData(byte[] dataToBeSent)
              throws ServiceException
Throws:
ServiceException

main

public static void main(String[] args)


For comments and suggestions please send e-mail to The NaradaBrokering Project