org.objectweb.dream.protocol.channel
Class MultiplexBindProtocolImpl

java.lang.Object
  extended by org.objectweb.dream.AbstractComponent
      extended by org.objectweb.dream.protocol.channel.MultiplexBindProtocolImpl
All Implemented Interfaces:
ContextualBindingController, NeedAsyncStartController, PrepareStopLifeCycleController, Loggable, ChannelProtocol, MultiplexProtocolAttributeController, Protocol, AttributeController, BindingController, LifeCycleController

public class MultiplexBindProtocolImpl
extends AbstractComponent
implements ChannelProtocol, MultiplexProtocolAttributeController

Implementation of a binding multiplexer protocol. This protocol allows a client to establish multiple bindings to the same exported channel using a single lower level binding.


Field Summary
 
Fields inherited from class org.objectweb.dream.AbstractComponent
bindingLogger, fcNeedAsyncStart, fcState, lifeCycleLogger, logger, weaveableC
 
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
MultiplexBindProtocolImpl()
           
 
Method Summary
 OutgoingPush 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)
           
 ExportIdentifier createExportIdentifier(Map<String,Object> info, ExportIdentifier[] next)
          Creates a new export identifier with the provided info
 ExportIdentifier export(ChannelFactory channel, Map<String,Object> hints)
          Exports a ChannelFactory interface using this protocol.
 String getMultiplexChunkName()
          Returns the name of the MultiplexChunk that the protocol will add to outgoing messages.
 String[] listFc()
           
 void setMultiplexChunkName(String multiplexChunkName)
          Sets the value of the multiplexChunkName attribute.
 void unexport(ExportIdentifier exportIdentifier)
          Closes the export of a previously exported ChannelFactory interface.
 
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
 

Constructor Detail

MultiplexBindProtocolImpl

public MultiplexBindProtocolImpl()
Method Detail

bind

public OutgoingPush bind(ExportIdentifier exportId,
                         IncomingPush toClientPush,
                         Map<String,Object> hints)
                  throws InvalidExportIdentifierException,
                         BindException
Description copied from interface: ChannelProtocol
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 ChannelProtocol
Parameters:
exportId - the identifier of the exported interface.
toClientPush - the interface on which the client want to receive messages from the server, may be null if no messages are expected from the server.
hints - additional parameters, can be null.
Returns:
a OutgoingPush interface on which message can be send over the new communication channel.
Throws:
InvalidExportIdentifierException - if the given export identifier is incorrect.
BindException - if the binding process fails.
See Also:
ChannelProtocol.bind(ExportIdentifier, IncomingPush, Map)

export

public ExportIdentifier export(ChannelFactory channel,
                               Map<String,Object> hints)
                        throws ExportException
Description copied from interface: ChannelProtocol
Exports a ChannelFactory interface using this protocol. This method informs the protocol that the provided ChannelFactory is willing to accept connection. The returned export identifier is a specific name for the exported channel.

Specified by:
export in interface ChannelProtocol
Parameters:
channel - a ChannelFactory interface to export.
hints - additional parameters, can be null.
Returns:
an identifier for the exported interface.
Throws:
ExportException - if the export process fails.
See Also:
ChannelProtocol.export(ChannelFactory, Map)

unexport

public void unexport(ExportIdentifier exportIdentifier)
              throws InvalidExportIdentifierException
Description copied from interface: ChannelProtocol
Closes the export of a previously exported ChannelFactory interface. This methods do not close communication channels created by the exported channel factory.

Specified by:
unexport in interface ChannelProtocol
Parameters:
exportIdentifier - the export identifier of the channel.
Throws:
InvalidExportIdentifierException - if the given export identifier is incorrect.
See Also:
ChannelProtocol.unexport(ExportIdentifier)

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[])

getMultiplexChunkName

public String getMultiplexChunkName()
Description copied from interface: MultiplexProtocolAttributeController
Returns the name of the MultiplexChunk that the protocol will add to outgoing messages.

Specified by:
getMultiplexChunkName in interface MultiplexProtocolAttributeController
Returns:
the value of the multiplexChunkName attribute.
See Also:
MultiplexProtocolAttributeController.getMultiplexChunkName()

setMultiplexChunkName

public void setMultiplexChunkName(String multiplexChunkName)
Description copied from interface: MultiplexProtocolAttributeController
Sets the value of the multiplexChunkName attribute.

Specified by:
setMultiplexChunkName in interface MultiplexProtocolAttributeController
Parameters:
multiplexChunkName - the new value of the multiplexChunkName attribute.
See Also:
MultiplexProtocolAttributeController.setMultiplexChunkName(String)

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.