org.as2lib.core.BasicClass +--org.as2lib.io.conn.local.server.LocalServerRegistry
ServerRegistry
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.
public 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.
host | the host that acts as an identifier for the server |
true
if the server with the given host
is regitered else
false
containsServer() in org.as2lib.io.conn.core.server.ServerRegistry
public 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.
host | the host that acts as an identifier for the server |
IllegalArgumentException | if host is null , undefined
or an empty string
|
ReservedHostException | if a server with the passed-in host is already
running
|
registerServer() in org.as2lib.io.conn.core.server.ServerRegistry
public 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.
host | the host that acts as an identifier for the server to remove |
IllegalArgumentException | if you try to unregister a server that has not been registered directly at this registry but at another one |
removeServer() in org.as2lib.io.conn.core.server.ServerRegistry