service
Class DistributedServicesMiddleware

java.lang.Object
  extended by service.DistributedServicesMiddleware
All Implemented Interfaces:
IDistributedServices

public class DistributedServicesMiddleware
extends java.lang.Object
implements IDistributedServices

Access point to the middleware and associated services.


Nested Class Summary
protected  class DistributedServicesMiddleware.MessageReader
          Inner class that manage all received messages and dispatch them to the required services thanks to a message dispatcher
 
Field Summary
protected  BasicBroadcastService basicBroadcastService
          Basic broadcast access point.
protected  CommunicationElement commElt
          The underlying communication element for communicating with other processes.
protected  ProxyCommunication commService
          Communication service access point
protected  MessageDispatcher dispatcher
          Message dispatcher for dispatching received message to the associated service
protected  IdentificationService idService
          Identification service access point
protected  ReliableBroadcastService reliableBroadcastService
          Reliable broadcast access point.
 
Constructor Summary
DistributedServicesMiddleware()
           
 
Method Summary
 void connect()
          Connect the process to the system using default value, that is, without communication delays or errors.
 void connect(ReliabilitySetting setting)
          Connect the process to the system using reliability settings.
 void connect(ReliabilitySetting setting, int localPort)
          Connect the process to the system using reliability settings and a specific TCP port.
 void disconnect()
          Disconnect the process from the system
 IBroadcast getBasicBroadcastService()
           
 ICommunication getCommunicationService()
           
 IIdentification getIdentificationService()
           
 IBroadcast getReliableBroadcastService()
           
protected  void initServices()
          Initialize the services.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

commElt

protected CommunicationElement commElt
The underlying communication element for communicating with other processes.


commService

protected ProxyCommunication commService
Communication service access point


idService

protected IdentificationService idService
Identification service access point


basicBroadcastService

protected BasicBroadcastService basicBroadcastService
Basic broadcast access point.


reliableBroadcastService

protected ReliableBroadcastService reliableBroadcastService
Reliable broadcast access point.


dispatcher

protected MessageDispatcher dispatcher
Message dispatcher for dispatching received message to the associated service

Constructor Detail

DistributedServicesMiddleware

public DistributedServicesMiddleware()
Method Detail

connect

public void connect()
             throws CommunicationException
Description copied from interface: IDistributedServices
Connect the process to the system using default value, that is, without communication delays or errors.

Specified by:
connect in interface IDistributedServices
Throws:
CommunicationException - in case of problem during the connection

connect

public void connect(ReliabilitySetting setting)
             throws CommunicationException
Description copied from interface: IDistributedServices
Connect the process to the system using reliability settings.

Specified by:
connect in interface IDistributedServices
Parameters:
setting - reliability settings to use for the current process
Throws:
CommunicationException - in case of problem during the connection

connect

public void connect(ReliabilitySetting setting,
                    int localPort)
             throws CommunicationException
Description copied from interface: IDistributedServices
Connect the process to the system using reliability settings and a specific TCP port.

Specified by:
connect in interface IDistributedServices
Parameters:
setting - reliability settings to use for the current process
localPort - TCP port to be used by the server socket of the communication layer
Throws:
CommunicationException - in case of problem during the connection

disconnect

public void disconnect()
Description copied from interface: IDistributedServices
Disconnect the process from the system

Specified by:
disconnect in interface IDistributedServices

getCommunicationService

public ICommunication getCommunicationService()
Specified by:
getCommunicationService in interface IDistributedServices
Returns:
the communication service access point

getIdentificationService

public IIdentification getIdentificationService()
Specified by:
getIdentificationService in interface IDistributedServices
Returns:
the identification service access point

getBasicBroadcastService

public IBroadcast getBasicBroadcastService()
Specified by:
getBasicBroadcastService in interface IDistributedServices
Returns:
the basic broadcast service access point

getReliableBroadcastService

public IBroadcast getReliableBroadcastService()
Specified by:
getReliableBroadcastService in interface IDistributedServices
Returns:
the reliable broadcast service access point

initServices

protected void initServices()
Initialize the services.