Connection Manager 3.4.2 Javadoc

org.jivesoftware.multiplexer
Class ConnectionManager

java.lang.Object
  extended by org.jivesoftware.multiplexer.ConnectionManager

public class ConnectionManager
extends java.lang.Object

Connection managers handle connections of clients that want to connect to a server. Each connection manager may have one or more connections to the target server. These connections are shared amongst connected clients (i.e. multiplexed) thus reducing the load on the server.

The only properties that needs to be configured during Connection Managers' setup are xmpp.domain and xmpp.password. The xmpp.domain property defines the name of the target server that clients want to connect to. Clients are redirected to a connection manager when trying to open a socket connection to the server. This is typically done by configuring some local DNS server with a SRV record for the server name that points to the connection manager address. More elaborated solutions may include a load balancer in front of several connection managers. Since XMPP connections are state-full and long-lived then the load balancer does not have to be configured with "sticky sessions".

The server and connection managers have to share a common secret so that the server can let connection managers connect to the server and forward packets. Configure the xmpp.password property with the same password to log into the server.

Each connection manager has to have a unique name that uniquely identifies it from other connection managers. Use the property xmpp.manager.name to manually set a name. If this property is not present then a random name will be created for the manager each time it is started. Properties are stored in conf/manager.xml. There are several ways for locating this file.

  1. Set the system property managerHome when starting up the server.
  2. When running in standalone mode attempt to find it in [home]/conf/manager.xml.
  3. Load the path from manager_init.xml which must be in the classpath.
By default connection managers will open five connections to the server. Configure the xmpp.manager.connections property if you want to change the number of connections.

Author:
Gaston Dombiak

Field Summary
protected  java.lang.ClassLoader loader
           
protected  java.lang.String name
          Name of the connection manager.
protected  java.lang.String serverName
          Name of the server to connect.
protected  java.util.Date startDate
           
protected  java.util.Date stopDate
           
protected  Version version
           
 
Constructor Summary
ConnectionManager()
          Creates a server and starts it.
 
Method Summary
 void finishSetup()
          Finish the setup process.
static ConnectionManager getInstance()
          Returns a singleton instance of ConnectionManager.
 java.lang.String getName()
          Returns the name that uniquely identifies this connection manager.
 java.lang.String getServerName()
          Returns the name of the main server where received packets will be forwarded.
 ServerSurrogate getServerSurrogate()
          Returns the service responsible for forwarding stanzas to the server.
protected  void initialize()
           
 boolean isRestartable()
           
 boolean isSetupMode()
           
 boolean isStandAlone()
          Returns if the server is running in standalone mode.
 void restart()
          Restarts the server and all it's modules only if the server is restartable.
 void start()
           
 void stop()
          Stops the server only if running in standalone mode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected java.lang.String name
Name of the connection manager. Each manager MUST have a unique name. The name will be used when connecting to the server.


serverName

protected java.lang.String serverName
Name of the server to connect. This is the server where users actually want to connect.


version

protected Version version

startDate

protected java.util.Date startDate

stopDate

protected java.util.Date stopDate

loader

protected java.lang.ClassLoader loader
Constructor Detail

ConnectionManager

public ConnectionManager()
Creates a server and starts it.

Method Detail

getInstance

public static ConnectionManager getInstance()
Returns a singleton instance of ConnectionManager.

Returns:
an instance.

initialize

protected void initialize()
                   throws java.io.FileNotFoundException
Throws:
java.io.FileNotFoundException

finishSetup

public void finishSetup()
Finish the setup process. Because this method is meant to be called from inside the Admin console plugin, it spawns its own thread to do the work so that the class loader is correct.


start

public void start()

restart

public void restart()
Restarts the server and all it's modules only if the server is restartable. Otherwise do nothing.


stop

public void stop()
Stops the server only if running in standalone mode. Do nothing if the server is running inside of another server.


isSetupMode

public boolean isSetupMode()

isRestartable

public boolean isRestartable()

isStandAlone

public boolean isStandAlone()
Returns if the server is running in standalone mode. We consider that it's running in standalone if the "org.jivesoftware.multiplexer.starter.ServerStarter" class is present in the system.

Returns:
true if the server is running in standalone mode.

getServerSurrogate

public ServerSurrogate getServerSurrogate()
Returns the service responsible for forwarding stanzas to the server.

Returns:
the service responsible for forwarding stanzas to the server.

getServerName

public java.lang.String getServerName()
Returns the name of the main server where received packets will be forwarded.

Returns:
the name of the main server where received packets will be forwarded.

getName

public java.lang.String getName()
Returns the name that uniquely identifies this connection manager. Use the property xmpp.manager.name to manually set a name. If the property is not present then a random name will be created for the manager each time it is started. Properties are stored in conf/manager.xml. There are several ways for locating this file.
  1. Set the system property managerHome when starting up the server.
  2. When running in standalone mode attempt to find it in [home]/conf/manager.xml.
  3. Load the path from manager_init.xml which must be in the classpath.

Returns:
the name that uniquely identifies this connection manager.

Connection Manager 3.4.2 Javadoc

Copyright © 2003-2006 Jive Software.