jegg.impl
Class PortRegistry

java.lang.Object
  extended byjegg.EggBase
      extended byjegg.impl.PortRegistry
All Implemented Interfaces:
Egg

public class PortRegistry
extends EggBase

Author:
Bruce Lowery

Field Summary
static java.lang.String SEPARATOR
          The name separator used to compose the path name of a registry.
 
Method Summary
 PortRegistry createRegistry(java.lang.String name)
          Create a child registry of this registry.
static PortRegistry getInstance()
          Return the default registry.
static PortRegistry getInstance(java.lang.String name)
          Get a named registry.
 Port getPort()
          Return this egg's message port.
 void handle(LocatePortMessage message)
          Handle a lookup request from a client egg.
 void handle(java.lang.Object message)
          The default message handler method.
 void handle(PublishPortMessage message)
          Handle a request to publish a named port in the registry.
 
Methods inherited from class jegg.EggBase
getContext, init, setContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SEPARATOR

public static final java.lang.String SEPARATOR
The name separator used to compose the path name of a registry.

See Also:
Constant Field Values
Method Detail

getInstance

public static final PortRegistry getInstance()
Return the default registry.

Returns:
the default registry.

getInstance

public static final PortRegistry getInstance(java.lang.String name)
Get a named registry. If the named registry doesn't exist, it will be created.

Parameters:
name - the name of the context to find or create.
Returns:
a registry.

getPort

public Port getPort()
Description copied from class: EggBase
Return this egg's message port.

Overrides:
getPort in class EggBase
Returns:
this egg's message port.

handle

public void handle(java.lang.Object message)
Description copied from interface: Egg
The default message handler method. If any message delivered to this egg has a concrete type for which no other handler method on this egg can be found, then the message will be delivered to this handler.

The implementation class should implement additional handler methods, one for each message type that recognizes.

Parameters:
message - a message sent to this egg.

handle

public void handle(LocatePortMessage message)
Handle a lookup request from a client egg.

Parameters:
message - the lookup details.

handle

public void handle(PublishPortMessage message)
Handle a request to publish a named port in the registry.

Parameters:
message - the message containing the details.

createRegistry

public final PortRegistry createRegistry(java.lang.String name)
                                  throws DuplicatePortException
Create a child registry of this registry.

Parameters:
name - the name to assign to the child registry
Returns:
the new child registry.
Throws:
DuplicatePortException - if the name already exists in this context.


Copyright © 2004 . All Rights Reserved.