org.apache.ws.resource
Interface ResourceHome

All Superinterfaces:
ResourceCreation, ResourceDestruction
All Known Implementing Classes:
AbstractResourceHome

public interface ResourceHome
extends ResourceCreation, ResourceDestruction

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.
 EndpointReference getEndpointReference(java.lang.String endpointAddress, ResourceKey key, java.lang.String wsAddressingURI)
          Builds an EPR based on the specified endpoint address, resource key, and WS-Addressing namespace URI.
 Resource getInstance(ResourceContext resourceContext)
          Retrieves the Resource instance that is corresponds to the id contained in the specified 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 name of the Service 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)
          Sets the target namespace of the WSDL of this home's service.
 
Methods inherited from interface org.apache.ws.resource.ResourceCreation
addResourceCreationListener, removeResourceCreationListener
 
Methods inherited from interface org.apache.ws.resource.ResourceDestruction
addResourceDestructionListener, removeResourceDestructionListener
 

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 name of the Service class.

Returns:
the name of the Service class

setWsdlTargetNamespace

public void setWsdlTargetNamespace(java.lang.String targetNamespace)
Sets 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 ResourceUnknownException,
                     InvalidResourceKeyException,
                     ResourceException
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
Throws:
ResourceUnknownException - 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,
                   ResourceUnknownException,
                   InvalidResourceKeyException,
                   RemoveNotSupportedException
Removes a resource. If the resource implements the RemoveCallback interface, the implementation must invoke the remove() operation on the resource itself.

Throws:
ResourceUnknownException - 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 ResourceContextException,
                            ResourceUnknownException,
                            ResourceException
Retrieves the Resource instance that is corresponds to the id contained in the specified ResourceContext.

Throws:
ResourceUnknownException - if no resource exists with the given key
InvalidResourceKeyException - if the resource key is invalid.
ResourceException - if any other error occurs.
ResourceContextException

getEndpointReference

public EndpointReference getEndpointReference(java.lang.String endpointAddress,
                                              ResourceKey key,
                                              java.lang.String wsAddressingURI)
Builds an EPR based on the specified endpoint address, resource key, and WS-Addressing namespace URI.

Parameters:
endpointAddress -
key -
wsAddressingURI -
Returns:
An EndpointReference


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