org.jgroups
Interface ChannelFactory

All Known Implementing Classes:
JChannelFactory

Deprecated. Might get removed in 3.0. Use your own method of injecting channels

@Deprecated
public interface ChannelFactory

A channel factory that removes hardwiring of calls to create JGroups channels. ChannelFactory enables client applications to use custom Channel creation methodologies.

See Also:
JChannelFactory

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

Method Detail

setMultiplexerConfig

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

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

setMultiplexerConfig

void setMultiplexerConfig(java.io.File properties)
                          throws java.lang.Exception
Deprecated. 
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
Deprecated. 
Throws:
java.lang.Exception

setMultiplexerConfig

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

setMultiplexerConfig

void setMultiplexerConfig(java.lang.String properties)
                          throws java.lang.Exception
Deprecated. 
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
Deprecated. 
Creates an implementation of the Channel using a given stack name and registering it under a given identity.

Channel has to be created with a unique application id per stack name.

Provided stack name has to be one of the stacks defined in a property file that was passed to setMultiplexerConfig (e.g conf/stacks.xml). If clients attempt to create a Channel for an undefined stack name or they attempt to register a duplicate Channel per stack an Exception will be thrown.

Rather than having each multiplexed channel do a separate state transfer clients can bundle state transfers for all channels created with the same ChannelFactory. First of all, clients have to create Channels with register_for_state_transfer set to true. After the last Channel that was created with register_for_state_transfer set to true connects and initiates state transfer the actual state transfer for all such channels from this ChannelFactory is executed.

Using bundled state transfers is especially useful with the FLUSH protocol in a stack. Recall that each state transfer triggers a flush and thus instead of doing a separate flush for each Channel created with this ChannelFactory we execute only one flush for all state transfers.

However, be aware of the implication of asynchronous nature of bundled state transfer with the respect of channel connect. Recall that each Channel after it returns from successful getState method can assume that state is available. In case of bundled state transfer, state will be set only after the last Channel registered for the bundled state transfer connects and executes getState.

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).
register_for_state_transfer - If set to true, after all registered listeners called either Channel.connect(String, Address, String, long) or and Channel#getState(Address, long) successively on the returned Channel, the state for all registered listeners will be fetched and set in all listeners.
substate_id - The ID of the sub state 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.
Throws:
ChannelException
java.lang.Exception
See Also:
Multiplexer, MuxChannel

createMultiplexerChannel

Channel createMultiplexerChannel(java.lang.String stack_name,
                                 java.lang.String id)
                                 throws java.lang.Exception
Deprecated. 
Creates an implementation of the Channel using a given stack name and registering it under a given identity.

Channel has to be created with a unique application id per stack name.

Provided stack name has to be one of the stacks defined in a property file that was passed to setMultiplexerConfig (e.g conf/stacks.xml). If clients attempt to create a Channel for an undefined stack name or they attempt to register a duplicate Channel per stack an Exception will be thrown.

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).
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.
Throws:
ChannelException
java.lang.Exception
See Also:
Multiplexer, MuxChannel

createChannel

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

createChannel

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

Throws:
ChannelException

createChannel

Channel createChannel(java.lang.String stack_name)
                      throws java.lang.Exception
Deprecated. 
Throws:
java.lang.Exception


Copyright © 1998-2009 Bela Ban / Red Hat. All Rights Reserved.