org.jgroups
Interface ChannelFactory

All Known Implementing Classes:
JChannelFactory

public interface ChannelFactory

A channel factory takes care of creation of channel implementations. Subclasses will create different implementations.


Method Summary
 Channel createChannel()
          Create a new channel with the properties defined in the factory
 Channel createChannel(java.lang.Object props)
           
 Channel createMultiplexerChannel(java.lang.String stack_name, java.lang.String id)
           
 Channel createMultiplexerChannel(java.lang.String stack_name, java.lang.String id, boolean register_for_state_transfer, java.lang.String substate_id)
          Creates an implementation of Channel using a guven stack name and registering under a given identity.
 void setMultiplexerConfig(org.w3c.dom.Element properties)
           
 void setMultiplexerConfig(java.io.File properties)
          Initializes the factory from a file.
 void setMultiplexerConfig(java.lang.Object properties)
          Initializes the factory.
 void setMultiplexerConfig(java.lang.String properties)
           
 void setMultiplexerConfig(java.net.URL properties)
           
 

Method Detail

setMultiplexerConfig

void setMultiplexerConfig(java.lang.Object properties)
                          throws java.lang.Exception
Initializes the factory.

Parameters:
properties -
Throws:
ChannelException
java.lang.Exception

setMultiplexerConfig

void setMultiplexerConfig(java.io.File properties)
                          throws java.lang.Exception
Initializes the factory from a file. Example: conf/stacks.xml

Parameters:
properties -
Throws:
ChannelException
java.lang.Exception

setMultiplexerConfig

void setMultiplexerConfig(org.w3c.dom.Element properties)
                          throws java.lang.Exception
Throws:
java.lang.Exception

setMultiplexerConfig

void setMultiplexerConfig(java.net.URL properties)
                          throws java.lang.Exception
Throws:
java.lang.Exception

setMultiplexerConfig

void setMultiplexerConfig(java.lang.String properties)
                          throws java.lang.Exception
Throws:
java.lang.Exception

createMultiplexerChannel

Channel createMultiplexerChannel(java.lang.String stack_name,
                                 java.lang.String id,
                                 boolean register_for_state_transfer,
                                 java.lang.String substate_id)
                                 throws java.lang.Exception
Creates an implementation of Channel using a guven stack name and registering under a given identity. The latter is used for multiplexing requests to and from a block on top of a channel.

Parameters:
stack_name - The name of the stack to be used. All stacks are defined in the configuration with which the factory is configured (see setMultiplexerConfig(Object) for example.
id - The identifier used for multiplexing and demultiplexing (dispatching requests to one of possibly multiple receivers). Note that id needs to be a string since it will be shipped with each message. Try to pick a short string, because this is shipped with every message (overhead). todo: possibly change to short ?
register_for_state_transfer - If set to true, after all registered listeners called connect() on the returned Channel, the state for all registered listeners will be fetched and set in all listeners
substate_id - The ID of the substate to be retrieved. Set this to null if the entire state should be retrieved. If register_for_state_transfer is false, substate_id will be ignored
Returns:
An implementation of Channel which keeps track of the id, so that it can be attached to each message and be properly dispatched at the receiver. This will be a MuxChannel.
Throws:
ChannelException
java.lang.Exception

createMultiplexerChannel

Channel createMultiplexerChannel(java.lang.String stack_name,
                                 java.lang.String id)
                                 throws java.lang.Exception
Throws:
java.lang.Exception

createChannel

Channel createChannel(java.lang.Object props)
                      throws ChannelException
Throws:
ChannelException

createChannel

Channel createChannel()
                      throws ChannelException
Create a new channel with the properties defined in the factory

Throws:
ChannelException


Copyright ? 1998-2006 Bela Ban. All Rights Reserved.