|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jgroups.JChannelFactory
public class JChannelFactory
JChannelFactory creates pure Java implementations of the Channel
interface.
See JChannel
for a discussion of channel properties.
Constructor Summary | |
---|---|
JChannelFactory()
Constructs a JChannelFactory instance that contains no
protocol stack configuration. |
|
JChannelFactory(org.w3c.dom.Element properties)
Constructs a JChannelFactory instance that utilizes the
specified file for protocl stack configuration. |
|
JChannelFactory(java.io.File properties)
Constructs a JChannelFactory instance that utilizes the
specified file for protocl stack configuration. |
|
JChannelFactory(java.lang.String properties)
Constructs a JChannel instance with the protocol stack
configuration based upon the specified properties parameter. |
|
JChannelFactory(java.net.URL properties)
Constructs a JChannelFactory instance that utilizes the
specified file for protocl stack configuration. |
Method Summary | |
---|---|
void |
close(MuxChannel ch)
|
void |
connect(MuxChannel ch)
|
void |
create()
|
Channel |
createChannel()
Creates a JChannel implementation of the
Channel |
Channel |
createChannel(java.lang.Object properties)
Deprecated. JChannel 's conversion to type-specific
construction, and the subsequent deprecation of its
JChannel(Object) constructor, necessitate the
deprecation of this factory method as well. Type-specific
protocol stack configuration should be specfied during
construction of an instance of this factory. |
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 |
destroy()
|
void |
disconnect(MuxChannel ch)
|
java.lang.String |
dumpChannels()
|
java.lang.String |
dumpConfiguration()
|
java.lang.String |
getDomain()
|
java.lang.String |
getMultiplexerConfig()
|
boolean |
hasMuxChannel(java.lang.String stack_name,
java.lang.String id)
Returns true if this factory has already registered MuxChannel with given stack_name and an id, false otherwise. |
boolean |
isExposeChannels()
|
boolean |
isExposeProtocols()
|
void |
open(MuxChannel ch)
|
void |
setDomain(java.lang.String domain)
|
void |
setExposeChannels(boolean expose_channels)
|
void |
setExposeProtocols(boolean expose_protocols)
|
void |
setMultiplexerConfig(org.w3c.dom.Element properties)
|
void |
setMultiplexerConfig(java.io.File file)
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 url)
|
void |
shutdown(MuxChannel ch)
|
void |
start()
|
void |
stop()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JChannelFactory()
JChannelFactory
instance that contains no
protocol stack configuration.
public JChannelFactory(java.io.File properties) throws ChannelException
JChannelFactory
instance that utilizes the
specified file for protocl stack configuration.
properties
- a file containing a JGroups XML protocol stack
configuration.
ChannelException
- if problems occur during the interpretation of
the protocol stack configuration.public JChannelFactory(org.w3c.dom.Element properties) throws ChannelException
JChannelFactory
instance that utilizes the
specified file for protocl stack configuration.
properties
- a XML element containing a JGroups XML protocol stack
configuration.
ChannelException
- if problems occur during the interpretation of
the protocol stack configuration.public JChannelFactory(java.net.URL properties) throws ChannelException
JChannelFactory
instance that utilizes the
specified file for protocl stack configuration.
properties
- a URL pointing to a JGroups XML protocol stack
configuration.
ChannelException
- if problems occur during the interpretation of
the protocol stack configuration.public JChannelFactory(java.lang.String properties) throws ChannelException
JChannel
instance with the protocol stack
configuration based upon the specified properties parameter.
properties
- an old style property string, a string representing a
system resource containing a JGroups XML configuration,
a string representing a URL pointing to a JGroups XML
XML configuration, or a string representing a file name
that contains a JGroups XML configuration.
ChannelException
- if problems occur during the interpretation of
the protocol stack configuration.Method Detail |
---|
public void setMultiplexerConfig(java.lang.Object properties) throws java.lang.Exception
ChannelFactory
setMultiplexerConfig
in interface ChannelFactory
ChannelException
java.lang.Exception
public void setMultiplexerConfig(java.io.File file) throws java.lang.Exception
ChannelFactory
setMultiplexerConfig
in interface ChannelFactory
ChannelException
java.lang.Exception
public void setMultiplexerConfig(org.w3c.dom.Element properties) throws java.lang.Exception
setMultiplexerConfig
in interface ChannelFactory
java.lang.Exception
public void setMultiplexerConfig(java.net.URL url) throws java.lang.Exception
setMultiplexerConfig
in interface ChannelFactory
java.lang.Exception
public java.lang.String getMultiplexerConfig()
public void setMultiplexerConfig(java.lang.String properties) throws java.lang.Exception
setMultiplexerConfig
in interface ChannelFactory
java.lang.Exception
public java.lang.String getDomain()
public void setDomain(java.lang.String domain)
public boolean isExposeChannels()
public void setExposeChannels(boolean expose_channels)
public boolean isExposeProtocols()
public void setExposeProtocols(boolean expose_protocols)
public Channel createChannel(java.lang.Object properties) throws ChannelException
JChannel
's conversion to type-specific
construction, and the subsequent deprecation of its
JChannel(Object)
constructor, necessitate the
deprecation of this factory method as well. Type-specific
protocol stack configuration should be specfied during
construction of an instance of this factory.
JChannel
implementation of the
Channel
interface.
createChannel
in interface ChannelFactory
properties
- the protocol stack configuration information; a
null
value means use the default protocol
stack configuration.
ChannelException
- if the creation of the channel failed.public Channel createChannel() throws ChannelException
JChannel
implementation of the
Channel interface using the protocol stack configuration
information specfied during construction of an instance of this factory.
- Specified by:
createChannel
in interface ChannelFactory
- Throws:
ChannelException
- if the creation of the channel failed.
public Channel createMultiplexerChannel(java.lang.String stack_name, java.lang.String id) throws java.lang.Exception
createMultiplexerChannel
in interface ChannelFactory
java.lang.Exception
public 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
ChannelFactory
createMultiplexerChannel
in interface ChannelFactory
stack_name
- The name of the stack to be used. All stacks are defined in the configuration
with which the factory is configured (see ChannelFactory.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 listenerssubstate_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
MuxChannel
.
ChannelException
java.lang.Exception
public boolean hasMuxChannel(java.lang.String stack_name, java.lang.String id)
stack_name
- name of the stack usedid
- service id
public void connect(MuxChannel ch) throws ChannelException
ChannelException
public void disconnect(MuxChannel ch)
public void close(MuxChannel ch)
public void shutdown(MuxChannel ch)
public void open(MuxChannel ch) throws ChannelException
ChannelException
public void create() throws java.lang.Exception
java.lang.Exception
public void start() throws java.lang.Exception
java.lang.Exception
public void stop()
public void destroy()
public java.lang.String dumpConfiguration()
public java.lang.String dumpChannels()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |