Java Doc for JChannel.java in  » Net » JGroups-2.4.1-sp3 » org » jgroups » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Net » JGroups 2.4.1 sp3 » org.jgroups 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.jgroups.Channel
      org.jgroups.JChannel

All known Subclasses:   org.jgroups.mux.MuxChannel,
JChannel
public class JChannel extends Channel (Code)
JChannel is a pure Java implementation of Channel. When a JChannel object is instantiated it automatically sets up the protocol stack.

Properties

Properties are used to configure a channel, and are accepted in several forms; the String form is described here. A property string consists of a number of properties separated by colons. For example:

"<prop1>(arg1=val1):<prop2>(arg1=val1;arg2=val2):<prop3>:<propn>"

Each property relates directly to a protocol layer, which is implemented as a Java class. When a protocol stack is to be created based on the above property string, the first property becomes the bottom-most layer, the second one will be placed on the first, etc.: the stack is created from the bottom to the top, as the string is parsed from left to right. Each property has to be the name of a Java class that resides in the org.jgroups.protocols package.

Note that only the base name has to be given, not the fully specified class name (e.g., UDP instead of org.jgroups.protocols.UDP).

Each layer may have 0 or more arguments, which are specified as a list of name/value pairs in parentheses directly after the property. In the example above, the first protocol layer has 1 argument, the second 2, the third none. When a layer is created, these properties (if there are any) will be set in a layer by invoking the layer's setProperties() method

As an example the property string below instructs JGroups to create a JChannel with protocols UDP, PING, FD and GMS:

"UDP(mcast_addr=228.10.9.8;mcast_port=5678):PING:FD:GMS"

The UDP protocol layer is at the bottom of the stack, and it should use mcast address 228.10.9.8. and port 5678 rather than the default IP multicast address and port. The only other argument instructs FD to output debug information while executing. Property UDP refers to a class org.jgroups.protocols.UDP , which is subsequently loaded and an instance of which is created as protocol layer. If any of these classes are not found, an exception will be thrown and the construction of the stack will be aborted.
author:
   Bela Ban
version:
   $Id: JChannel.java,v 1.106.2.1 2006/12/04 22:47:16 vlada Exp $


Inner Class :class CloserThread extends Thread

Field Summary
final public static  StringDEFAULT_PROTOCOL_STACK
     The default protocol stack used by the default constructor.
final static  StringFORCE_PROPS
    
protected  booleanclosed
    
protected  CloserThreadcloser
     Thread responsible for closing a channel and potentially reconnecting to it (e.g., when shunned).
protected  booleanconnected
    
final protected  Loglog
    
protected  longsent_msgsreceived_msgssent_bytesreceived_bytes
    
protected  booleanstats
    

Constructor Summary
protected  JChannel(boolean no_op)
    
public  JChannel()
     Constructs a JChannel instance with the protocol stack specified by the DEFAULT_PROTOCOL_STACK member.
public  JChannel(File properties)
     Constructs a JChannel instance with the protocol stack configuration contained by the specified file.
public  JChannel(Element properties)
     Constructs a JChannel instance with the protocol stack configuration contained by the specified XML element.
public  JChannel(URL properties)
     Constructs a JChannel instance with the protocol stack configuration indicated by the specified URL.
public  JChannel(String properties)
     Constructs a JChannel instance with the protocol stack configuration based upon the specified properties parameter.
protected  JChannel(ProtocolStackConfigurator configurator)
     Constructs a JChannel instance with the protocol stack configuration contained by the protocol stack configurator parameter.
public  JChannel(Object properties)
     Creates a new JChannel with the protocol stack as defined in the properties parameter.

Method Summary
protected  void_close(boolean disconnect, boolean close_mq)
     Disconnects and closes the channel.
public  voidblockOk()
     Called to acknowledge a block() (callback in MembershipListener or BlockEvent received from call to receive()).
protected  voidcheckClosed()
    
protected  voidcheckNotConnected()
    
public synchronized  voidclose()
     Destroys the channel.
final public  voidcloseMessageQueue(boolean flush_entries)
    
public synchronized  voidconnect(String cluster_name)
     Connects the channel to a group. If the channel is already connected, an error message will be printed to the error log. If the channel is closed a ChannelClosed exception will be thrown. This method starts the protocol stack by calling ProtocolStack.start, then it sends an Event.CONNECT event down the stack and waits to receive a CONNECT_OK event. Once the CONNECT_OK event arrives from the protocol stack, any channel listeners are notified and the channel is considered connected.
Parameters:
  cluster_name - A String denoting the group name.
public synchronized  booleanconnect(String cluster_name, Address target, String state_id, long timeout)
    
 AddressdetermineCoordinator()
    
public synchronized  voiddisconnect()
     Disconnects the channel if it is connected.
public  voiddown(Event evt)
    
public  StringdumpQueue()
    
public  MapdumpStats()
     Returns a map of statistics of the various protocols and of the channel itself. Map.
public  StringdumpTimerQueue()
    
public  voidenableStats(boolean stats)
    
public  booleanflushSupported()
    
public  booleangetAllStates(Vector targets, long timeout)
     Retrieves the current group state.
public  StringgetChannelName()
    
public  StringgetClusterName()
    
static  ObjectgetEvent(Event evt)
    
public  AddressgetLocalAddress()
    
protected  LoggetLog()
    
public  intgetNumMessages()
    
public  intgetNumberOfTasksInTimer()
    
public  ObjectgetOpt(int option)
     returns the value of an option.
public  StringgetProperties()
     returns the protocol stack configuration in string format.
public  ProtocolStackgetProtocolStack()
     Returns the protocol stack.
public  longgetReceivedBytes()
    
public  longgetReceivedMessages()
    
public  longgetSentBytes()
    
public  longgetSentMessages()
    
public  booleangetState(Address target, long timeout)
     Retrieves the current group state.
public  booleangetState(Address target, String state_id, long timeout)
     Retrieves a substate (or partial state) from the target.
Parameters:
  target - State provider.
public  ViewgetView()
     Returns the current view.
final protected  voidinit(ProtocolStackConfigurator configurator)
    
public  booleanisConnected()
    
public  booleanisOpen()
    
public synchronized  voidopen()
     Opens the channel.
public  Objectpeek(long timeout)
     Just peeks at the next message, view or block.
public  StringprintProtocolSpec(boolean include_properties)
     Returns a pretty-printed form of all the protocols.
public  Objectreceive(long timeout)
     Blocking receive method. This method returns the object that was first received by this JChannel and that has not been received before.
public  voidresetStats()
    
public  voidreturnState(byte[] state)
     Called by the application is response to receiving a getState() object when calling receive().
public  voidreturnState(byte[] state, String state_id)
    
public  voidsend(Message msg)
     Sends a message through the protocol stack.
public  voidsend(Address dst, Address src, Serializable obj)
    
public  voidsetOpt(int option, Object value)
     Sets a channel option.
public synchronized  voidshutdown()
    
public  booleanstartFlush(long timeout, int numberOfAttempts, boolean automatic_resume)
     Will perform a flush of the system, ie.
public  booleanstartFlush(long timeout, boolean automatic_resume)
     Will perform a flush of the system, ie.
public  booleanstatsEnabled()
    
public  voidstopFlush()
    
public  StringtoString(boolean details)
    
public  voidup(Event evt)
     Callback method
Called by the ProtocolStack when a message is received.

Field Detail
DEFAULT_PROTOCOL_STACK
final public static String DEFAULT_PROTOCOL_STACK(Code)
The default protocol stack used by the default constructor.



FORCE_PROPS
final static String FORCE_PROPS(Code)



closed
protected boolean closed(Code)



closer
protected CloserThread closer(Code)
Thread responsible for closing a channel and potentially reconnecting to it (e.g., when shunned).



connected
protected boolean connected(Code)



log
final protected Log log(Code)



sent_msgsreceived_msgssent_bytesreceived_bytes
protected long sent_msgsreceived_msgssent_bytesreceived_bytes(Code)



stats
protected boolean stats(Code)
Collect statistics




Constructor Detail
JChannel
protected JChannel(boolean no_op)(Code)
Used by subclass to create a JChannel without a protocol stack, don't use as application programmer



JChannel
public JChannel() throws ChannelException(Code)
Constructs a JChannel instance with the protocol stack specified by the DEFAULT_PROTOCOL_STACK member.
throws:
  ChannelException - if problems occur during the initialization ofthe protocol stack.



JChannel
public JChannel(File properties) throws ChannelException(Code)
Constructs a JChannel instance with the protocol stack configuration contained by the specified file.
Parameters:
  properties - a file containing a JGroups XML protocol stackconfiguration.
throws:
  ChannelException - if problems occur during the configuration orinitialization of the protocol stack.



JChannel
public JChannel(Element properties) throws ChannelException(Code)
Constructs a JChannel instance with the protocol stack configuration contained by the specified XML element.
Parameters:
  properties - a XML element containing a JGroups XML protocol stackconfiguration.
throws:
  ChannelException - if problems occur during the configuration orinitialization of the protocol stack.



JChannel
public JChannel(URL properties) throws ChannelException(Code)
Constructs a JChannel instance with the protocol stack configuration indicated by the specified URL.
Parameters:
  properties - a URL pointing to a JGroups XML protocol stackconfiguration.
throws:
  ChannelException - if problems occur during the configuration orinitialization of the protocol stack.



JChannel
public JChannel(String properties) throws ChannelException(Code)
Constructs a JChannel instance with the protocol stack configuration based upon the specified properties parameter.
Parameters:
  properties - an old style property string, a string representing asystem resource containing a JGroups XML configuration,a string representing a URL pointing to a JGroups XMLXML configuration, or a string representing a file namethat contains a JGroups XML configuration.
throws:
  ChannelException - if problems occur during the configuration andinitialization of the protocol stack.



JChannel
protected JChannel(ProtocolStackConfigurator configurator) throws ChannelException(Code)
Constructs a JChannel instance with the protocol stack configuration contained by the protocol stack configurator parameter.

All of the public constructors of this class eventually delegate to this method.
Parameters:
  configurator - a protocol stack configurator containing a JGroupsprotocol stack configuration.
throws:
  ChannelException - if problems occur during the initialization ofthe protocol stack.




JChannel
public JChannel(Object properties) throws ChannelException(Code)
Creates a new JChannel with the protocol stack as defined in the properties parameter. an example of this parameter is
"UDP:PING:FD:STABLE:NAKACK:UNICAST:FRAG:FLUSH:GMS:VIEW_ENFORCER:STATE_TRANSFER:QUEUE"
Other examples can be found in the ./conf directory

Parameters:
  properties - the protocol stack setup; if null, the default protocol stack will be used.The properties can also be a java.net.URL object or a string that is a URL spec.The JChannel will validate any URL object and String object to see if they are a URL.In case of the parameter being a url, the JChannel will try to load the xml from there.In case properties is a org.w3c.dom.Element, the ConfiguratorFactory will parse theDOM tree with the element as its root element.




Method Detail
_close
protected void _close(boolean disconnect, boolean close_mq)(Code)
Disconnects and closes the channel. This method does the folloing things
  1. Calls this.disconnect if the disconnect parameter is true
  2. Calls Queue.close on mq if the close_mq parameter is true
  3. Calls ProtocolStack.stop on the protocol stack
  4. Calls ProtocolStack.destroy on the protocol stack
  5. Sets the channel closed and channel connected flags to true and false
  6. Notifies any channel listener of the channel close operation



blockOk
public void blockOk()(Code)
Called to acknowledge a block() (callback in MembershipListener or BlockEvent received from call to receive()). After sending blockOk(), no messages should be sent until a new view has been received. Calling this method on a closed channel has no effect.



checkClosed
protected void checkClosed() throws ChannelClosedException(Code)
health check
throws a ChannelClosed exception if the channel is closed



checkNotConnected
protected void checkNotConnected() throws ChannelNotConnectedException(Code)
health check.
throws a ChannelNotConnected exception if the channel is not connected



close
public synchronized void close()(Code)
Destroys the channel. After this method has been called, the channel us unusable.
This operation will disconnect the channel and close the channel receive queue immediately



closeMessageQueue
final public void closeMessageQueue(boolean flush_entries)(Code)



connect
public synchronized void connect(String cluster_name) throws ChannelException, ChannelClosedException(Code)
Connects the channel to a group. If the channel is already connected, an error message will be printed to the error log. If the channel is closed a ChannelClosed exception will be thrown. This method starts the protocol stack by calling ProtocolStack.start, then it sends an Event.CONNECT event down the stack and waits to receive a CONNECT_OK event. Once the CONNECT_OK event arrives from the protocol stack, any channel listeners are notified and the channel is considered connected.
Parameters:
  cluster_name - A String denoting the group name. Cannot be null.
exception:
  ChannelException - The protocol stack cannot be started
exception:
  ChannelClosedException - The channel is closed and therefore cannot be used any longer.A new channel has to be created first.



connect
public synchronized boolean connect(String cluster_name, Address target, String state_id, long timeout) throws ChannelException(Code)



determineCoordinator
Address determineCoordinator()(Code)



disconnect
public synchronized void disconnect()(Code)
Disconnects the channel if it is connected. If the channel is closed, this operation is ignored
Otherwise the following actions happen in the listed order
  1. The JChannel sends a DISCONNECT event down the protocol stack
  2. Blocks until the channel to receives a DISCONNECT_OK event
  3. Sends a STOP_QUEING event down the stack
  4. Stops the protocol stack by calling ProtocolStack.stop()
  5. Notifies the listener, if the listener is available



down
public void down(Event evt)(Code)
Sends a message through the protocol stack if the stack is available
Parameters:
  evt - the message to send down, encapsulated in an event



dumpQueue
public String dumpQueue()(Code)



dumpStats
public Map dumpStats()(Code)
Returns a map of statistics of the various protocols and of the channel itself. Map. A map where the keys are the protocols ("channel" pseudo key isused for the channel itself") and the values are property maps.



dumpTimerQueue
public String dumpTimerQueue()(Code)



enableStats
public void enableStats(boolean stats)(Code)



flushSupported
public boolean flushSupported()(Code)



getAllStates
public boolean getAllStates(Vector targets, long timeout) throws ChannelNotConnectedException, ChannelClosedException(Code)
Retrieves the current group state. Sends GET_STATE event down to STATE_TRANSFER layer. Blocks until STATE_TRANSFER sends up a GET_STATE_OK event or until timeout milliseconds have elapsed. The argument of GET_STATE_OK should be a vector of objects.
Parameters:
  targets - - the target members to receive the state from ( an Address list )
Parameters:
  timeout - - the number of milliseconds to wait for the operation to complete successfully true of the state was received, false if the operation timed outJChannel.getState(org.jgroups.Address,long)



getChannelName
public String getChannelName()(Code)
returns the name of the channel if the channel is not connected or if it is closed it will return null JChannel.getClusterName()



getClusterName
public String getClusterName()(Code)



getEvent
static Object getEvent(Event evt)(Code)
returns the value of the event
These objects will be returned
 Event Type    - Return Type
 Event.MSG           - returns a Message object
 Event.VIEW_CHANGE   - returns a View object
 Event.SUSPECT       - returns a SuspectEvent object
 Event.BLOCK         - returns a new BlockEvent object
 Event.GET_APPLSTATE - returns a GetStateEvent object
 Event.STATE_RECEIVED- returns a SetStateEvent object
 Event.Exit          - returns an ExitEvent object
 All other           - return the actual Event object
 

Parameters:
  evt - - the event of which you want to extract the value the event value if it matches the select list,returns null if the event is nullreturns the event itself if a match (See above) can not be made of the event type



getLocalAddress
public Address getLocalAddress()(Code)
returns the local address of the channel returns null if the channel is closed



getLog
protected Log getLog()(Code)



getNumMessages
public int getNumMessages()(Code)



getNumberOfTasksInTimer
public int getNumberOfTasksInTimer()(Code)



getOpt
public Object getOpt(int option)(Code)
returns the value of an option.
Parameters:
  option - the option you want to see the value for the object value, in most cases java.lang.Boolean
See Also:   JChannel.setOpt



getProperties
public String getProperties()(Code)
returns the protocol stack configuration in string format. an example of this property is
"UDP:PING:FD:STABLE:NAKACK:UNICAST:FRAG:FLUSH:GMS:VIEW_ENFORCER:STATE_TRANSFER:QUEUE"



getProtocolStack
public ProtocolStack getProtocolStack()(Code)
Returns the protocol stack. Currently used by Debugger. Specific to JChannel, therefore not visible in Channel



getReceivedBytes
public long getReceivedBytes()(Code)



getReceivedMessages
public long getReceivedMessages()(Code)



getSentBytes
public long getSentBytes()(Code)



getSentMessages
public long getSentMessages()(Code)



getState
public boolean getState(Address target, long timeout) throws ChannelNotConnectedException, ChannelClosedException(Code)
Retrieves the current group state. Sends GET_STATE event down to STATE_TRANSFER layer. Blocks until STATE_TRANSFER sends up a GET_STATE_OK event or until timeout milliseconds have elapsed. The argument of GET_STATE_OK should be a single object.
Parameters:
  target - the target member to receive the state from. if null, state is retrieved from coordinator
Parameters:
  timeout - the number of milliseconds to wait for the operation to complete successfully. 0 waits untilthe state has been received true of the state was received, false if the operation timed out



getState
public boolean getState(Address target, String state_id, long timeout) throws ChannelNotConnectedException, ChannelClosedException(Code)
Retrieves a substate (or partial state) from the target.
Parameters:
  target - State provider. If null, coordinator is used
Parameters:
  state_id - The ID of the substate. If null, the entire state will be transferred
Parameters:
  timeout - the number of milliseconds to wait for the operation to complete successfully. 0 waits untilthe state has been received
throws:
  ChannelNotConnectedException -
throws:
  ChannelClosedException -



getView
public View getView()(Code)
Returns the current view.
If the channel is not connected or if it is closed it will return null.
returns the current group view, or null if the channel is closed or disconnected



init
final protected void init(ProtocolStackConfigurator configurator) throws ChannelException(Code)



isConnected
public boolean isConnected()(Code)
returns true if the Connect operation has been called successfully



isOpen
public boolean isOpen()(Code)
returns true if the Open operation has been called successfully



open
public synchronized void open() throws ChannelException(Code)
Opens the channel. This does the following actions:
  1. Resets the receiver queue by calling Queue.reset
  2. Sets up the protocol stack by calling ProtocolStack.setup
  3. Sets the closed flag to false



peek
public Object peek(long timeout) throws ChannelNotConnectedException, ChannelClosedException, TimeoutException(Code)
Just peeks at the next message, view or block. Does not install new view if view is received
Does the same thing as JChannel.receive but doesn't remove the object from the receiver queue



printProtocolSpec
public String printProtocolSpec(boolean include_properties)(Code)
Returns a pretty-printed form of all the protocols. If include_properties is set, the properties for each protocol will also be printed.



receive
public Object receive(long timeout) throws ChannelNotConnectedException, ChannelClosedException, TimeoutException(Code)
Blocking receive method. This method returns the object that was first received by this JChannel and that has not been received before. After the object is received, it is removed from the receive queue.
If you only want to inspect the object received without removing it from the queue call JChannel.peek
If no messages are in the receive queue, this method blocks until a message is added or the operation times out
By specifying a timeout of 0, the operation blocks forever, or until a message has been received.
Parameters:
  timeout - the number of milliseconds to wait if the receive queue is empty. 0 means wait forever
exception:
  TimeoutException - if a timeout occured prior to a new message was received
exception:
  ChannelNotConnectedException -
exception:
  ChannelClosedException -
See Also:   JChannel.peek



resetStats
public void resetStats()(Code)



returnState
public void returnState(byte[] state)(Code)
Called by the application is response to receiving a getState() object when calling receive(). When the application receives a getState() message on the receive() method, it should call returnState() to reply with the state of the application
Parameters:
  state - The state of the application as a byte buffer(to send over the network).



returnState
public void returnState(byte[] state, String state_id)(Code)
Returns a substate as indicated by state_id
Parameters:
  state -
Parameters:
  state_id -



send
public void send(Message msg) throws ChannelNotConnectedException, ChannelClosedException(Code)
Sends a message through the protocol stack. Implements the Transport interface.
Parameters:
  msg - the message to be sent through the protocol stack,the destination of the message is specified inside the message itself
exception:
  ChannelNotConnectedException -
exception:
  ChannelClosedException -



send
public void send(Address dst, Address src, Serializable obj) throws ChannelNotConnectedException, ChannelClosedException(Code)
creates a new message with the destination address, and the source address and the object as the message value
Parameters:
  dst - - the destination address of the message, null for all members
Parameters:
  src - - the source address of the message
Parameters:
  obj - - the value of the message
exception:
  ChannelNotConnectedException -
exception:
  ChannelClosedException -
See Also:   JChannel.send



setOpt
public void setOpt(int option, Object value)(Code)
Sets a channel option. The options can be one of the following:
  • Channel.BLOCK
  • Channel.LOCAL
  • Channel.AUTO_RECONNECT
  • Channel.AUTO_GETSTATE

There are certain dependencies between the options that you can set, I will try to describe them here.

Option: Channel.BLOCK
Value: java.lang.Boolean
Result: set to true will set setOpt(VIEW, true) and the JChannel will receive BLOCKS and VIEW events

Option: LOCAL
Value: java.lang.Boolean
Result: set to true the JChannel will receive messages that it self sent out.

Option: AUTO_RECONNECT
Value: java.lang.Boolean
Result: set to true and the JChannel will try to reconnect when it is being closed

Option: AUTO_GETSTATE
Value: java.lang.Boolean
Result: set to true, the AUTO_RECONNECT will be set to true and the JChannel will try to get the state after a close and reconnect happens


Parameters:
  option - the parameter option Channel.VIEW, Channel.SUSPECT, etc
Parameters:
  value - the value to set for this option




shutdown
public synchronized void shutdown()(Code)
Shuts down the channel without disconnecting



startFlush
public boolean startFlush(long timeout, int numberOfAttempts, boolean automatic_resume)(Code)
Will perform a flush of the system, ie. all pending messages are flushed out of the system and all members ack their reception. After this call return, no member will be sending any messages until JChannel.stopFlush() is called.

In case of flush collisions random sleep time backoff algorithm is employed and flush is reattempted for numberOfAttempts. Therefore this method is guaranteed to return after timeout*numberOfAttempts miliseconds.
Parameters:
  timeout -
Parameters:
  numberOfAttempts - if flush was unsuccessful attempt again until numberOfAttempts is 0
Parameters:
  automatic_resume - Call JChannel.stopFlush() after the flush true if FLUSH completed within the timeout




startFlush
public boolean startFlush(long timeout, boolean automatic_resume)(Code)
Will perform a flush of the system, ie. all pending messages are flushed out of the system and all members ack their reception. After this call return, no member will be sending any messages until JChannel.stopFlush() is called.

In case of flush collisions random sleep time backoff algorithm is employed and flush is reattempted for a default of three times. Therefore this method is guaranteed to return after timeout*3 miliseconds.
Parameters:
  timeout -
Parameters:
  automatic_resume - Call JChannel.stopFlush() after the flush true if FLUSH completed within the timeout




statsEnabled
public boolean statsEnabled()(Code)



stopFlush
public void stopFlush()(Code)



toString
public String toString(boolean details)(Code)



up
public void up(Event evt)(Code)
Callback method
Called by the ProtocolStack when a message is received. It will be added to the message queue from which subsequent Receives will dequeue it.
Parameters:
  evt - the event carrying the message from the protocol stack



Fields inherited from org.jgroups.Channel
final public static int AUTO_GETSTATE(Code)(Java Doc)
final public static int AUTO_RECONNECT(Code)(Java Doc)
final public static int BLOCK(Code)(Java Doc)
final public static int GET_STATE_EVENTS(Code)(Java Doc)
final public static int LOCAL(Code)(Java Doc)
final public static int SUSPECT(Code)(Java Doc)
final public static int VIEW(Code)(Java Doc)
protected ChannelListener channel_listener(Code)(Java Doc)
protected Set channel_listeners(Code)(Java Doc)
protected Receiver receiver(Code)(Java Doc)
protected UpHandler up_handler(Code)(Java Doc)

Methods inherited from org.jgroups.Channel
public synchronized void addChannelListener(ChannelListener listener)(Code)(Java Doc)
abstract public void blockOk()(Code)(Java Doc)
abstract public void close()(Code)(Java Doc)
abstract public void connect(String cluster_name) throws ChannelException, ChannelClosedException(Code)(Java Doc)
abstract public boolean connect(String cluster_name, Address target, String state_id, long timeout) throws ChannelException(Code)(Java Doc)
abstract public void disconnect()(Code)(Java Doc)
public void down(Event evt)(Code)(Java Doc)
public String dumpQueue()(Code)(Java Doc)
abstract public Map dumpStats()(Code)(Java Doc)
abstract public boolean flushSupported()(Code)(Java Doc)
abstract public boolean getAllStates(Vector targets, long timeout) throws ChannelNotConnectedException, ChannelClosedException(Code)(Java Doc)
abstract public String getChannelName()(Code)(Java Doc)
abstract public String getClusterName()(Code)(Java Doc)
abstract public Address getLocalAddress()(Code)(Java Doc)
abstract protected Log getLog()(Code)(Java Doc)
public int getNumMessages()(Code)(Java Doc)
abstract public Object getOpt(int option)(Code)(Java Doc)
abstract public boolean getState(Address target, long timeout) throws ChannelNotConnectedException, ChannelClosedException(Code)(Java Doc)
abstract public boolean getState(Address target, String state_id, long timeout) throws ChannelNotConnectedException, ChannelClosedException(Code)(Java Doc)
abstract public View getView()(Code)(Java Doc)
abstract public boolean isConnected()(Code)(Java Doc)
abstract public boolean isOpen()(Code)(Java Doc)
protected void notifyChannelClosed(Channel c)(Code)(Java Doc)
protected void notifyChannelConnected(Channel c)(Code)(Java Doc)
protected void notifyChannelDisconnected(Channel c)(Code)(Java Doc)
protected void notifyChannelReconnected(Address addr)(Code)(Java Doc)
protected void notifyChannelShunned()(Code)(Java Doc)
public void open() throws ChannelException(Code)(Java Doc)
public static String option2String(int option)(Code)(Java Doc)
abstract public Object peek(long timeout) throws ChannelNotConnectedException, ChannelClosedException, TimeoutException(Code)(Java Doc)
abstract public Object receive(long timeout) throws ChannelNotConnectedException, ChannelClosedException, TimeoutException(Code)(Java Doc)
public synchronized void removeChannelListener(ChannelListener listener)(Code)(Java Doc)
abstract public void returnState(byte[] state)(Code)(Java Doc)
abstract public void returnState(byte[] state, String state_id)(Code)(Java Doc)
abstract public void send(Message msg) throws ChannelNotConnectedException, ChannelClosedException(Code)(Java Doc)
abstract public void send(Address dst, Address src, Serializable obj) throws ChannelNotConnectedException, ChannelClosedException(Code)(Java Doc)
public void setChannelListener(ChannelListener channel_listener)(Code)(Java Doc)
abstract public void setOpt(int option, Object value)(Code)(Java Doc)
public void setReceiver(Receiver r)(Code)(Java Doc)
public void setUpHandler(UpHandler up_handler)(Code)(Java Doc)
abstract protected void shutdown()(Code)(Java Doc)
abstract public boolean startFlush(long timeout, boolean automatic_resume)(Code)(Java Doc)
abstract public void stopFlush()(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.