public class JDBCConfigurationFactory
extends com.streamscape.sef.dispatcher.AbstractRuntimeFactory
Title: Service Event Fabric Runtime
Description: A JDBC Configuration Factory
provides an interface for working with
JDBC Factory Objects
.
JDBC factories are managed objects that contain information required to instantiate JDBC compliant
database connections within the Fabric Runtime. This factory will not function without a properly
initialized RuntimeContext
. It allows users to create default or empty configuration
object so that they may be programmatically populated, and to load or save such configuration objects using the
persistence mechanism that is configured with the Runtime Context
.
Copyright: Copyright (c) 2010
Company: StreamScape Technologies
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CONFIG_EXISTS |
static java.lang.String |
DEFAULT_CONNECTION_FACTORY |
static java.lang.String |
PROTOTYPE |
static java.lang.String |
SHOW_CONNECTION_PANEL |
DEFAULT_SERIAL_VERSION_ID
Constructor and Description |
---|
JDBCConfigurationFactory(com.streamscape.repository.RepositoryContext repositoryContext) |
Modifier and Type | Method and Description |
---|---|
static DatabaseConnection |
createConnection(java.lang.String factoryType,
java.lang.String factoryName)
Creates a database connection using the default name and credentials.
|
static DatabaseConnection |
createConnection(java.lang.String factoryType,
java.lang.String factoryName,
java.lang.String connectionName,
java.lang.String userName,
java.lang.String password)
Creates a database connection using the specified name and credentials.
|
static JDBCFactory |
createDefaultFactory(FabricComponent component,
java.lang.String factoryType,
java.lang.String className,
java.lang.String url)
Create a factory default.
|
static JDBCFactory |
createFactory(FabricComponent component,
java.lang.String factoryName,
java.lang.String factoryType,
java.lang.String className,
java.lang.String url,
boolean isTransient)
Creates a new default
JDBCFactory object and loads its driver. |
static JDBCFactory |
createFactory(FabricComponent component,
java.lang.String factoryName,
java.lang.String factoryType,
java.lang.String className,
java.lang.String url,
boolean isTransient,
boolean withDriverLoad)
Creates a new default
JDBCFactory object. |
static boolean |
existsJDBCFactory(java.lang.String factoryName,
java.lang.String factoryType)
Returns
true if this JDBC factory exists. |
static JDBCFactory |
getJDBCFactory(FabricComponent component,
java.lang.String factoryName,
java.lang.String factoryType)
Loads factory objects and the related package.
|
static JDBCFactory |
loadFactoryObject(FabricComponent component,
java.lang.String factoryName,
java.lang.String factoryType,
boolean isTransient)
Loads the JDBC factory from persistence.
|
static JDBCFactory |
loadFactoryObject(FabricComponent component,
java.lang.String workingDir,
java.lang.String factoryName,
java.lang.String factoryType,
boolean isTransient)
Loads a factory object from a specified working directory.
|
static JDBCFactory |
loadJDBCFactory(FabricComponent component,
JDBCFactoryPropertyValue scoParameterValue)
Loads an object specified by a
Service Configuration Property of type JDBC_FACTORY
from the underlying configuration store. |
static void |
removeFactoryObject(java.lang.String factoryName,
java.lang.String factoryType)
Removes a JDBC factory from the underlying configuration persistence store.
|
static void |
saveFactoryObject(JDBCFactory dfo)
Saves the
JDBC Factory object into the Runtime's persistence store. |
static void |
saveFactoryObject(java.lang.String workingDir,
JDBCFactory dfo)
Saves the factory object to a specified working directory.
|
getContextType, hasContext
clone, getSerialVersionUID
public static final java.lang.String PROTOTYPE
public static final java.lang.String SHOW_CONNECTION_PANEL
public static final java.lang.String DEFAULT_CONNECTION_FACTORY
public static final java.lang.String CONFIG_EXISTS
public JDBCConfigurationFactory(com.streamscape.repository.RepositoryContext repositoryContext)
public static JDBCFactory createFactory(FabricComponent component, java.lang.String factoryName, java.lang.String factoryType, java.lang.String className, java.lang.String url, boolean isTransient) throws JDBCConfigurationException, RuntimeContextException
JDBCFactory
object and loads its driver.factoryName
- StringfactoryType
- StringclassName
- Stringurl
- StringisTransient
- booleanJDBCFactoryConfigurationException
RuntimeContextException
JDBCConfigurationException
public static JDBCFactory createFactory(FabricComponent component, java.lang.String factoryName, java.lang.String factoryType, java.lang.String className, java.lang.String url, boolean isTransient, boolean withDriverLoad) throws JDBCConfigurationException, RuntimeContextException
JDBCFactory
object.factoryName
- StringfactoryType
- StringclassName
- Stringurl
- StringisTransient
- booleanwithDriverLoad
- booleanJDBCFactoryConfigurationException
RuntimeContextException
JDBCConfigurationException
public static JDBCFactory createDefaultFactory(FabricComponent component, java.lang.String factoryType, java.lang.String className, java.lang.String url) throws JDBCConfigurationException, RuntimeContextException
Connection Factory
type.component
- FabricComponentfactoryType
- StringclassName
- Stringurl
- StringJDBCConfigurationException
RuntimeContextException
public static void saveFactoryObject(JDBCFactory dfo) throws JDBCConfigurationException, RuntimeContextException
JDBC Factory
object into the Runtime's persistence store.dfo
- JDBCFactoryJDBCFactoryConfigurationException
RuntimeContextException
JDBCConfigurationException
public static void saveFactoryObject(java.lang.String workingDir, JDBCFactory dfo) throws JDBCConfigurationException, RuntimeContextException
workingDir
- Stringdfo
- JDBCFactoryJDBCConfigurationException
RuntimeContextException
public static JDBCFactory loadFactoryObject(FabricComponent component, java.lang.String workingDir, java.lang.String factoryName, java.lang.String factoryType, boolean isTransient) throws JDBCConfigurationException, RuntimeContextException
component
- FabricComponentworkingDir
- StringfactoryName
- StringfactoryType
- StringisTransient
- booleanJDBCConfigurationException
RuntimeContextException
public static JDBCFactory loadJDBCFactory(FabricComponent component, JDBCFactoryPropertyValue scoParameterValue) throws JDBCConfigurationException, RuntimeContextException
Service Configuration Property
of type JDBC_FACTORY
from the underlying configuration store. The property holds a Reference Context as well
as Instance Name and Semantic Type of an object.scoParameterValue
- JDBC_FACTORYJDBCConfigurationException
RuntimeContextException
public static boolean existsJDBCFactory(java.lang.String factoryName, java.lang.String factoryType) throws RepositoryException, JDBCConfigurationException
true
if this JDBC factory exists.factoryName
- StringfactoryType
- StringRepositoryException
JDBCConfigurationException
public static JDBCFactory loadFactoryObject(FabricComponent component, java.lang.String factoryName, java.lang.String factoryType, boolean isTransient) throws RepositoryException, JDBCConfigurationException, RuntimeContextException
component
- FabricComponentfactoryName
- StringfactoryType
- StringisTransient
- booleanRepositoryException
JDBCConfigurationException
RuntimeContextException
public static JDBCFactory getJDBCFactory(FabricComponent component, java.lang.String factoryName, java.lang.String factoryType) throws java.lang.Exception
If the component is RuntimeContext
the package associated with the factory (i.e. jdbc.<factoryType>
)
must exist in the Runtime Package Manifest.
component
- the owner component of the factory.factoryName
- the factory name.factoryType
- the factory type.java.lang.Exception
- if some error occurs.public static void removeFactoryObject(java.lang.String factoryName, java.lang.String factoryType) throws JDBCConfigurationException, RuntimeContextException
factoryName
- StringfactoryType
- StringJDBCConfigurationException
RuntimeContextException
public static DatabaseConnection createConnection(java.lang.String factoryType, java.lang.String factoryName) throws java.lang.Exception
The package associated with the JDBCFactory/code> (i.e.
jdbc.<factoryType>
)
must exist in the Runtime Package Manifest.
factoryType
- the type of JDBCFactory
.factoryName
- the name of JDBCFactory
.java.lang.Exception
- if some error occurs.public static DatabaseConnection createConnection(java.lang.String factoryType, java.lang.String factoryName, java.lang.String connectionName, java.lang.String userName, java.lang.String password) throws java.lang.Exception
The package associated with the JDBCFactory/code> (i.e.
jdbc.<factoryType>
)
must exist in the Runtime Package Manifest.
factoryType
- the type of JDBCFactory
.factoryName
- the name of JDBCFactory
.connectionName
- the connection name.userName
- the user name.password
- the password.java.lang.Exception
- if some error occurs.Copyright © 2015-2024 StreamScape Technologies. All rights reserved.