org.kuali.rice.krad.data.provider.impl
Class ProviderRegistryImpl

java.lang.Object
  extended by org.kuali.rice.krad.data.provider.impl.ProviderRegistryImpl
All Implemented Interfaces:
ProviderRegistry

public class ProviderRegistryImpl
extends Object
implements ProviderRegistry

Defines a basic ProviderRegistry implementation.

Author:
Kuali Rice Team (rice.collab@kuali.org)

Constructor Summary
ProviderRegistryImpl()
           
 
Method Summary
protected  Iterable<Class<? extends Provider>> enumerateProviderInterfaces(Provider provider)
          Enumerates all Provider-derived interfaces in the type hierarchy of the specified Provider class.
 MetadataProvider getMetadataProvider(Class<?> type)
          Obtain the first MetadataProvider which handles the gives type.
 List<MetadataProvider> getMetadataProviders()
          Obtain list of all registered MetadataProviders
 PersistenceProvider getPersistenceProvider(Class<?> type)
          Return the persistence provider for a given type.
 List<Provider> getProviders()
          Obtain list of all registered providers.
 List<Provider> getProvidersForType(Class<? extends Provider> providerType)
          Obtain list of all registered providers of a given type.
protected  boolean hasDataObjectServiceMethod(Provider provider, String methodName, Class[] args)
          Determines if the given Provider has the given method.
 void registerProvider(Provider provider)
          Register a Provider.
 boolean unregisterProvider(Provider provider)
          Unregister a Provider if it exists.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProviderRegistryImpl

public ProviderRegistryImpl()
Method Detail

enumerateProviderInterfaces

protected Iterable<Class<? extends Provider>> enumerateProviderInterfaces(Provider provider)
Enumerates all Provider-derived interfaces in the type hierarchy of the specified Provider class.

Parameters:
provider - the Provider class to inspect.
Returns:
all Provider-derived interfaces implemented by the Provider.

registerProvider

public void registerProvider(Provider provider)
Register a Provider.

Specified by:
registerProvider in interface ProviderRegistry
Parameters:
provider - the provider to register

unregisterProvider

public boolean unregisterProvider(Provider provider)
Unregister a Provider if it exists.

Specified by:
unregisterProvider in interface ProviderRegistry
Parameters:
provider - the provider to unregister
Returns:
true if provider was unregistered

getProviders

public List<Provider> getProviders()
Obtain list of all registered providers.

Specified by:
getProviders in interface ProviderRegistry
Returns:
non-null and immutable list of all registered providers

getProvidersForType

public List<Provider> getProvidersForType(Class<? extends Provider> providerType)
Obtain list of all registered providers of a given type.

Specified by:
getProvidersForType in interface ProviderRegistry
Parameters:
providerType - the provider type
Returns:
non-null and immutable list of all registered providers of a given type

getMetadataProviders

public List<MetadataProvider> getMetadataProviders()
Obtain list of all registered MetadataProviders

Specified by:
getMetadataProviders in interface ProviderRegistry
Returns:
non-null and immutable list of all registered MetadataProviders

getPersistenceProvider

public PersistenceProvider getPersistenceProvider(Class<?> type)
Return the persistence provider for a given type.

Specified by:
getPersistenceProvider in interface ProviderRegistry
Parameters:
type - the data object type
Returns:
persistence provider for given type, or null if no matching provider is registered

getMetadataProvider

public MetadataProvider getMetadataProvider(Class<?> type)
Obtain the first MetadataProvider which handles the gives type.

Specified by:
getMetadataProvider in interface ProviderRegistry
Returns:
the MetadataProvider which handles the given type, or null if none could be found

hasDataObjectServiceMethod

protected boolean hasDataObjectServiceMethod(Provider provider,
                                             String methodName,
                                             Class[] args)
Determines if the given Provider has the given method.

Parameters:
provider - the Provider to check.
methodName - the method name to check for.
args - the arguments for the method.
Returns:
TRUE if the Provider has the given method name, FALSE otherwise.


Copyright © 2005–2014 The Kuali Foundation. All rights reserved.