Access keys

LocalServerRegistry

Kind of class: class
Inherits from: BasicClass
Implements:
Author: Simon Wacker, Christoph Atteneder
Classpath: org.as2lib.io.conn.local.server.LocalServerRegistry
File last modified: Sunday, 17 April 2005, 17:59:34
LocalServerRegistry keeps track of running servers.

This means that servers are registered to be aware of all servers that are
currently running. The servers are registered in a kind of gloabl registry, even
if you instantiate different instances of this class and in different swfs.

Servers are expected to register themselves at this registry when they start
running and unregister themselves when they stop running.

Example:

var serverRegistry:LocalServerRegistry = new LocalServerRegistry();
serverRegistry.registerServer("local.as2lib.org");
serverRegistry.containsServer("local.as2lib.org");
serverRegistry.removeServer("local.as2lib.org");

As you can see in the above example, not servers are registered but hosts,
that represent servers.

Summary

Constructor
Instance methods
Instance methods inherited from BasicClass

Constructor

LocalServerRegistry

function LocalServerRegistry (
Void)
Constructs a new LocalServerRegistry instance.

Instance methods

containsServer

function containsServer (
host:String) : Boolean
Returns whether a server with the passed-in host is registered in some
registry.

This does not mean that the server is registered in this registry. It can be
registered in another registry, even in another swf.

Parameters:
host:
the host that acts as an identifier for the server
Returns:
true if the server with the given host is regitered else
false

registerServer

function registerServer (
host:String) : Void
Registers the server with the given host at this server registry.

The server is registered gloablly, that means that registries in other swfs
can check whether the server is registered.

Parameters:
host:
the host that acts as an identifier for the server
Throws:
org.as2lib.env.except.IllegalArgumentException if host is null, undefined
or an empty string
org.as2lib.io.conn.core.server.ReservedHostException if a server with the passed-in host is already
running

removeServer

function removeServer (
host:String) : Void
Removes the server with the given host from this server registry.

Only servers that have been registered directly at this registry can be removed.

Parameters:
host:
the host that acts as an identifier for the server to remove
Throws:
org.as2lib.env.except.IllegalArgumentException if you try to unregister a server that has not
been registered directly at this registry but at another one