Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.2.0)

E17493-03


oracle.javatools.db
Class DBObjectProviderFactory

java.lang.Object
  extended by oracle.javatools.db.DBObjectProviderFactory


public final class DBObjectProviderFactory
extends java.lang.Object

Factory class for creating DBObjectProviders. The providers are cached by an identifier which must be unique per provider. Different provider implementations will use different keys. For example the the Database support (always available) uses a String (Database.getQualifiedName()) as the identifier while the offline database (when available) will use its URL.

Since:
10.1.3

Nested Class Summary
static class DBObjectProviderFactory.Creator
          Factory creator class used to create provider instances when there isn't one already in the cache.
static interface DBObjectProviderFactory.Listener
          Listener interface that can be registered against this factory to be notified of provider create and uncache events.

 

Method Summary
static
<T extends DBObjectProviderFactory.Creator>
T
findFactory(java.lang.Class<T> clz)
          Deprecated. use getCreator(String) instead as it doesn't load classes.
static DBObjectProvider findOrCreateProvider(java.lang.Object identifier)
          Deprecated. use findOrCreateProvider(String,Object)
static DBObjectProvider findOrCreateProvider(java.lang.String providerType, java.lang.Object identifier)
          Finds or creates a provider with the given type and identifier.
static DBObjectProvider findProvider(java.lang.Object identifier)
          Deprecated. use findProvider(String,Object)
static DBObjectProvider findProvider(java.lang.String providerType, java.lang.Object identifier)
          Finds a provider using the given identifier key.
static DBObjectProviderFactory.Creator getCreator(java.lang.String providerType)
          Internal use only.
static java.lang.String getDescription(java.lang.String type, java.lang.Object identifier)
          Gets a displayable string to represent the provider with the given identifier.
static java.lang.Class<? extends DBObjectProvider> loadProviderClass(java.lang.String clzName)
          Loads the given provider class using the class name.
static void registerFactory(DBObjectProviderFactory.Creator factory)
          Register the given Creator to be available for creating providers.
static void registerListener(DBObjectProviderFactory.Listener l)
          Registers a listener to be notified of any providers being created or removed from the cache.
static DBObjectProvider uncacheProvider(java.lang.Object identifier)
           
static DBObjectProvider uncacheProvider(java.lang.String providerType, java.lang.Object identifier)
           
static void unregisterFactory(DBObjectProviderFactory.Creator factory)
          Unregisters the given Creator.
static void unregisterListener(DBObjectProviderFactory.Listener l)
          Unregister the specified listener.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Method Detail

registerListener

public static void registerListener(DBObjectProviderFactory.Listener l)
Registers a listener to be notified of any providers being created or removed from the cache.
Parameters:
l -

unregisterListener

public static void unregisterListener(DBObjectProviderFactory.Listener l)
Unregister the specified listener. If the collection of registered listeners contains the specified listen, it is removed.

registerFactory

public static void registerFactory(DBObjectProviderFactory.Creator factory)
Register the given Creator to be available for creating providers. The Creator must implement getProviderType() to return a non-null, unique String that identifies the type of provider it creates.

unregisterFactory

public static void unregisterFactory(DBObjectProviderFactory.Creator factory)
Unregisters the given Creator. The Creator instance must be the same as that registered using registerFactory.

findFactory

@Deprecated
public static <T extends DBObjectProviderFactory.Creator> T findFactory(java.lang.Class<T> clz)
Deprecated. use getCreator(String) instead as it doesn't load classes.
Finds a registered factory.

findProvider

@Deprecated
public static DBObjectProvider findProvider(java.lang.Object identifier)
Deprecated. use findProvider(String,Object)

findProvider

public static DBObjectProvider findProvider(java.lang.String providerType,
                                            java.lang.Object identifier)
Finds a provider using the given identifier key. Only works for providers that can be cached. Databases created without a connection name cannot be cached.
Parameters:
providerType - the type of provider to find
identifier - the identifier for the provider - e.g. connection name or offline database url
See Also:
Database.PROVIDER_TYPE

findOrCreateProvider

@Deprecated
public static DBObjectProvider findOrCreateProvider(java.lang.Object identifier)
                                             throws DBException
Deprecated. use findOrCreateProvider(String,Object)
Throws:
DBException

findOrCreateProvider

public static DBObjectProvider findOrCreateProvider(java.lang.String providerType,
                                                    java.lang.Object identifier)
                                             throws DBException
Finds or creates a provider with the given type and identifier.
Parameters:
providerType - the type of provider to find - e.g. Database.PROVIDER_TYPE or OfflineDBObjectProvider.PROVIDER_TYPE.
identifier - the identifier for the provider - e.g. connection name or offline database url
Throws:
DBException
See Also:
Database.PROVIDER_TYPE

getCreator

public static final DBObjectProviderFactory.Creator getCreator(java.lang.String providerType)
Internal use only. Gets the registered Creator for the given provider type.

uncacheProvider

public static final DBObjectProvider uncacheProvider(java.lang.Object identifier)

uncacheProvider

public static final DBObjectProvider uncacheProvider(java.lang.String providerType,
                                                     java.lang.Object identifier)

getDescription

public static java.lang.String getDescription(java.lang.String type,
                                              java.lang.Object identifier)
Gets a displayable string to represent the provider with the given identifier. The string can contain a description of the type as well, for example "database hr" or "offline database DATABASE1"

loadProviderClass

public static final java.lang.Class<? extends DBObjectProvider> loadProviderClass(java.lang.String clzName)
                                                                           throws java.lang.ClassNotFoundException
Loads the given provider class using the class name. This is preferable to using Class.forName( clzName ) because the given provider class may not be on the classpath of the api (e.g. in osgi mode).
Parameters:
clzName - the name of the provider class to load
Returns:
the loaded provider class
Throws:
java.lang.ClassNotFoundException - if the class cannot be found on any of the available classpaths.

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.2.0)

E17493-03


Copyright © 1997, 2012, Oracle. All rights reserved.