org.apache.ws.resource
Interface ResourceHome

All Known Implementing Classes:
AbstractResourceHome

public interface ResourceHome

Defines a basic interface through which resources are discovered, and removed. The purpose of ResourceHome is to interact with a collection of resources of the same type. Each resource type will have its own custom implementation the ResourceHome interface. The implementation is expected to provide custom methods for creating new resources and optionally methods that act on a set of resource objects.


Method Summary
 Resource find(ResourceKey key)
          Retrives a resource.
 Resource getInstance(ResourceContext resourceContext)
           
 java.lang.String getResourceClassName()
          Returns the Class of the Resource Impl.
 java.lang.String getResourceKeyClassName()
          The resource key type.
 java.lang.String getResourceKeyName()
          The name of the resource key.
 java.lang.String getServiceClassName()
          Returns the Service Impl's .Class
 java.lang.String getWsdlTargetNamespace()
          Returns the Target Namespace of the WSDL
 void remove(ResourceKey key)
          Removes a resource.
 void setResourceClassName(java.lang.String className)
          Sets the classname of the Resource Impl.
 void setResourceKeyClassName(java.lang.String className)
          Sets the Class of the ResourceKey Impl
 void setResourceKeyName(java.lang.String keyName)
          Sets the ResourceKey QName as a String value.
 void setServiceClassName(java.lang.String className)
          Sets the Service Impl's .Class
 void setWsdlTargetNamespace(java.lang.String targetNamespace)
          Set the target namespace of the wsdl of this home's service
 

Method Detail

getResourceKeyClassName

public java.lang.String getResourceKeyClassName()
The resource key type. The ResourceKey used or passed to this ResourceHome must have match this type (corresponds to ResourceKey.getValue()).

Returns:
the type of the key.

getResourceKeyName

public java.lang.String getResourceKeyName()
The name of the resource key. The ResourceKey used or passed to this ResourceHome must have match this name (corresponds to ResourceKey.getName()).

Returns:
the name of the key.

setResourceClassName

public void setResourceClassName(java.lang.String className)
Sets the classname of the Resource Impl.

Parameters:
className - The class name of the Resource Impl.

getResourceClassName

public java.lang.String getResourceClassName()
Returns the Class of the Resource Impl.

Returns:
The Class of the Resource Impl

setResourceKeyClassName

public void setResourceKeyClassName(java.lang.String className)
Sets the Class of the ResourceKey Impl

Parameters:
className - The class name of the ResourceKey impl

setResourceKeyName

public void setResourceKeyName(java.lang.String keyName)
Sets the ResourceKey QName as a String value. (i.e. QName.toString()... i.e. {http://...}ResourceId

Parameters:
keyName - The QName.toString() representation of the ResourceKey

setServiceClassName

public void setServiceClassName(java.lang.String className)
Sets the Service Impl's .Class

Parameters:
className - String representation of the class

getServiceClassName

public java.lang.String getServiceClassName()
Returns the Service Impl's .Class

Returns:
Class of the Service Impl.

setWsdlTargetNamespace

public void setWsdlTargetNamespace(java.lang.String targetNamespace)
Set the target namespace of the wsdl of this home's service

Parameters:
targetNamespace -

getWsdlTargetNamespace

public java.lang.String getWsdlTargetNamespace()
Returns the Target Namespace of the WSDL

Returns:
The String of the targetnamespace

find

public Resource find(ResourceKey key)
              throws ResourceException,
                     NoSuchResourceException,
                     InvalidResourceKeyException
Retrives a resource. Note: This function must not return null. It must return the resource object or throw an exception if there is no resource with the specified key.

Returns:
non-null resource object.
Throws:
NoSuchResourceException - if no resource exists with the given key
InvalidResourceKeyException - if the resource key is invalid.
ResourceException - if any other error occurs.

remove

public void remove(ResourceKey key)
            throws ResourceException,
                   NoSuchResourceException,
                   InvalidResourceKeyException,
                   RemoveNotSupportedException
Removes a resource. If the resource implements the RemoveCallback interface, the implementation must invoke the remove() operation on the resource itself.

Throws:
NoSuchResourceException - if no resource exists with the given key
InvalidResourceKeyException - if the resource key is invalid.
RemoveNotSupportedException - if remove operation is not supported.
ResourceException - if any other error occurs.

getInstance

public Resource getInstance(ResourceContext resourceContext)
                     throws ResourceException,
                            ResourceContextException,
                            ResourceUnknownException
Throws:
ResourceException
ResourceContextException
ResourceUnknownException


Copyright © 2004-2005 Apache Software Foundation. All Rights Reserved.