org.jboss.ha.framework.server
Interface JChannelFactoryMBean

All Known Implementing Classes:
JChannelFactory

public interface JChannelFactoryMBean

StandardMBean interface for JChannelFactory. Based on the org.jgroups.jmx.JChannelFactoryMBean interface, which is scheduled to be removed.

The plain-old-java-interface for the channel factory is org.jgroups.ChannelFactory; users are encouraged to dependency inject a org.jgroups.ChannelFactory.

Version:
$Revision: 85945 $
Author:
Bela Ban, Brian Stansberry

Method Summary
 void clearConfigurations()
          Removes all protocol stack configurations
 void create()
          Execute the create phase of the 4 step lifecycle.
 org.jgroups.Channel createChannel(String stack_name)
          Create a Channel using the specified stack.
 org.jgroups.Channel createMultiplexerChannel(String stack_name, String id)
          Creates and returns a shared transport Channel configured with the specified protocol stack configuration.
 org.jgroups.Channel createMultiplexerChannel(String stack_name, String id, boolean register_for_state_transfer, String substate_id)
          Creates and returns a shared transport Channel configured with the specified protocol stack configuration.
 void destroy()
          Execute the destroy phase of the 4 step lifecycle.
 String dumpChannels()
          Dumps the names of any currently running multiplexer channels along with the id's of any services that are using them.
 String dumpConfiguration()
          Returns the names of the currently registered protocol stack configurations.
 String getConfig(String stack_name)
          Returns the stack configuration as a string (valid to be fed into new JChannel()).
 String getDomain()
          Gets the domain portion of any ObjectName the factory should use when registering channels or protocols in JMX.
 String getMultiplexerConfig()
          Returns all configurations as a string
 boolean isExposeChannels()
          Gets whether this factory should register channels it creates in JMX.
 boolean isExposeProtocols()
          Gets whether this factory should register protocols it creates in JMX.
 boolean removeConfig(String stack_name)
          Removes the given stack from the configuration.
 void setDomain(String name)
          Sets the domain portion of any ObjectName the factory should use when registering channels or protocols in JMX.
 void setExposeChannels(boolean flag)
          Sets whether this factory should register channels it creates in JMX.
 void setExposeProtocols(boolean f)
          Sets whether this factory should register protocols it creates in JMX.
 void setMultiplexerConfig(String properties)
          Instructs JGroups to load a set of XML protocol stack configurations.
 void setMultiplexerConfig(String properties, boolean replace)
          Instructs JGroups to load a set of XML protocol stack configurations.
 void start()
          Execute the start phase of the 4 step lifecycle.
 void stop()
          Execute the stop phase of the 4 step lifecycle.
 

Method Detail

getMultiplexerConfig

String getMultiplexerConfig()
Returns all configurations as a string


setMultiplexerConfig

void setMultiplexerConfig(String properties)
                          throws Exception
Instructs JGroups to load a set of XML protocol stack configurations. Same as setMultiplexerConfig(properties, true).

Parameters:
properties - a string representing a system resource containing a JGroups XML configuration, a string representing a URL pointing to a JGroups XML configuration, or a string representing a file name that contains a JGroups XML configuration.
Throws:
Exception

setMultiplexerConfig

void setMultiplexerConfig(String properties,
                          boolean replace)
                          throws Exception
Instructs JGroups to load a set of XML protocol stack configurations.

Parameters:
properties - a string representing a system resource containing a JGroups XML configuration, a string representing a URL pointing to a JGroups XML configuration, or a string representing a file name that contains a JGroups XML configuration.
replace - true if any protocol stack configuration in properties that has the same name as an existing configuration should replace that existing configuration; false if the existing configuration should take precedence.
Throws:
Exception

getDomain

String getDomain()
Gets the domain portion of any ObjectName the factory should use when registering channels or protocols in JMX.

Returns:
the domain portion of the object name, or null.

setDomain

void setDomain(String name)
Sets the domain portion of any ObjectName the factory should use when registering channels or protocols in JMX.

Parameters:
name - the domain portion of the object name. Must conform to the rules for elements in an ObjectName.

isExposeChannels

boolean isExposeChannels()
Gets whether this factory should register channels it creates in JMX.

Returns:
true if channels should be registered, false if not

setExposeChannels

void setExposeChannels(boolean flag)
Sets whether this factory should register channels it creates in JMX.

Parameters:
flag - true if channels should be registered, false if not

isExposeProtocols

boolean isExposeProtocols()
Gets whether this factory should register protocols it creates in JMX.

Returns:
true if protocols should be registered, false if not

setExposeProtocols

void setExposeProtocols(boolean f)
Sets whether this factory should register protocols it creates in JMX.

Parameters:
flag - true if protocols should be registered, false if not

getConfig

String getConfig(String stack_name)
                 throws Exception
Returns the stack configuration as a string (valid to be fed into new JChannel()). Throws an exception if the stack_name is not found. One of the setMultiplexerConfig() methods had to be called beforehand.

Returns:
The protocol stack config as a plain string
Throws:
Exception

removeConfig

boolean removeConfig(String stack_name)
Removes the given stack from the configuration.

Parameters:
stack_name - the name of the stack
Returns:
true if the stack was removed; false if it wasn't registered

clearConfigurations

void clearConfigurations()
Removes all protocol stack configurations


createChannel

org.jgroups.Channel createChannel(String stack_name)
                                  throws Exception
Create a Channel using the specified stack. Channel will use a shared transport if the singleton-name attribute is set on the stack's transport protocol.

Parameters:
stack_name - the name of the stack
Returns:
the channel
Throws:
Exception

createMultiplexerChannel

org.jgroups.Channel createMultiplexerChannel(String stack_name,
                                             String id)
                                             throws Exception
Creates and returns a shared transport Channel configured with the specified protocol stack configuration.

NOTE: The implementation of this method is somewhat different from what is described in ChannelFactory.createMultiplexerChannel(String, String). The returned channel will not be an instance of org.jgroups.mux.MuxChannel; rather a channel that uses a shared transport will be returned. This will be the case whether or not the protocol stack specified by stack_name includes a singleton_name attribute in its transport protocol configuration. If no singleton_name attribute is present, this factory will create a synthetic one by prepending "unnamed_" to the provided id param and will use that for the returned channel's transport protocol. (Note this will not effect the protocol stack configuration named by stack_name; i.e. another request that passes the same stack_name will not inherit the synthetic singleton name.)

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. If clients attempt to create a Channel for an undefined stack name an Exception will be thrown.
id - Only used if the transport protocol configuration for the specified stack does not include the singleton_name attribute; then it is used to create a synthetic singleton-name for the channel's protocol stack.
Returns:
An implementation of Channel configured with a shared transport.
Throws:
org.jgroups.ChannelException
Exception

createMultiplexerChannel

org.jgroups.Channel createMultiplexerChannel(String stack_name,
                                             String id,
                                             boolean register_for_state_transfer,
                                             String substate_id)
                                             throws Exception
Creates and returns a shared transport Channel configured with the specified protocol stack configuration. See createMultiplexerChannel(String, String); the additional attributes specified in this overloaded version of that method are ignored.

Parameters:
register_for_state_transfer - ignored in JBoss AS. Treated as false.
substate_id - ignored in JBoss AS
Returns:
An implementation of Channel configured with a shared transport.
Throws:
org.jgroups.ChannelException
Exception

create

void create()
            throws Exception
Execute the create phase of the 4 step lifecycle.

Throws:
Exception

start

void start()
           throws Exception
Execute the start phase of the 4 step lifecycle.

Throws:
Exception

stop

void stop()
Execute the stop phase of the 4 step lifecycle.

Throws:
Exception

destroy

void destroy()
Execute the destroy phase of the 4 step lifecycle.

Throws:
Exception

dumpConfiguration

String dumpConfiguration()
Returns the names of the currently registered protocol stack configurations.


dumpChannels

String dumpChannels()
Dumps the names of any currently running multiplexer channels along with the id's of any services that are using them. Information about currently running non-multiplexer channels are not returned.



Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.