electric.registry.directory
Class DirectoryRegistry

java.lang.Object
  extended byelectric.registry.directory.DirectoryRegistry
All Implemented Interfaces:
IRegistry, IWSDLConstants

public class DirectoryRegistry
extends java.lang.Object
implements IRegistry, IWSDLConstants

DirectoryRegistry wraps an IDirectory and makes it look like a Registry. Underlying DirectoryExceptions are converted into RegistryExceptions.

Author:
webMethods

Field Summary
 
Fields inherited from interface electric.wsdl.IWSDLConstants
ADDRESS, BINDING, DEFINITIONS, DESCRIPTION, DOCUMENT, DOCUMENTATION, ELEMENT, ENCODED, ENCODING_STYLE, ENDPOINT, FAULT, FAULT_DETAIL, GET, GETPOST, HTTP, INPUT, LITERAL, LOCATION, MESSAGE, METHOD_NAMESPACE, MIME, NAME, NAMESPACE, OPERATION, OUTPUT, PARAMETER_ORDER, PARAMETERS, PART, PORT, PORT_TYPE, POST, RPC, SERVICE, SOAP, SOAP_ACTION, STYLE, TARGET_NAMESPACE, TARGET_NAMESPACE_PREFIX, TNS, TRANSPORT, TYPE, USE, VERB, WSDL_EXTENSION, WSDL_NAMESPACE, WSDL_PREFIX, WSDL_SOAP_NAMESPACE, WSDL_SOAP_PREFIX, WSDL_SOAP11_NAMESPACE, WSDL_SOAP11_PREFIX, WSDL_SOAP12_NAMESPACE, WSDL_SOAP12_PREFIX
 
Constructor Summary
DirectoryRegistry()
          Construct a DirectoryRegistry that wraps an empty instance of Directory.
DirectoryRegistry(IDirectory directory)
          Construct a DirectoryRegistry that wraps the specified directory.
 
Method Summary
 IReference bind(java.lang.String path, java.lang.Class[] interfaces, Context context)
          Return a reference to the object at the specified path.
 java.lang.Object get(java.lang.String path)
          Return the object with the specified path, or null if not found.
 IDirectory getDirectory()
          Return my underlying IDirectory.
 IDirectory getDirectory(java.lang.String path)
          Return the directory with the specified path, or null if not found.
 boolean publish(java.lang.String path, java.lang.Object object, Context context)
          Publish the object to the specified path.
 void setDirectory(java.lang.String path, IDirectory directory)
          If the path is equal to "/", set the underlying top level directory to the specified directory, otherwise set the subdirectory to the specified directory.
 boolean unpublish(java.lang.String path)
          Unpublish the object from the specified path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DirectoryRegistry

public DirectoryRegistry()
Construct a DirectoryRegistry that wraps an empty instance of Directory.


DirectoryRegistry

public DirectoryRegistry(IDirectory directory)
Construct a DirectoryRegistry that wraps the specified directory.

Parameters:
directory - The directory to wrap.
Method Detail

setDirectory

public void setDirectory(java.lang.String path,
                         IDirectory directory)
                  throws DirectoryException
If the path is equal to "/", set the underlying top level directory to the specified directory, otherwise set the subdirectory to the specified directory.

Parameters:
path - The path.
directory - The new directory value.
Throws:
DirectoryException - If the underlying directory throws an exception.

getDirectory

public IDirectory getDirectory()
Return my underlying IDirectory.


getDirectory

public IDirectory getDirectory(java.lang.String path)
                        throws DirectoryException
Return the directory with the specified path, or null if not found.

Parameters:
path - The path.
Throws:
DirectoryException - If the underlying directory throws an exception.

get

public java.lang.Object get(java.lang.String path)
                     throws RegistryException
Return the object with the specified path, or null if not found. If the path is not a local path, immediately return null;

Parameters:
path - The path.
Throws:
RegistryException - If the underlying directory throws an exception.

bind

public IReference bind(java.lang.String path,
                       java.lang.Class[] interfaces,
                       Context context)
                throws RegistryException
Return a reference to the object at the specified path. If the path is not a local path, immediately return null.

Specified by:
bind in interface IRegistry
Parameters:
path - The path.
interfaces - The interfaces.
context - The context
Returns:
A reference to the service.
Throws:
RegistryException

publish

public boolean publish(java.lang.String path,
                       java.lang.Object object,
                       Context context)
                throws RegistryException
Publish the object to the specified path. If the path is not a local path, immediately return false.

Specified by:
publish in interface IRegistry
Parameters:
path -
object -
context - The context, ignored.
Returns:
True if the object was published.
Throws:
RegistryException

unpublish

public boolean unpublish(java.lang.String path)
                  throws RegistryException
Unpublish the object from the specified path. If the path is not a local path, immediately return false.

Specified by:
unpublish in interface IRegistry
Parameters:
path -
Returns:
True if the object was unpublished.
Throws:
RegistryException


copyright© 2001-2004 by webMethods All Rights Reserved.