Package org.datanucleus.api
Class ApiAdapterFactory
- java.lang.Object
-
- org.datanucleus.api.ApiAdapterFactory
-
public class ApiAdapterFactory extends java.lang.Object
Factory of API adapters.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static ApiAdapterFactory
adapterFactory
Singleton instance(package private) java.util.Map<java.lang.String,ApiAdapter>
adapters
The adapter instances, mapped by naming string.
-
Constructor Summary
Constructors Modifier Constructor Description protected
ApiAdapterFactory()
Protected constructor to prevent outside instantiation
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
addAdapter(java.lang.String name, ApiAdapter apiAdapter)
Method to add support for an API via an adapter.ApiAdapter
getApiAdapter(java.lang.String name, PluginManager pluginMgr)
Accessor for an adapter, given the api name.static ApiAdapterFactory
getInstance()
Accessor for the ApiAdapterFactory (singleton).
-
-
-
Field Detail
-
adapters
java.util.Map<java.lang.String,ApiAdapter> adapters
The adapter instances, mapped by naming string.
-
adapterFactory
static ApiAdapterFactory adapterFactory
Singleton instance
-
-
Method Detail
-
getInstance
public static ApiAdapterFactory getInstance()
Accessor for the ApiAdapterFactory (singleton).- Returns:
- The manager of type information
-
addAdapter
private void addAdapter(java.lang.String name, ApiAdapter apiAdapter)
Method to add support for an API via an adapter.- Parameters:
name
- name of the APIapiAdapter
- instance of adapter
-
getApiAdapter
public ApiAdapter getApiAdapter(java.lang.String name, PluginManager pluginMgr)
Accessor for an adapter, given the api name. If the API adapter doesn't yet exist will try to initialise it from the plugin information defined under extension-point "org.datanucleus.api_adapter".- Parameters:
name
- the adapter namepluginMgr
- Plugin Manager- Returns:
- The ApiAdapter
- Throws:
NucleusUserException
- when requested API not found in CLASSPATH
-
-