Skip navigation links

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

E17493-04


oracle.javatools.db
Class DBCore

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


public class DBCore
extends java.lang.Object

The DBCore serves two purposes:

  1. Allows registration of classes and implemetations from downstream extensions with the api.
  2. Provides a single point through which our singletons are registered
Since:
11
For internal use only. Application developers should not use this

Method Summary
<T> T
get(java.lang.Class<T> clz)
          Retrieves a singleton instance that has been registered.
 java.util.Map<java.lang.String,Thunk> getFactoryMap(java.lang.Class clz)
           
static java.lang.ClassLoader getImplClassLoader()
          Internal use only.
static DBCore getInstance()
          The one singleton pattern that the API should have.
<T> T
getRegisteredFactory(java.lang.Class<T> clz, java.lang.String identifier)
          If a given factory class has had a Map of implmenetation classes registered with the core, then this method looks up the implementation class registered against the given identifier.
<T> void
populateFactoryList(java.lang.Class<T> clz, java.util.List<T> list)
          Adds all the registered factories for the given factory class to the given list.
<T> void
populateFactoryList(java.lang.Class<T> clz, java.util.List<T> list, java.lang.Iterable<? extends Thunk> thunks)
           
 void put(java.lang.Object obj)
          Registers a singleton instance.
<T> void
registerFactoryList(java.lang.Class clz, java.util.List<? extends Thunk> list)
          Registers an Iterable of classes that can be looked up by the API.
<T> void
registerFactoryMap(java.lang.Class clz, java.util.Map<java.lang.String,Thunk> map)
          Registers an Map of classes that can be looked up by the API.
<T> T
remove(java.lang.Class<T> clz)
           
static void setImplClassLoader(java.lang.ClassLoader cl)
          Internal use only.

 

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

 

Method Detail

getInstance

public static DBCore getInstance()
The one singleton pattern that the API should have.

setImplClassLoader

public static void setImplClassLoader(java.lang.ClassLoader cl)
Internal use only. Marks the api core as having been initialized already. Used in the product as the core adding in oracle.ide.db sets up the core manually (as db-api-impl isn't accessible from here in osgi).
For internal use only. Application developers should not use this

getImplClassLoader

public static java.lang.ClassLoader getImplClassLoader()
Internal use only. Gets the classloader to use to access db-api-impl classes.
For internal use only. Application developers should not use this

registerFactoryList

public <T> void registerFactoryList(java.lang.Class clz,
                                    java.util.List<? extends Thunk> list)
Registers an Iterable of classes that can be looked up by the API. For example an Iterable of DatabaseFactory.ConnectionCreator implementations could be registered here, and the DBObjectProviderFactory could retrieve the list and include those creators next time a creator is looked up. It allows for the lazy registration of listeners and factory classes in the API.
Parameters:
clz - the factory or listener class
pop - an iterable of factory/listener implementations (the implementation classes should be lazy loaded on the call to get() on each Thunk ).

registerFactoryMap

public <T> void registerFactoryMap(java.lang.Class clz,
                                   java.util.Map<java.lang.String,Thunk> map)
Registers an Map of classes that can be looked up by the API. For example an Map of DBObjectProviderFactory.Creator implementations mapped against their providerType could be registered here, and the DBObjectProviderFactory could retrieve the Creator for a given provider type when it is requested. It allows for the lazy registration of listeners and factory classes in the API.
Parameters:
clz - the factory or listener class
map - a map of identifiers to Thunks - the Thunks get method should return a Class, and the class only loaded on the first call to get().
See Also:
getRegisteredFactory(Class,String)

getFactoryMap

public java.util.Map<java.lang.String,Thunk> getFactoryMap(java.lang.Class clz)

getRegisteredFactory

public <T> T getRegisteredFactory(java.lang.Class<T> clz,
                                  java.lang.String identifier)
If a given factory class has had a Map of implmenetation classes registered with the core, then this method looks up the implementation class registered against the given identifier.
Parameters:
clz - the interface we expect the implementation to implement
identifier - the identifier that implementations are key'd by
Returns:
an implementation class, loaded and initialized, if a map is registered for the given clz and identifier, else null.

populateFactoryList

public <T> void populateFactoryList(java.lang.Class<T> clz,
                                    java.util.List<T> list)
Adds all the registered factories for the given factory class to the given list.

populateFactoryList

public <T> void populateFactoryList(java.lang.Class<T> clz,
                                    java.util.List<T> list,
                                    java.lang.Iterable<? extends Thunk> thunks)

put

public void put(java.lang.Object obj)
Registers a singleton instance. It is retrieved from the core by calling get with its class.

get

public <T> T get(java.lang.Class<T> clz)
Retrieves a singleton instance that has been registered.
Parameters:
clz - the class of object we're looking for
Returns:
a singleton instance of that class that has already been registered, could be null.

remove

public <T> T remove(java.lang.Class<T> clz)

Skip navigation links

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

E17493-04


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