org.objectweb.dream.protocol.bus.logicalClock
Class ProtocolImpl

java.lang.Object
  extended by org.objectweb.dream.AbstractComponent
      extended by org.objectweb.dream.protocol.bus.logicalClock.ProtocolImpl
All Implemented Interfaces:
ContextualBindingController, NeedAsyncStartController, PrepareStopLifeCycleController, Loggable, BusProtocol, LogicalClockBusProtocol, Protocol, BindingController, LifeCycleController

public class ProtocolImpl
extends AbstractComponent
implements LogicalClockBusProtocol

Generic logical clock protocol implementation.


Nested Class Summary
protected  class ProtocolImpl.Session
           
 
Field Summary
protected  BusProtocol lowerLevelBusProtocolItf
           
protected  MessageManager messageManagerItf
           
 
Fields inherited from class org.objectweb.dream.AbstractComponent
bindingLogger, fcNeedAsyncStart, fcState, lifeCycleLogger, logger, weaveableC
 
Fields inherited from interface org.objectweb.dream.protocol.bus.logicalClock.LogicalClockBusProtocol
CLOCK_TYPE_HINT_KEY, LOGICAL_CLOCK_CHUNK_NAME_HINT_TYPE
 
Fields inherited from interface org.objectweb.dream.protocol.bus.BusProtocol
LOCAL_ADDRESS_HINT_KEY
 
Fields inherited from interface org.objectweb.dream.protocol.Protocol
ITF_NAME, LOWER_PROTOCOL_ITF_NAME
 
Fields inherited from interface org.objectweb.fractal.api.control.LifeCycleController
STARTED, STOPPED
 
Constructor Summary
ProtocolImpl()
           
 
Method Summary
 BusOutgoingPush bind(ExportIdentifier exportId, IncomingPush toClientPush, Map<String,Object> hints)
          Binds to a previously exported ChannelFactory interface designated by the given export identifier.
 void bindFc(String clientItfName, Object serverItf)
           
 LogicalClockExportIdentifier createExportIdentifier(int clockType, String chunkName, ExportIdentifier lowerId)
          Utility method
 ExportIdentifier createExportIdentifier(Map<String,Object> info, ExportIdentifier[] next)
          Creates a new export identifier with the provided info
 String[] listFc()
           
 
Methods inherited from class org.objectweb.dream.AbstractComponent
beforeFirstStart, bindFc, getFcNeedAsyncStart, getFcState, initComponent, lookupFc, prepareStopFc, setLogger, startFc, stopFc, unbindFc
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lowerLevelBusProtocolItf

protected BusProtocol lowerLevelBusProtocolItf

messageManagerItf

protected MessageManager messageManagerItf
Constructor Detail

ProtocolImpl

public ProtocolImpl()
Method Detail

bind

public BusOutgoingPush bind(ExportIdentifier exportId,
                            IncomingPush toClientPush,
                            Map<String,Object> hints)
                     throws InvalidExportIdentifierException,
                            BindException
Description copied from interface: BusProtocol
Binds to a previously exported ChannelFactory interface designated by the given export identifier. This methods instantiate a new communication channel and returns an interface on which messages can be sent to the server. In addition the toClientPush interface is the interface on which the client want to receive messages from the server.

Specified by:
bind in interface BusProtocol
Parameters:
exportId - the identifier of the exported interface.
toClientPush - the interface on which the client want to receive messages from the server.
hints - additional parameters, can be null.
Returns:
a BusOutgoingPush interface on which message can be send to the exported interface.
Throws:
InvalidExportIdentifierException - if the given export identifier is incorrect.
BindException - if the binding process fails.
See Also:
BusProtocol.bind(ExportIdentifier, IncomingPush, Map)

createExportIdentifier

public ExportIdentifier createExportIdentifier(Map<String,Object> info,
                                               ExportIdentifier[] next)
                                        throws InvalidExportIdentifierException
Description copied from interface: Protocol
Creates a new export identifier with the provided info

Specified by:
createExportIdentifier in interface Protocol
Parameters:
info - the info used to create the export identifier.
next - the export identifier of the lower level protocols.
Returns:
a new export identifier.
Throws:
InvalidExportIdentifierException - if the export identifier can't be created.
See Also:
Protocol.createExportIdentifier(Map, ExportIdentifier[])

createExportIdentifier

public LogicalClockExportIdentifier createExportIdentifier(int clockType,
                                                           String chunkName,
                                                           ExportIdentifier lowerId)
Description copied from interface: LogicalClockBusProtocol
Utility method

Specified by:
createExportIdentifier in interface LogicalClockBusProtocol
See Also:
LogicalClockBusProtocol.createExportIdentifier(int, String, ExportIdentifier)

listFc

public String[] listFc()
Specified by:
listFc in interface BindingController
See Also:
BindingController.listFc()

bindFc

public void bindFc(String clientItfName,
                   Object serverItf)
            throws NoSuchInterfaceException,
                   IllegalBindingException,
                   IllegalLifeCycleException
Specified by:
bindFc in interface BindingController
Overrides:
bindFc in class AbstractComponent
Throws:
NoSuchInterfaceException
IllegalBindingException
IllegalLifeCycleException
See Also:
BindingController.bindFc(String, Object)


Copyright © 2003, 2005 - INRIA Rhone-Alpes - All Rights Reserved.