com.evermind.server.deployment
Class ContextScanningResourceProvider

java.lang.Object
  extended by com.evermind.server.deployment.ContextScanningResourceProvider
All Implemented Interfaces:
ResourceProvider

public class ContextScanningResourceProvider
extends java.lang.Object
implements ResourceProvider

A ResourceProvider implementation that acts on a generic JNDI namespace, useful for providers who supply a namespace access mechanism. The properties are those of the namespace, save two special properties:
resource.names - An optional comma separated list of resource locations (JNDI names) that are to be exposed. Useful if the context doesnt support browsing (.list(...)).
resource.types - An optional comma separated list of resource types that are to be handled, useful if you dont want to use all the resources from the provider (for instance if hooking up to a foreign app-server's namespace and just wanting to use the JMS resources, ie ignoring DataSources).


Constructor Summary
ContextScanningResourceProvider()
           
 
Method Summary
 ResourceInfo getDefaultResource(java.lang.String type)
          Get the default identifier for a specific resource type if any instance is provided of that type through this provider.
 java.lang.String getDescription()
          Returns a description of the provider or null if not specified.
 java.lang.String getDisplayName()
          Returns the display-friendly name of the provider.
 java.util.Set getHandledTypes()
          Returns a Set of handled resource types, or null if not specified (in which case the assumption is that all are handled).
 java.lang.String getName()
          Gets the name of this provider instance.
 EnvironmentPropertyDescription[] getPropertyDescriptions()
          Returns a list of valid properties for this provider or null if not specified.
 java.lang.Object getResource(java.lang.String name)
          Returns the actual resource for this name.
 java.util.Set getResources(java.lang.String type)
          Returns a Set of all available resources of this type in this provider.
 void init(java.util.Map properties)
          Initializes the provider with the specified properties, the Map contains the property names as keys and property values as values.
 void setName(java.lang.String name)
          Sets the name of this provider instance.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContextScanningResourceProvider

public ContextScanningResourceProvider()
Method Detail

getPropertyDescriptions

public EnvironmentPropertyDescription[] getPropertyDescriptions()
Description copied from interface: ResourceProvider
Returns a list of valid properties for this provider or null if not specified.

Specified by:
getPropertyDescriptions in interface ResourceProvider

init

public void init(java.util.Map properties)
          throws java.lang.InstantiationException
Description copied from interface: ResourceProvider
Initializes the provider with the specified properties, the Map contains the property names as keys and property values as values.

Specified by:
init in interface ResourceProvider
Throws:
java.lang.InstantiationException

getDisplayName

public java.lang.String getDisplayName()
Description copied from interface: ResourceProvider
Returns the display-friendly name of the provider.

Specified by:
getDisplayName in interface ResourceProvider

getDescription

public java.lang.String getDescription()
Description copied from interface: ResourceProvider
Returns a description of the provider or null if not specified.

Specified by:
getDescription in interface ResourceProvider

getName

public java.lang.String getName()
Description copied from interface: ResourceProvider
Gets the name of this provider instance.

Specified by:
getName in interface ResourceProvider

setName

public void setName(java.lang.String name)
Description copied from interface: ResourceProvider
Sets the name of this provider instance.

Specified by:
setName in interface ResourceProvider

getHandledTypes

public java.util.Set getHandledTypes()
Description copied from interface: ResourceProvider
Returns a Set of handled resource types, or null if not specified (in which case the assumption is that all are handled).

Specified by:
getHandledTypes in interface ResourceProvider

getDefaultResource

public ResourceInfo getDefaultResource(java.lang.String type)
Description copied from interface: ResourceProvider
Get the default identifier for a specific resource type if any instance is provided of that type through this provider.

Specified by:
getDefaultResource in interface ResourceProvider

getResources

public java.util.Set getResources(java.lang.String type)
Description copied from interface: ResourceProvider
Returns a Set of all available resources of this type in this provider. The Set elements are instances of the ResourceInfo class.

Specified by:
getResources in interface ResourceProvider

getResource

public java.lang.Object getResource(java.lang.String name)
                             throws java.lang.InstantiationException
Description copied from interface: ResourceProvider
Returns the actual resource for this name.

Specified by:
getResource in interface ResourceProvider
Throws:
java.lang.InstantiationException