Cluster (Tomcat API Documentation)
Keywords: org.apache.catalina.Cluster interface

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.catalina
Interface Cluster

All Known Subinterfaces:
  CatalinaCluster

All Known Implementing Classes:
  SimpleTcpCluster

public interface Cluster

A Cluster works as a Cluster client/server for the local host Different Cluster implementations can be used to support different ways to communicate within the Cluster. A Cluster implementation is responsible for setting up a way to communicate within the Cluster and also supply "ClientApplications" with `ClusterSender` used when sending information in the Cluster and `ClusterInfo` used for receiving information in the Cluster.

Version:
  $Id: Cluster.java 939531 2010-04-30 00:54:41Z kkolinko $
Author:
  Bip Thelin, Remy Maucherat, Filip Hanik

Method Summary
`void` | `backgroundProcess()` Execute a periodic task, such as reloading, etc.
`Manager` | `createManager(java.lang.String name)` Create a new manager which will use this cluster to replicate its sessions.
`java.lang.String` | `getClusterName()` Return the name of the cluster that this Server is currently configured to operate within.
`Container` | `getContainer()` Get the Container associated with our Cluster
`java.lang.String` | `getInfo()` Return descriptive information about this Cluster implementation and the corresponding version number, in the format `<description>/<version>`.
`java.lang.String` | `getProtocol()` Deprecated.
`void` | `installContext(java.lang.String contextPath, java.net.URL war)` Deprecated.
`void` | `setClusterName(java.lang.String clusterName)` Set the name of the cluster to join, if no cluster with this name is present create one.
`void` | `setContainer(Container container)` Set the Container associated with our Cluster
`void` | `setProtocol(java.lang.String protocol)` Deprecated.
`void` | `startContext(java.lang.String contextPath)` Deprecated.
`void` | `stop(java.lang.String contextPath)` Deprecated.

Method Detail

### getInfo

    public java.lang.String getInfo()

  Return descriptive information about this Cluster implementation and the corresponding version number, in the format `<description>/<version>`.

### getClusterName

    public java.lang.String getClusterName()

  Return the name of the cluster that this Server is currently configured to operate within.

  Returns:
    The name of the cluster associated with this server

### setClusterName

    public void setClusterName(java.lang.String clusterName)

  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)

  Set the Container associated with our Cluster

  Parameters:
    `container` - The Container to use

### getContainer

    public Container getContainer()

  Get the Container associated with our Cluster

  Returns:
    The Container associated with our Cluster

### setProtocol

    public void setProtocol(java.lang.String protocol)

  Deprecated.

  Set the protocol parameters.

  Parameters:
    `protocol` - The protocol used by the cluster

### getProtocol

    public java.lang.String getProtocol()

  Deprecated.

  Get the protocol used by the cluster.

  Returns:
    The protocol

### createManager

    public Manager createManager(java.lang.String name)

  Create a new manager which will use this cluster to replicate its sessions.

  Parameters:
    `name` - Name (key) of the application with which the manager is associated

### backgroundProcess

    public void backgroundProcess()

  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.

### startContext

    public void startContext(java.lang.String contextPath)
                      throws java.io.IOException

  Deprecated.

  Start an existing web application, attached to the specified context path in all the other nodes in the cluster. Only starts a web application if it is not running.

  Parameters:
    `contextPath` - The context path of the application to be started
  Throws:
    `java.lang.IllegalArgumentException` - if the specified context path is malformed (it must be "" or start with a slash)
    `java.lang.IllegalArgumentException` - if the specified context path does not identify a currently installed web application
    `java.io.IOException` - if an input/output error occurs during startup

### installContext

    public void installContext(java.lang.String contextPath,
                               java.net.URL war)

  Deprecated.

  Install a new web application, whose web application archive is at the specified URL, into this container with the specified context path. A context path of "" (the empty string) should be used for the root application for this container. Otherwise, the context path must start with a slash.

  If this application is successfully installed, a ContainerEvent of type `PRE_INSTALL_EVENT` will be sent to registered listeners before the associated Context is started, and a ContainerEvent of type `INSTALL_EVENT` will be sent to all registered listeners after the associated Context is started, with the newly created `Context` as an argument.

  Parameters:
    `contextPath` - The context path to which this application should be installed (must be unique)
    `war` - A URL of type "jar:" that points to a WAR file, or type "file:" that points to an unpacked directory structure containing the web application to be installed
  Throws:
    `java.lang.IllegalArgumentException` - if the specified context path is malformed (it must be "" or start with a slash)
    `java.lang.IllegalStateException` - if the specified context path is already attached to an existing web application

### stop

    public void stop(java.lang.String contextPath)
              throws java.io.IOException

  Deprecated.

  Stop an existing web application, attached to the specified context path. Only stops a web application if it is running.

  Parameters:
    `contextPath` - The context path of the application to be stopped
  Throws:
    `java.lang.IllegalArgumentException` - if the specified context path is malformed (it must be "" or start with a slash)
    `java.lang.IllegalArgumentException` - if the specified context path does not identify a currently installed web application
    `java.io.IOException` - if an input/output error occurs while stopping the web application

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.