Java Doc for SimpleTcpCluster.java in  » Sevlet-Container » apache-tomcat-6.0.14 » org » apache » catalina » ha » tcp » 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 » Sevlet Container » apache tomcat 6.0.14 » org.apache.catalina.ha.tcp 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.catalina.ha.tcp.SimpleTcpCluster

SimpleTcpCluster
public class SimpleTcpCluster implements CatalinaCluster,Lifecycle,LifecycleListener,IDynamicProperty,MembershipListener,ChannelListener(Code)
A Cluster implementation using simple multicast. Responsible for setting up a cluster and provides callers with a valid multicast receiver/sender. FIXME remove install/remove/start/stop context dummys FIXME wrote testcases
author:
   Filip Hanik
author:
   Remy Maucherat
author:
   Peter Rossbach
version:
   $Revision: 532865 $, $Date: 2007-04-26 23:09:41 +0200 (jeu., 26 avr. 2007) $


Field Summary
final public static  StringAFTER_MANAGERREGISTER_EVENT
    
final public static  StringAFTER_MANAGERUNREGISTER_EVENT
    
final public static  StringAFTER_MEMBERREGISTER_EVENT
    
final public static  StringAFTER_MEMBERUNREGISTER_EVENT
    
final public static  StringBEFORE_MANAGERREGISTER_EVENT
    
final public static  StringBEFORE_MANAGERUNREGISTER_EVENT
    
final public static  StringBEFORE_MEMBERREGISTER_EVENT
    
final public static  StringBEFORE_MEMBERUNREGISTER_EVENT
    
final public static  StringRECEIVE_MESSAGE_FAILURE_EVENT
    
final public static  StringSEND_MESSAGE_FAILURE_EVENT
    
protected  Channelchannel
     Group channel.
protected  StringclusterImpName
    
protected  ListclusterListeners
    
protected  StringclusterName
    
protected  Containercontainer
     The Container associated with this Cluster.
protected  booleanhasMembers
    
protected  booleanheartbeatBackgroundEnabled
    
final protected static  Stringinfo
     Descriptive information about this component implementation.
protected  LifecycleSupportlifecycle
     The lifecycle event support for this component.
public static  Loglog
    
protected  ClusterManagermanagerTemplate
    
protected  Mapmanagers
     The context name <->manager association for distributed contexts.
protected  StringManagersm
     The string manager for this package.
protected  booleanstarted
    
protected  PropertyChangeSupportsupport
     The property change support for this component.

Constructor Summary
public  SimpleTcpCluster()
    

Method Summary
public  booleanaccept(Serializable msg, Member sender)
    
public  voidaddClusterListener(ClusterListener listener)
    
public  voidaddLifecycleListener(LifecycleListener listener)
     Add a lifecycle event listener to this component.
public  voidaddValve(Valve valve)
    
public  voidbackgroundProcess()
     Execute a periodic task, such as reloading, etc.
protected  voidcheckDefaults()
    
public synchronized  ManagercreateManager(String name)
    
public  ClusterListener[]findClusterListeners()
     Get the cluster listeners associated with this cluster.
public  LifecycleListener[]findLifecycleListeners()
     Get the lifecycle listeners associated with this lifecycle.
public  ChannelgetChannel()
    
public  intgetChannelSendOptions()
    
public  org.apache.catalina.ha.ClusterDeployergetClusterDeployer()
    
public  StringgetClusterName()
     Return the name of the cluster that this Server is currently configured to operate within.
public  ContainergetContainer()
    
public  StringgetInfo()
     Return descriptive information about this Cluster implementation and the corresponding version number, in the format <description>/<version>.
public  MembergetLocalMember()
     Return the member that represents this node.
public  LoggetLogger()
    
public  ManagergetManager(String name)
    
public  StringgetManagerClassName()
    
public  StringgetManagerName(String name, Manager manager)
    
public  ClusterManagergetManagerTemplate()
    
public  MapgetManagers()
    
public  Member[]getMembers()
    
public  ObjectgetProperty(String key)
    
public  IteratorgetPropertyNames()
    
public  StringgetProtocol()
    
public  Valve[]getValves()
    
public  booleanhasMembers()
    
public  booleanisHeartbeatBackgroundEnabled()
    
public  booleanisNotifyLifecycleListenerOnFailure()
    
public  voidlifecycleEvent(LifecycleEvent lifecycleEvent)
     Use as base to handle start/stop/periodic Events from host.
public  voidmemberAdded(Member member)
    
public  voidmemberDisappeared(Member member)
    
public  voidmessageReceived(Serializable message, Member sender)
    
public  voidmessageReceived(ClusterMessage message)
    
protected  voidregisterClusterValve()
    
public  voidregisterManager(Manager manager)
    
public  voidremoveClusterListener(ClusterListener listener)
    
public  voidremoveLifecycleListener(LifecycleListener listener)
     Remove a lifecycle event listener from this component.
public  voidremoveManager(Manager manager)
    
public  voidremoveProperty(String key)
     remove a configured property.
public  voidsend(ClusterMessage msg)
    
public  voidsend(ClusterMessage msg, Member dest)
    
public  voidsendClusterDomain(ClusterMessage msg)
    
public  voidsetChannel(Channel channel)
    
public  voidsetChannelSendOptions(int channelSendOptions)
    
public  voidsetClusterDeployer(org.apache.catalina.ha.ClusterDeployer clusterDeployer)
    
public  voidsetClusterName(String clusterName)
     Set the name of the cluster to join, if no cluster with this name is present create one.
public  voidsetContainer(Container container)
    
public  voidsetHeartbeatBackgroundEnabled(boolean heartbeatBackgroundEnabled)
    
public  voidsetManagerClassName(String managerClassName)
    
public  voidsetManagerTemplate(ClusterManager managerTemplate)
    
public  voidsetNotifyLifecycleListenerOnFailure(boolean notifyListenerOnFailure)
    
public  voidsetProperty(String name, String value)
    
public  voidsetProperty(String name, Object value)
    
public  voidsetProtocol(String protocol)
    
public  voidstart()
     Prepare for the beginning of active use of the public methods of this component.
public  voidstop()
     Gracefully terminate the active cluster component.
This will disconnect the cluster communication channel, stop the listener and deregister the valves from host or engine.

Note:
The sub elements receiver, sender, membership, listener or valves are not removed.
protected  voidtransferProperty(String prefix, Object bean)
     transfer properties from cluster configuration to subelement bean.
protected  voidunregisterClusterValve()
    

Field Detail
AFTER_MANAGERREGISTER_EVENT
final public static String AFTER_MANAGERREGISTER_EVENT(Code)



AFTER_MANAGERUNREGISTER_EVENT
final public static String AFTER_MANAGERUNREGISTER_EVENT(Code)



AFTER_MEMBERREGISTER_EVENT
final public static String AFTER_MEMBERREGISTER_EVENT(Code)



AFTER_MEMBERUNREGISTER_EVENT
final public static String AFTER_MEMBERUNREGISTER_EVENT(Code)



BEFORE_MANAGERREGISTER_EVENT
final public static String BEFORE_MANAGERREGISTER_EVENT(Code)



BEFORE_MANAGERUNREGISTER_EVENT
final public static String BEFORE_MANAGERUNREGISTER_EVENT(Code)



BEFORE_MEMBERREGISTER_EVENT
final public static String BEFORE_MEMBERREGISTER_EVENT(Code)



BEFORE_MEMBERUNREGISTER_EVENT
final public static String BEFORE_MEMBERUNREGISTER_EVENT(Code)



RECEIVE_MESSAGE_FAILURE_EVENT
final public static String RECEIVE_MESSAGE_FAILURE_EVENT(Code)



SEND_MESSAGE_FAILURE_EVENT
final public static String SEND_MESSAGE_FAILURE_EVENT(Code)



channel
protected Channel channel(Code)
Group channel.



clusterImpName
protected String clusterImpName(Code)
Name for logging purpose



clusterListeners
protected List clusterListeners(Code)
Listeners of messages



clusterName
protected String clusterName(Code)
The cluster name to join



container
protected Container container(Code)
The Container associated with this Cluster.



hasMembers
protected boolean hasMembers(Code)
has members



heartbeatBackgroundEnabled
protected boolean heartbeatBackgroundEnabled(Code)
call Channel.heartbeat() at container background thread
See Also:   org.apache.catalina.tribes.group.GroupChannel.heartbeat



info
final protected static String info(Code)
Descriptive information about this component implementation.



lifecycle
protected LifecycleSupport lifecycle(Code)
The lifecycle event support for this component.



log
public static Log log(Code)



managerTemplate
protected ClusterManager managerTemplate(Code)



managers
protected Map managers(Code)
The context name <->manager association for distributed contexts.



sm
protected StringManager sm(Code)
The string manager for this package.



started
protected boolean started(Code)
Has this component been started?



support
protected PropertyChangeSupport support(Code)
The property change support for this component.




Constructor Detail
SimpleTcpCluster
public SimpleTcpCluster()(Code)




Method Detail
accept
public boolean accept(Serializable msg, Member sender)(Code)
notify all listeners from receiving a new message is not ClusterMessage emitt Failure Event to LifecylceListener
Parameters:
  message - receveived Message



addClusterListener
public void addClusterListener(ClusterListener listener)(Code)
add cluster message listener and register cluster to this listener
See Also:   org.apache.catalina.ha.CatalinaCluster.addClusterListener(org.apache.catalina.ha.MessageListener)



addLifecycleListener
public void addLifecycleListener(LifecycleListener listener)(Code)
Add a lifecycle event listener to this component.
Parameters:
  listener - The listener to add



addValve
public void addValve(Valve valve)(Code)
Add cluster valve Cluster Valves are only add to container when cluster is started!
Parameters:
  valve - The new cluster Valve.



backgroundProcess
public void backgroundProcess()(Code)
Execute a periodic task, such as reloading, etc. This method will be invoked inside the classloading context of this container. Unexpected throwables will be caught and logged.
See Also:   org.apache.catalina.ha.deploy.FarmWarDeployer.backgroundProcess
See Also:   org.apache.catalina.tribes.group.GroupChannel.heartbeat
See Also:   org.apache.catalina.tribes.group.GroupChannel.HeartbeatThread.run



checkDefaults
protected void checkDefaults()(Code)



createManager
public synchronized Manager createManager(String name)(Code)
Create new Manager without add to cluster (comes with start the manager)
Parameters:
  name - Context Name of this manager
See Also:   org.apache.catalina.Cluster.createManager(java.lang.String)
See Also:   SimpleTcpCluster.addManager(String,Manager)
See Also:   DeltaManager.start



findClusterListeners
public ClusterListener[] findClusterListeners()(Code)
Get the cluster listeners associated with this cluster. If this Array has no listeners registered, a zero-length array is returned.



findLifecycleListeners
public LifecycleListener[] findLifecycleListeners()(Code)
Get the lifecycle listeners associated with this lifecycle. If this Lifecycle has no listeners registered, a zero-length array is returned.



getChannel
public Channel getChannel()(Code)



getChannelSendOptions
public int getChannelSendOptions()(Code)



getClusterDeployer
public org.apache.catalina.ha.ClusterDeployer getClusterDeployer()(Code)
get current Deployer



getClusterName
public String getClusterName()(Code)
Return the name of the cluster that this Server is currently configured to operate within. The name of the cluster associated with this server



getContainer
public Container getContainer()(Code)
Get the Container associated with our Cluster The Container associated with our Cluster



getInfo
public String getInfo()(Code)
Return descriptive information about this Cluster implementation and the corresponding version number, in the format <description>/<version>.



getLocalMember
public Member getLocalMember()(Code)
Return the member that represents this node. Member



getLogger
public Log getLogger()(Code)



getManager
public Manager getManager(String name)(Code)



getManagerClassName
public String getManagerClassName()(Code)
String



getManagerName
public String getManagerName(String name, Manager manager)(Code)

Parameters:
  name -
Parameters:
  manager -



getManagerTemplate
public ClusterManager getManagerTemplate()(Code)



getManagers
public Map getManagers()(Code)
Returns the managers.



getMembers
public Member[] getMembers()(Code)
Get all current cluster members all members or empty array



getProperty
public Object getProperty(String key)(Code)
get current config
Parameters:
  key - The property



getPropertyNames
public Iterator getPropertyNames()(Code)
Get all properties keys An iterator over the property names.



getProtocol
public String getProtocol()(Code)

See Also:   org.apache.catalina.Cluster.getProtocol



getValves
public Valve[] getValves()(Code)
get all cluster valves current cluster valves



hasMembers
public boolean hasMembers()(Code)



isHeartbeatBackgroundEnabled
public boolean isHeartbeatBackgroundEnabled()(Code)
Return heartbeat enable flag (default false) the heartbeatBackgroundEnabled



isNotifyLifecycleListenerOnFailure
public boolean isNotifyLifecycleListenerOnFailure()(Code)
Returns the notifyLifecycleListenerOnFailure.



lifecycleEvent
public void lifecycleEvent(LifecycleEvent lifecycleEvent)(Code)
Use as base to handle start/stop/periodic Events from host. Currently only log the messages as trace level.
See Also:   org.apache.catalina.LifecycleListener.lifecycleEvent(org.apache.catalina.LifecycleEvent)



memberAdded
public void memberAdded(Member member)(Code)
New cluster member is registered
See Also:   org.apache.catalina.ha.MembershipListener.memberAdded(org.apache.catalina.ha.Member)



memberDisappeared
public void memberDisappeared(Member member)(Code)
Cluster member is gone
See Also:   org.apache.catalina.ha.MembershipListener.memberDisappeared(org.apache.catalina.ha.Member)



messageReceived
public void messageReceived(Serializable message, Member sender)(Code)



messageReceived
public void messageReceived(ClusterMessage message)(Code)



registerClusterValve
protected void registerClusterValve() throws Exception(Code)
register all cluster valve to host or engine
throws:
  Exception -
throws:
  ClassNotFoundException -



registerManager
public void registerManager(Manager manager)(Code)



removeClusterListener
public void removeClusterListener(ClusterListener listener)(Code)
remove message listener and deregister Cluster from listener
See Also:   org.apache.catalina.ha.CatalinaCluster.removeClusterListener(org.apache.catalina.ha.MessageListener)



removeLifecycleListener
public void removeLifecycleListener(LifecycleListener listener)(Code)
Remove a lifecycle event listener from this component.
Parameters:
  listener - The listener to remove



removeManager
public void removeManager(Manager manager)(Code)
remove an application form cluster replication bus
See Also:   org.apache.catalina.ha.CatalinaCluster.removeManager(java.lang.StringManager)



removeProperty
public void removeProperty(String key)(Code)
remove a configured property.
Parameters:
  key -



send
public void send(ClusterMessage msg)(Code)
send message to all cluster members
Parameters:
  msg - message to transfer
See Also:   org.apache.catalina.ha.CatalinaCluster.send(org.apache.catalina.ha.ClusterMessage)



send
public void send(ClusterMessage msg, Member dest)(Code)
send a cluster message to one member
Parameters:
  msg - message to transfer
Parameters:
  dest - Receiver member
See Also:   org.apache.catalina.ha.CatalinaCluster.send(org.apache.catalina.ha.ClusterMessageorg.apache.catalina.ha.Member)



sendClusterDomain
public void sendClusterDomain(ClusterMessage msg)(Code)
send message to all cluster members same cluster domain
See Also:   org.apache.catalina.ha.CatalinaCluster.send(org.apache.catalina.ha.ClusterMessage)



setChannel
public void setChannel(Channel channel)(Code)



setChannelSendOptions
public void setChannelSendOptions(int channelSendOptions)(Code)



setClusterDeployer
public void setClusterDeployer(org.apache.catalina.ha.ClusterDeployer clusterDeployer)(Code)
set a new Deployer, must be set before cluster started!



setClusterName
public void setClusterName(String clusterName)(Code)
Set the name of the cluster to join, if no cluster with this name is present create one.
Parameters:
  clusterName - The clustername to join



setContainer
public void setContainer(Container container)(Code)
Set the Container associated with our Cluster
Parameters:
  container - The Container to use



setHeartbeatBackgroundEnabled
public void setHeartbeatBackgroundEnabled(boolean heartbeatBackgroundEnabled)(Code)
enabled that container backgroundThread call heartbeat at channel
Parameters:
  heartbeatBackgroundEnabled - the heartbeatBackgroundEnabled to set



setManagerClassName
public void setManagerClassName(String managerClassName)(Code)

Parameters:
  managerClassName - String



setManagerTemplate
public void setManagerTemplate(ClusterManager managerTemplate)(Code)



setNotifyLifecycleListenerOnFailure
public void setNotifyLifecycleListenerOnFailure(boolean notifyListenerOnFailure)(Code)

Parameters:
  notifyListenerOnFailure - The notifyLifecycleListenerOnFailure to set.



setProperty
public void setProperty(String name, String value)(Code)
JMX hack to direct use at jconsole
Parameters:
  name -
Parameters:
  value -



setProperty
public void setProperty(String name, Object value)(Code)
set config attributes with reflect and propagate to all managers
Parameters:
  name -
Parameters:
  value -



setProtocol
public void setProtocol(String protocol)(Code)

See Also:   org.apache.catalina.Cluster.setProtocol(java.lang.String)



start
public void start() throws LifecycleException(Code)
Prepare for the beginning of active use of the public methods of this component. This method should be called after configure(), and before any of the public methods of the component are utilized.
Starts the cluster communication channel, this will connect with the other nodes in the cluster, and request the current session state to be transferred to this node.
exception:
  IllegalStateException - if this component has already been started
exception:
  LifecycleException - if this component detects a fatal error that prevents thiscomponent from being used



stop
public void stop() throws LifecycleException(Code)
Gracefully terminate the active cluster component.
This will disconnect the cluster communication channel, stop the listener and deregister the valves from host or engine.

Note:
The sub elements receiver, sender, membership, listener or valves are not removed. You can easily start the cluster again.
exception:
  IllegalStateException - if this component has not been started
exception:
  LifecycleException - if this component detects a fatal error that needs to bereported



transferProperty
protected void transferProperty(String prefix, Object bean)(Code)
transfer properties from cluster configuration to subelement bean.
Parameters:
  prefix -
Parameters:
  bean -



unregisterClusterValve
protected void unregisterClusterValve() throws Exception(Code)
unregister all cluster valve to host or engine
throws:
  Exception -
throws:
  ClassNotFoundException -



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.