Package org.synchronoss.cpo.core
Class CpoAdapterFactoryManager
java.lang.Object
org.synchronoss.cpo.core.cache.CpoAdapterFactoryCache
org.synchronoss.cpo.core.CpoAdapterFactoryManager
CpoAdapterFactoryManager is the static entry point applications use to obtain CpoAdapter, CpoTrxAdapter, and CpoXaResource instances by named configuration
context. On class initialization (and whenever loadAdapters() is called again) it reads
cpoConfig.xml from the classpath, or the path named by the CPO_CONFIG system
property or environment variable, and builds a CpoAdapterFactory for each declared
dataConfig entry.- Author:
- dberry
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringName of the system property / environment variable that overrides the config file path. -
Method Summary
Modifier and TypeMethodDescriptionstatic CpoAdapterGets theCpoAdapterfor the default configuration context.static CpoAdaptergetCpoAdapter(String context) Gets theCpoAdapterfor the named configuration context.static CpoTrxAdapterGets aCpoTrxAdapterfor the default configuration context.static CpoTrxAdaptergetCpoTrxAdapter(String context) Gets aCpoTrxAdapterfor the named configuration context.static CpoXaResourceGets theCpoXaResourcefor the default configuration context.static CpoXaResourcegetCpoXaAdapter(String context) Gets theCpoXaResourcefor the named configuration context.static voidLoadAdapters is responsible for loading the config file and then subsequently loading all the metadata.static CpoAdapterFactorymakeCpoAdapterFactory(org.synchronoss.cpo.cpoconfig.CtDataSourceConfig dataSourceConfig) Instantiates thedataSourceConfig's configuredCpoConfigProcessorand uses it to build aCpoAdapterFactoryfor that datasource.
-
Field Details
-
CPO_CONFIG
Name of the system property / environment variable that overrides the config file path.- See Also:
-
-
Method Details
-
getCpoAdapter
Gets theCpoAdapterfor the default configuration context.- Returns:
- the default CpoAdapter
- Throws:
CpoException- if the adapter cannot be created
-
getCpoAdapter
Gets theCpoAdapterfor the named configuration context.- Parameters:
context- the name of thedataConfigentry to use, as declared incpoConfig.xml- Returns:
- the CpoAdapter for
context, ornullif no factory is registered for it - Throws:
CpoException- if the adapter cannot be created
-
getCpoTrxAdapter
Gets aCpoTrxAdapterfor the default configuration context.- Returns:
- the default CpoTrxAdapter
- Throws:
CpoException- if the adapter cannot be created
-
getCpoTrxAdapter
Gets aCpoTrxAdapterfor the named configuration context.- Parameters:
context- the name of thedataConfigentry to use, as declared incpoConfig.xml- Returns:
- the CpoTrxAdapter for
context, ornullif no factory is registered for it - Throws:
CpoException- if the adapter cannot be created
-
getCpoXaAdapter
Gets theCpoXaResourcefor the default configuration context.- Returns:
- the default CpoXaResource
- Throws:
CpoException- if the adapter cannot be created
-
getCpoXaAdapter
Gets theCpoXaResourcefor the named configuration context.- Parameters:
context- the name of thedataConfigentry to use, as declared incpoConfig.xml- Returns:
- the CpoXaResource for
context, ornullif no factory is registered for it - Throws:
CpoException- if the adapter cannot be created
-
loadAdapters
public static void loadAdapters()LoadAdapters is responsible for loading the config file and then subsequently loading all the metadata. -
makeCpoAdapterFactory
public static CpoAdapterFactory makeCpoAdapterFactory(org.synchronoss.cpo.cpoconfig.CtDataSourceConfig dataSourceConfig) throws CpoException Instantiates thedataSourceConfig's configuredCpoConfigProcessorand uses it to build aCpoAdapterFactoryfor that datasource.- Parameters:
dataSourceConfig- the datasource configuration to process- Returns:
- the resulting adapter factory
- Throws:
CpoException- if the configured processor class cannot be located, instantiated, or invoked
-