Interface ConnectorRuntime
-
- All Superinterfaces:
ConnectorConstants
,ResourceConstants
- All Known Implementing Classes:
ConnectorRuntime
@Contract public interface ConnectorRuntime extends ConnectorConstants
This class is the entry point to connector backend module. It exposes different API's called by external entities like JPA, admin to perform various connector backend related operations. It delegates calls to various connetcor admin services and other connector services which actually implement the functionality. This is a delegating class.- Author:
- Binod P.G, Srikanth P, Aditya Gore, Jagadish Ramu
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.sun.appserv.connectors.internal.api.ConnectorConstants
ConnectorConstants.PoolType
-
Nested classes/interfaces inherited from interface org.glassfish.resourcebase.resources.api.ResourceConstants
ResourceConstants.TriState
-
-
Field Summary
-
Fields inherited from interface com.sun.appserv.connectors.internal.api.ConnectorConstants
ACCESS_ALL_RARS, ADMINISTERED_OBJECT_FACTORY, AIRA, AO, AOR, AORA, CAUTION_MESSAGE, CCP, CLASSLOADING_POLICY_DERIVED_ACCESS, CLASSLOADING_POLICY_GLOBAL_ACCESS, CONCURRENT_JNDINAME_PREFIX, CONNECTOR_MESSAGE_BEAN_CLIENT_FACTORY, CONNECTOR_MODULE, CR, DD_PREFIX, DEFAULT_JMS_ADAPTER, DEFAULT_RESOURCE_ADAPTER_SHUTDOWN_TIMEOUT, DYNAMIC_RECONFIGURATION_FLAG, DYNAMIC_RECONFIGURATION_PROXY_CALL, EXPLODED_EMBEDDED_RAR_EXTENSION, HIDDEN_CLI_NAME_VALUE_PAIR_DELIMITER, INSTALL_ROOT, JAVA_BEAN_FACTORY_CLASS, JAVA_SQL_DRIVER, JAVAX_SQL_CONNECTION_POOL_DATASOURCE, JAVAX_SQL_DATASOURCE, JAVAX_SQL_XA_DATASOURCE, JAXR_RA_NAME, JDBC, JDBCCONNECTIONPOOLDATASOURCE_RA_NAME, JDBCDATASOURCE_RA_NAME, JDBCDRIVER_RA_NAME, jdbcSystemRarNames, JDBCXA_RA_NAME, JMS_POOL_MAXSIZE, JMS_POOL_MINSIZE, JNDI_SUFFIX_PROPERTY, JNDI_SUFFIX_VALUES, LOCAL_TRANSACTION_INT, LOCAL_TRANSACTION_TX_SUPPORT_STRING, MCF, MONITORING_CONNECTION_FACTORIES, MONITORING_CONNECTOR_SERVICE, MONITORING_CONNECTOR_SERVICE_MODULE_NAME, MONITORING_JMS_SERVICE, MONITORING_JMS_SERVICE_MODULE_NAME, MONITORING_SEPARATOR, MONITORING_WORK_MANAGEMENT, MSL, NO_TRANSACTION_INT, NO_TRANSACTION_TX_SUPPORT_STRING, NON_TX_JNDI_SUFFIX, PM_JNDI_SUFFIX, POOLNAME_APPENDER, POOLS_JNDINAME_PREFIX, PRIMITIVES_AND_STRING_FACTORY_CLASS, PROPERTIES_FACTORY, RA, RAR, RAR_EXTENSION, RAR_VISIBILITY, RAR_VISIBILITY_GLOBAL_ACCESS, REQUIRED_RARS_FOR_APP_PREFIX, RESERVE_PREFIX, RESOURCE_JNDINAME_PREFIX, RESOURCENAME_APPENDER, SEC, SECURITYMAPMETACHAR, SUN_RA_POOL, systemRarNames, systemRarsAllowingPoolCreation, sysThrowExcp, THROW_TRANSACTED_EXCEPTIONS, THROW_TRANSACTED_EXCEPTIONS_PROP, UNDEFINED_TRANSACTION_INT, URL_OBJECTS_FACTORY, USERGROUPDISTINGUISHER, XA_TRANSACTION_INT, XA_TRANSACTION_TX_SUPPORT_STRING
-
Fields inherited from interface org.glassfish.resourcebase.resources.api.ResourceConstants
ADMINISTERED_OBJECT_DEFINITION_JNDINAME_PREFIX, APP_META_DATA_RESOURCES, APP_SCOPED_RESOURCES_JNDI_NAMES, APP_SCOPED_RESOURCES_MAP, APP_SCOPED_RESOURCES_RA_NAMES, CONCURRENT_CONTEXT_SERVICE_DEFINITION_JNDINAME_PREFIX, CONNECTION_FACTORY_DEFINITION_JNDINAME_PREFIX, CONNECTOR_RESOURCES, DATASOURCE_DEFINITION_JNDINAME_PREFIX, EMBEDDEDRAR_NAME_DELIMITER, EXT_JNDI_RES_TYPE, GF_RESOURCES_LOCATION, GF_RESOURCES_MODULE, GF_RESOURCES_MODULE_EAR, JAVA_APP_SCOPE_PREFIX, JAVA_COMP_ENV_SCOPE_PREFIX, JAVA_COMP_SCOPE_PREFIX, JAVA_GLOBAL_SCOPE_PREFIX, JAVA_MODULE_SCOPE_PREFIX, JAVA_SCOPE_PREFIX, JMS_CONNECTION_FACTORY_DEFINITION_JNDINAME_PREFIX, JMS_DESTINATION_DEFINITION_JNDINAME_PREFIX, JMS_MESSAGE_LISTENER, JMS_QUEUE, JMS_QUEUE_CONNECTION_FACTORY, JMS_TOPIC, JMS_TOPIC_CONNECTION_FACTORY, MAILSESSION_DEFINITION_JNDINAME_PREFIX, NON_CONNECTOR_RESOURCES, PAYARA_RESOURCES_LOCATION, PY_RESOURCES_MODULE, PY_RESOURCES_MODULE_EAR, RES_TYPE_AOR, RES_TYPE_CCP, RES_TYPE_CR, RES_TYPE_CUSTOM, RES_TYPE_CWSM, RES_TYPE_EXTERNAL_JNDI, RES_TYPE_JCP, RES_TYPE_JDBC, RES_TYPE_MAIL, RES_TYPE_RAC
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
associateResourceAdapter(String rarName, jakarta.resource.spi.ResourceAdapterAssociation raa)
associates the given instance of ResourceAdapterAssociation with the ResourceAdapter java-bean of the specified RARvoid
cleanUpResourcesAndShutdownAllActiveRAs()
Shut down all pools and active resource-adaptersvoid
createActiveResourceAdapter(String sourcePath, String moduleName, ClassLoader loader)
Creates Active resource Adapter which abstracts the rar module.void
createActiveResourceAdapterForEmbeddedRar(String moduleName)
Creates Active resource Adapter which abstracts the rar module.ClassLoader
createConnectorClassLoader(String moduleDirectory, ClassLoader parent, String rarModuleName)
Given the module directory, creates a connector-class-finder (class-loader) for the modulevoid
destroyActiveResourceAdapter(String moduleName)
Destroys/deletes the Active resource adapter object from the connector container.boolean
flushConnectionPool(String poolName)
Flush Connection pool by reinitializing the connections established in the pool.boolean
flushConnectionPool(PoolInfo poolInfo)
Flush Connection pool by reinitializing the connections established in the pool.String
getActivationSpecClass(String rarName, String messageListenerType)
Return the ActivationSpecClass name for given rar and messageListenerTypeString[]
getAdminObjectClassNames(String rarName, String intfName)
Obtains all the Admin object implementation class names of the admin-object-interface for a rarMap<String,String>
getAdminObjectConfigProps(String rarName, String adminObjectIntf)
Retrieves the admin object javabean properties with default values.Map<String,String>
getAdminObjectConfigProps(String rarName, String adminObjectIntf, String adminObjectClass)
Retrieves the admin object javabean properties with default values.String[]
getAdminObjectInterfaceNames(String rarName)
Obtains all the Admin object interface names of a rarMap<String,String>
getBuiltInCustomResources()
Provides the list of built in custom resources by resource-type and factory-class-name pair.CallbackHandler
getCallbackHandler()
provides container's (application server's) callback handlerList<String>
getConfidentialProperties(String rarName, String type, String... keyFields)
Retrieve the "confidential" config properties of specified artifact from a resource-adapterString[]
getConnectionDefinitionNames(String rarName)
Obtains all the Connection definition names of a rarMap<String,Object>
getConnectionDefinitionPropertiesAndDefaults(String connectionDefinitionClassName, String resType)
Gets the properties of the Java bean connection definition class that have setter methods defined and the default values as provided by the Connection Definition java bean developer.ResourcePool
getConnectionPoolConfig(PoolInfo poolInfo)
Provide the configuration of the poolClassLoader
getConnectorClassLoader()
provides connector class loaderMap<String,String>
getConnectorConfigJavaBeans(String rarName, String connectionDefName, String type)
Retrieves the XXX javabean properties with default values.ConnectorDescriptor
getConnectorDescriptor(String rarName)
given a resource-adapter name, retrieves the connector-descriptor either from runtime's registry or by reading the descriptor from deployment location.Set<String>
getDatabaseVendorNames()
Get jdbc database vendor names list.ProcessEnvironment.ProcessType
getEnvironment()
Indicates whether the execution environment is server or clientInvocationManager
getInvocationManager()
provides the invocationManagerSet<String>
getJdbcDriverClassNames(String dbVendor, String resType)
Fetch the DataSource/Driver implementation class names for a particular dbVendor and resource type.Set<String>
getJdbcDriverClassNames(String dbVendor, String resType, boolean introspect)
Fetch the DataSource/Driver implementation class names for a particular dbVendor and resource type.Map<String,String>
getMCFConfigProps(String rarName, String connectionDefName)
Retrieves the MCF javabean properties with default values.Map<String,String>
getMessageListenerConfigProps(String rarName, String messageListenerType)
Parses the ra.xml for the ActivationSpec javabean properties and processes annotations if any.Map<String,String>
getMessageListenerConfigPropTypes(String rarName, String messageListenerType)
Returns the Properties object consisting of propertyname as the key and datatype as the value.String[]
getMessageListenerTypes(String rarName)
Parses the ra.xml, processes the annotated rar artificats if any and returns all the Message listener types.boolean
getPingDuringPoolCreation(PoolInfo poolInfo)
Check if Ping attribute is on during pool creation.Map<String,String>
getResourceAdapterConfigProps(String rarName)
Retrieves the Resource adapter javabean properties with default values.Set
getResourceReferenceDescriptor()
get resource reference descriptors from current component's jndi environmentString
getSecurityPermissionSpec(String moduleName)
Obtains the Permission string that needs to be added to the to the security policy files.long
getShutdownTimeout()
Gets the shutdown-timeout attribute configured inconnector-service
String[]
getSystemConnectorsAllowingPoolCreation()
Returns the system RAR names that allow pool creationJavaEETransactionManager
getTransactionManager()
provides the transactionManagerList<WorkSecurityMap>
getWorkSecurityMap(String raName)
get work security maps for a resource-adapter-nameboolean
hasAdminObject(String rarName, String intfName, String className)
checks whether the specified intfName, className has presence in admin objects of the RARboolean
isEmbedded()
Checks whether the executing environment is embedded runtimeboolean
isServer()
Checks whether the executing environment is application serverObject
lookupNonTxResource(String jndiName, boolean force)
Does lookup of non-tx-datasource.Object
lookupNonTxResource(ResourceInfo resourceInfo, boolean force)
Does lookup of non-tx-datasource.Object
lookupPMResource(String jndiName, boolean force)
Does lookup of "__pm" datasource.Object
lookupPMResource(ResourceInfo resourceInfo, boolean force)
Does lookup of "__pm" datasource.jakarta.resource.spi.ManagedConnectionFactory
obtainManagedConnectionFactory(PoolInfo poolInfo)
Returns the MCF instance.jakarta.resource.spi.ManagedConnectionFactory
obtainManagedConnectionFactory(PoolInfo poolInfo, Hashtable env)
provide the MCF of the pool (either retrieve or create)boolean
pingConnectionPool(PoolInfo poolInfo)
Tests whether the configuration for the pool is valid by making a connection.void
registerConnectorNamingEventListener(ConnectorNamingEventListener listener)
register the connector naming event listenervoid
registerDataSourceDefinitions(Application application)
Used to register data-source-definitions at an earlier stage of deployment (prepare phase).void
shutdownAllActiveResourceAdapters()
Shut down all active resource adaptersvoid
unregisterConnectorNamingEventListener(ConnectorNamingEventListener listener)
unregister the connector naming event listnervoid
unRegisterDataSourceDefinitions(Application application)
Used to unRegister data-source-definitions at an later stage of undeploy operation.
-
-
-
Method Detail
-
createActiveResourceAdapter
void createActiveResourceAdapter(String sourcePath, String moduleName, ClassLoader loader) throws ConnectorRuntimeException
Creates Active resource Adapter which abstracts the rar module. During the creation of ActiveResourceAdapter, default pools and resources also are created.- Parameters:
sourcePath
- Directory where rar module is exploded.moduleName
- Name of the moduleloader
- Classloader used to load the .rar- Throws:
ConnectorRuntimeException
- if creation fails.
-
createActiveResourceAdapterForEmbeddedRar
void createActiveResourceAdapterForEmbeddedRar(String moduleName) throws ConnectorRuntimeException
Creates Active resource Adapter which abstracts the rar module. During the creation of ActiveResourceAdapter, default pools and resources also are created.- Parameters:
moduleName
- Name of the module- Throws:
ConnectorRuntimeException
- if creation fails.
-
destroyActiveResourceAdapter
void destroyActiveResourceAdapter(String moduleName) throws ConnectorRuntimeException
Destroys/deletes the Active resource adapter object from the connector container. Active resource adapter abstracts the rar deployed.- Parameters:
moduleName
- Name of the rarModule to destroy/delete- Throws:
ConnectorRuntimeException
- if the deletion fails
-
cleanUpResourcesAndShutdownAllActiveRAs
void cleanUpResourcesAndShutdownAllActiveRAs()
Shut down all pools and active resource-adapters
-
shutdownAllActiveResourceAdapters
void shutdownAllActiveResourceAdapters()
Shut down all active resource adapters
-
createConnectorClassLoader
ClassLoader createConnectorClassLoader(String moduleDirectory, ClassLoader parent, String rarModuleName) throws ConnectorRuntimeException
Given the module directory, creates a connector-class-finder (class-loader) for the module- Parameters:
moduleDirectory
- rar module directory for which classloader is neededparent
- parent classloader
For standalone rars, pass null, as the parent should be common-class-loader that will be automatically taken care by ConnectorClassLoaderService.
For embedded rars, parent is necessary- Returns:
- classloader created for the module
- Throws:
ConnectorRuntimeException
- when unable to create classloader
-
lookupNonTxResource
Object lookupNonTxResource(String jndiName, boolean force) throws NamingException
Does lookup of non-tx-datasource. If found, it will be returned.
If not found and force is true, this api will try to get a wrapper datasource specified by the jdbcjndi name. The motivation for having this API is to provide the CMP backend/ JPA-Java2DB a means of acquiring a connection during the codegen phase. If a user is trying to deploy an JPA-Java2DB app on a remote server, without this API, a resource reference has to be present both in the DAS and the server instance. This makes the deployment more complex for the user since a resource needs to be forcibly created in the DAS Too. This API will mitigate this need.- Parameters:
jndiName
- jndi name of the resourceforce
- provide the resource (in DAS) even if it is not enabled in DAS- Returns:
- DataSource representing the resource.
- Throws:
NamingException
- when not able to get the datasource.
-
lookupPMResource
Object lookupPMResource(String jndiName, boolean force) throws NamingException
Does lookup of "__pm" datasource. If found, it will be returned.
If not found and force is true, this api will try to get a wrapper datasource specified by the jdbcjndi name. The motivation for having this API is to provide the CMP backend/ JPA-Java2DB a means of acquiring a connection during the codegen phase. If a user is trying to deploy an JPA-Java2DB app on a remote server, without this API, a resource reference has to be present both in the DAS and the server instance. This makes the deployment more complex for the user since a resource needs to be forcibly created in the DAS Too. This API will mitigate this need. When the resource is not enabled, datasource wrapper provided will not be of type "__pm"- Parameters:
jndiName
- jndi name of the resourceforce
- provide the resource (in DAS) even if it is not enabled in DAS- Returns:
- DataSource representing the resource.
- Throws:
NamingException
- when not able to get the datasource.
-
lookupNonTxResource
Object lookupNonTxResource(ResourceInfo resourceInfo, boolean force) throws NamingException
Does lookup of non-tx-datasource. If found, it will be returned.
If not found and force is true, this api will try to get a wrapper datasource specified by the jdbcjndi name. The motivation for having this API is to provide the CMP backend/ JPA-Java2DB a means of acquiring a connection during the codegen phase. If a user is trying to deploy an JPA-Java2DB app on a remote server, without this API, a resource reference has to be present both in the DAS and the server instance. This makes the deployment more complex for the user since a resource needs to be forcibly created in the DAS Too. This API will mitigate this need.- Parameters:
resourceInfo
- jndi name of the resourceforce
- provide the resource (in DAS) even if it is not enabled in DAS- Returns:
- DataSource representing the resource.
- Throws:
NamingException
- when not able to get the datasource.
-
lookupPMResource
Object lookupPMResource(ResourceInfo resourceInfo, boolean force) throws NamingException
Does lookup of "__pm" datasource. If found, it will be returned.
If not found and force is true, this api will try to get a wrapper datasource specified by the jdbcjndi name. The motivation for having this API is to provide the CMP backend/ JPA-Java2DB a means of acquiring a connection during the codegen phase. If a user is trying to deploy an JPA-Java2DB app on a remote server, without this API, a resource reference has to be present both in the DAS and the server instance. This makes the deployment more complex for the user since a resource needs to be forcibly created in the DAS Too. This API will mitigate this need. When the resource is not enabled, datasource wrapper provided will not be of type "__pm"- Parameters:
resourceInfo
- jndi name of the resourceforce
- provide the resource (in DAS) even if it is not enabled in DAS- Returns:
- DataSource representing the resource.
- Throws:
NamingException
- when not able to get the datasource.
-
registerConnectorNamingEventListener
void registerConnectorNamingEventListener(ConnectorNamingEventListener listener)
register the connector naming event listener- Parameters:
listener
- connector-naming-event-listener
-
unregisterConnectorNamingEventListener
void unregisterConnectorNamingEventListener(ConnectorNamingEventListener listener)
unregister the connector naming event listner- Parameters:
listener
- connector-naming-event-listener
-
getConnectionPoolConfig
ResourcePool getConnectionPoolConfig(PoolInfo poolInfo)
Provide the configuration of the pool- Parameters:
PoolInfo
- connection pool info- Returns:
- ResourcePool connection pool configuration
-
pingConnectionPool
boolean pingConnectionPool(PoolInfo poolInfo) throws jakarta.resource.ResourceException
Tests whether the configuration for the pool is valid by making a connection.- Parameters:
PoolInfo
- connection pool info.- Returns:
- boolean indicating ping status
- Throws:
jakarta.resource.ResourceException
- when unable to ping
-
getTransactionManager
JavaEETransactionManager getTransactionManager()
provides the transactionManager- Returns:
- TransactionManager
-
getInvocationManager
InvocationManager getInvocationManager()
provides the invocationManager- Returns:
- InvocationManager
-
getResourceReferenceDescriptor
Set getResourceReferenceDescriptor()
get resource reference descriptors from current component's jndi environment- Returns:
- set of resource-refs
-
obtainManagedConnectionFactory
jakarta.resource.spi.ManagedConnectionFactory obtainManagedConnectionFactory(PoolInfo poolInfo) throws ConnectorRuntimeException
Returns the MCF instance. If the MCF is already created and present in connectorRegistry that instance is returned. Otherwise it is created explicitly and added to ConnectorRegistry.- Parameters:
PoolInfo
- Name of the pool.MCF pertaining to this pool is created/returned.- Returns:
- created/already present MCF instance
- Throws:
ConnectorRuntimeException
- if creation/retrieval of MCF fails
-
obtainManagedConnectionFactory
jakarta.resource.spi.ManagedConnectionFactory obtainManagedConnectionFactory(PoolInfo poolInfo, Hashtable env) throws ConnectorRuntimeException
provide the MCF of the pool (either retrieve or create)- Parameters:
poolName
- connection pool nameenv
- Environment entries to use for lookup- Returns:
- ManagedConnectionFactory mcf of the pool
- Throws:
ConnectorRuntimeException
- when unable to provide the MCF
-
getEnvironment
ProcessEnvironment.ProcessType getEnvironment()
Indicates whether the execution environment is server or client- Returns:
- ConnectorConstants.SERVER or ConnectorConstants.CLIENT
-
getCallbackHandler
CallbackHandler getCallbackHandler()
provides container's (application server's) callback handler- Returns:
- container callback handler
-
isServer
boolean isServer()
Checks whether the executing environment is application server- Returns:
- true if execution environment is server false if it is not server
-
isEmbedded
boolean isEmbedded()
Checks whether the executing environment is embedded runtime- Returns:
- true if execution environment is embedded mode false if it non-embedded
-
getConnectorClassLoader
ClassLoader getConnectorClassLoader()
provides connector class loader- Returns:
- ClassLoader
-
getConnectionDefinitionPropertiesAndDefaults
Map<String,Object> getConnectionDefinitionPropertiesAndDefaults(String connectionDefinitionClassName, String resType)
Gets the properties of the Java bean connection definition class that have setter methods defined and the default values as provided by the Connection Definition java bean developer. This method is used to get properties of jdbc-data-source
To get Connection definition properties for Connector Connection Pool, use ConnectorRuntime.getMCFConfigProperties()
When the connection definition class is not found, standard JDBC properties (of JDBC 3.0 Specification) will be returned.- Parameters:
connectionDefinitionClassName
- The Connection Definition Java bean class for which overrideable properties are required.resType
- resource-type- Returns:
- Map
String represents property name and Object is the defaultValue that is a primitive type or String
-
getBuiltInCustomResources
Map<String,String> getBuiltInCustomResources()
Provides the list of built in custom resources by resource-type and factory-class-name pair.- Returns:
- map of resource-type & factory-class-name
-
getSystemConnectorsAllowingPoolCreation
String[] getSystemConnectorsAllowingPoolCreation()
Returns the system RAR names that allow pool creation- Returns:
- String array representing list of system-rars
-
getConnectionDefinitionNames
String[] getConnectionDefinitionNames(String rarName) throws ConnectorRuntimeException
Obtains all the Connection definition names of a rar- Parameters:
rarName
- rar moduleName- Returns:
- Array of connection definition names.
- Throws:
ConnectorRuntimeException
- when unable to obtain connection definition from descriptor.
-
getSecurityPermissionSpec
String getSecurityPermissionSpec(String moduleName) throws ConnectorRuntimeException
Obtains the Permission string that needs to be added to the to the security policy files. These are the security permissions needed by the resource adapter implementation classes. These strings are obtained by parsing the ra.xml and by processing annotations if any- Parameters:
moduleName
- rar module Name- Returns:
- security permission spec
- Throws:
ConnectorRuntimeException
- If rar.xml parsing or annotation processing fails.
-
getAdminObjectInterfaceNames
String[] getAdminObjectInterfaceNames(String rarName) throws ConnectorRuntimeException
Obtains all the Admin object interface names of a rar- Parameters:
rarName
- rar moduleName- Returns:
- Array of admin object interface names.
- Throws:
ConnectorRuntimeException
- when unable to obtain admin object interface names
-
getAdminObjectClassNames
String[] getAdminObjectClassNames(String rarName, String intfName) throws ConnectorRuntimeException
Obtains all the Admin object implementation class names of the admin-object-interface for a rar- Parameters:
rarName
- rar moduleNameintfName
- admin-object-interface-name- Returns:
- Array of admin object interface names.
- Throws:
ConnectorRuntimeException
- when unable to obtain admin object interface names
-
hasAdminObject
boolean hasAdminObject(String rarName, String intfName, String className) throws ConnectorRuntimeException
checks whether the specified intfName, className has presence in admin objects of the RAR- Parameters:
rarName
- resource-adapter nameintfName
- admin object interface nameclassName
- admin object class name- Returns:
- boolean indicating the presence of admin object
- Throws:
ConnectorRuntimeException
- when unable to determine the presence
-
getResourceAdapterConfigProps
Map<String,String> getResourceAdapterConfigProps(String rarName) throws ConnectorRuntimeException
Retrieves the Resource adapter javabean properties with default values. The default values will the values present in the ra.xml. If the value is not present in ra.xxml, javabean is introspected to obtain the default value present, if any. If intrspection fails or null is the default value, empty string is returned. If ra.xml has only the property and no value, empty string is the value returned. If the Resource Adapter Java bean is annotated, properties will be the result of merging annotated config property and config-property of Resource Adapter bean in ra.xml- Parameters:
rarName
- rar module name- Returns:
- Resource adapter javabean properties with default values.
- Throws:
ConnectorRuntimeException
- if property retrieval fails.
-
getMCFConfigProps
Map<String,String> getMCFConfigProps(String rarName, String connectionDefName) throws ConnectorRuntimeException
Retrieves the MCF javabean properties with default values. The default values will the values present in the ra.xml. If the value is not present in ra.xxml, javabean is introspected to obtain the default value present, if any. If intrspection fails or null is the default value, empty string is returned. If ra.xml has only the property and no value, empty string is the value returned. If the ManagedConnectionFactory Java bean is annotated, properties will be the result of merging annotated config property and config-property of MCF in ra.xml- Parameters:
rarName
- rar module nameconnectionDefName
- connection-definition-name- Returns:
- managed connection factory javabean properties with default values.
- Throws:
ConnectorRuntimeException
- if property retrieval fails.
-
getAdminObjectConfigProps
Map<String,String> getAdminObjectConfigProps(String rarName, String adminObjectIntf) throws ConnectorRuntimeException
Retrieves the admin object javabean properties with default values. The default values will the values present in the ra.xml. If the value is not present in ra.xxml, javabean is introspected to obtain the default value present, if any. If intrspection fails or null is the default value, empty string is returned. If ra.xml has only the property and no value, empty string is the value returned. If the AdministeredObject Java bean is annotated, properties will be the result of merging annotated config property and config-property of AdministeredObject in ra.xml- Parameters:
rarName
- rar module nameadminObjectIntf
- admin-object-interface name- Returns:
- admin object javabean properties with default values.
- Throws:
ConnectorRuntimeException
- if property retrieval fails.
-
getAdminObjectConfigProps
Map<String,String> getAdminObjectConfigProps(String rarName, String adminObjectIntf, String adminObjectClass) throws ConnectorRuntimeException
Retrieves the admin object javabean properties with default values. The default values will the values present in the ra.xml. If the value is not present in ra.xxml, javabean is introspected to obtain the default value present, if any. If intrspection fails or null is the default value, empty string is returned. If ra.xml has only the property and no value, empty string is the value returned. If the AdministeredObject Java bean is annotated, properties will be the result of merging annotated config property and config-property of AdministeredObject in ra.xml- Parameters:
rarName
- rar module nameadminObjectIntf
- admin-object-interface nameadminObjectClass
- admin-object-class name- Returns:
- admin object javabean properties with default values.
- Throws:
ConnectorRuntimeException
- if property retrieval fails.
-
getConnectorConfigJavaBeans
Map<String,String> getConnectorConfigJavaBeans(String rarName, String connectionDefName, String type) throws ConnectorRuntimeException
Retrieves the XXX javabean properties with default values. The javabean to introspect/retrieve is specified by the type. The default values will be the values present in the ra.xml. If the value is not present in ra.xxml, javabean is introspected to obtain the default value present, if any. If intrspection fails or null is the default value, empty string is returned. If ra.xml has only the property and no value, empty string is the value returned.- Parameters:
rarName
- rar module nameconnectionDefName
- connection definition nametype
- JavaBean type to introspect- Returns:
- admin object javabean properties with default values.
- Throws:
ConnectorRuntimeException
- if property retrieval fails.
-
getActivationSpecClass
String getActivationSpecClass(String rarName, String messageListenerType) throws ConnectorRuntimeException
Return the ActivationSpecClass name for given rar and messageListenerType- Parameters:
rarName
- name of the rar modulemessageListenerType
- MessageListener type- Returns:
- activation-spec class
- Throws:
ConnectorRuntimeException
- If moduleDir is null. If corresponding rar is not deployed.
-
getMessageListenerTypes
String[] getMessageListenerTypes(String rarName) throws ConnectorRuntimeException
Parses the ra.xml, processes the annotated rar artificats if any and returns all the Message listener types.- Parameters:
rarName
- name of the rar module.- Returns:
- Array of message listener types as strings.
- Throws:
ConnectorRuntimeException
- If moduleDir is null. If corresponding rar is not deployed.
-
getMessageListenerConfigProps
Map<String,String> getMessageListenerConfigProps(String rarName, String messageListenerType) throws ConnectorRuntimeException
Parses the ra.xml for the ActivationSpec javabean properties and processes annotations if any. The ActivationSpec to be parsed is identified by the moduleDir where ra.xml is present and the message listener type. message listener type will be unique in a given ra.xml. It throws ConnectorRuntimeException if either or both the parameters are null, if corresponding rar is not deployed, if message listener type mentioned as parameter is not found in ra.xml. If rar is deployed and message listener (type mentioned) is present but no properties are present for the corresponding message listener, null is returned.- Parameters:
rarName
- name of the rar module.messageListenerType
- message listener type.It is uniqie across allsub-elements in element in a given rar. - Returns:
- Javabean properties with the property names and values of properties. The property values will be the values mentioned in ra.xml if present. Otherwise it will be the default values obtained by introspecting the javabean. In both the case if no value is present, empty String is returned as the value.
- Throws:
ConnectorRuntimeException
- if either of the parameters are null. If corresponding rar is not deployed i.e moduleDir is invalid. If messagelistener type is not found in ra.xml or could not be found in annotations if any
-
getMessageListenerConfigPropTypes
Map<String,String> getMessageListenerConfigPropTypes(String rarName, String messageListenerType) throws ConnectorRuntimeException
Returns the Properties object consisting of propertyname as the key and datatype as the value.- Parameters:
rarName
- name of the rar module.messageListenerType
- message listener type.It is uniqie across allsub-elements in element in a given rar. - Returns:
- Properties object with the property names(key) and datatype of property(as value).
- Throws:
ConnectorRuntimeException
- if either of the parameters are null. If corresponding rar is not deployed i.e moduleDir is invalid. If messagelistener type is not found in ra.xmlor could not be found in annotations if any
-
getWorkSecurityMap
List<WorkSecurityMap> getWorkSecurityMap(String raName)
get work security maps for a resource-adapter-name- Parameters:
raName
- resource-adapter name- Returns:
- all work security maps of a resource-adapter
-
registerDataSourceDefinitions
void registerDataSourceDefinitions(Application application)
Used to register data-source-definitions at an earlier stage of deployment (prepare phase). This is used to register "java:global" and "java:app" scoped DataSourceDefinitions which can be referred by JPA in persistence.xml- Parameters:
application
- Application being deployed.
-
unRegisterDataSourceDefinitions
void unRegisterDataSourceDefinitions(Application application)
Used to unRegister data-source-definitions at an later stage of undeploy operation. This is used to unRegister "java:global" and "java:app" scoped DataSourceDefinitions which can be referred by JPA in persistence.xml- Parameters:
application
- Application being undeployed.
-
flushConnectionPool
boolean flushConnectionPool(PoolInfo poolInfo) throws ConnectorRuntimeException
Flush Connection pool by reinitializing the connections established in the pool.- Parameters:
PoolInfo
- connection pool info- Throws:
ConnectorRuntimeException
-
flushConnectionPool
boolean flushConnectionPool(String poolName) throws ConnectorRuntimeException
Flush Connection pool by reinitializing the connections established in the pool.- Parameters:
PoolInfo
- connection pool info- Throws:
ConnectorRuntimeException
-
getJdbcDriverClassNames
Set<String> getJdbcDriverClassNames(String dbVendor, String resType)
Fetch the DataSource/Driver implementation class names for a particular dbVendor and resource type. Sometimes an already stored datasource
classname is used in this method.- Parameters:
dbVendor
- database vendor nameresType
- resource-type
(javax.sql.DataSource/javax.sql.ConnectionPoolDataSource/javax.sql.XADataSource/java.sql.Driver)- Returns:
- set of implementation class names for the dbvendor.
-
getJdbcDriverClassNames
Set<String> getJdbcDriverClassNames(String dbVendor, String resType, boolean introspect)
Fetch the DataSource/Driver implementation class names for a particular dbVendor and resource type. A pre-defined datasource or driver
classname is returned by this method by default for common database vendors. When introspect is true, classnames are got by introspection of the jdbc driver jar.- Parameters:
dbVendor
- database vendor nameresType
- resource-typeintrospect
- (javax.sql.DataSource/javax.sql.ConnectionPoolDataSource/javax.sql.XADataSource/java.sql.Driver)- Returns:
- set of implementation class names for the dbvendor.
-
getPingDuringPoolCreation
boolean getPingDuringPoolCreation(PoolInfo poolInfo)
Check if Ping attribute is on during pool creation. This is used for pinging the pool for erroneous values during pool creation.- Parameters:
PoolInfo
- connection pool info- Returns:
- true if ping is on
-
getConnectorDescriptor
ConnectorDescriptor getConnectorDescriptor(String rarName) throws ConnectorRuntimeException
given a resource-adapter name, retrieves the connector-descriptor either from runtime's registry or by reading the descriptor from deployment location.- Parameters:
rarName
- resource-adapter-name- Returns:
- ConnectorDescriptor of the .rar
- Throws:
ConnectorRuntimeException
- when unable to provide the descriptor
-
getDatabaseVendorNames
Set<String> getDatabaseVendorNames()
Get jdbc database vendor names list. This is used for getting a list of all common database vendor names.- Returns:
- set of common database vendor names
-
associateResourceAdapter
void associateResourceAdapter(String rarName, jakarta.resource.spi.ResourceAdapterAssociation raa) throws jakarta.resource.ResourceException
associates the given instance of ResourceAdapterAssociation with the ResourceAdapter java-bean of the specified RAR- Parameters:
rarName
- resource-adapter-nameraa
- Object that is an instance of ResourceAdapterAssociation- Throws:
jakarta.resource.ResourceException
- when unable to associate the RA Bean with RAA instance.
-
getShutdownTimeout
long getShutdownTimeout()
Gets the shutdown-timeout attribute configured inconnector-service
- Returns:
- long shutdown timeout (in milli-seconds)
-
getConfidentialProperties
List<String> getConfidentialProperties(String rarName, String type, String... keyFields) throws ConnectorRuntimeException
Retrieve the "confidential" config properties of specified artifact from a resource-adapter- Parameters:
rarName
- resource-adapter nametype
- indicates the artifact type. Valid values are : ConnectorConstants.AOR, RA, MCF, MSLkeyFields
- var-args list of key fields. eg: connection-definition-name when- Returns:
- list of confidential properties
- Throws:
ConnectorRuntimeException
-
-