Package com.sun.enterprise.connectors
Class ConnectorRuntime
- java.lang.Object
-
- com.sun.enterprise.connectors.ConnectorRuntime
-
- All Implemented Interfaces:
ConnectorConstants
,ConnectorRuntime
,org.glassfish.hk2.api.PostConstruct
,org.glassfish.hk2.api.PreDestroy
,ResourceConstants
@Service @Singleton public class ConnectorRuntime extends Object implements ConnectorRuntime, org.glassfish.hk2.api.PostConstruct, org.glassfish.hk2.api.PreDestroy
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
-
-
Constructor Summary
Constructors Constructor Description ConnectorRuntime()
Private constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAdminObject(String appName, String connectorName, ResourceInfo resourceInfo, String adminObjectType, String adminObjectClassName, Properties props)
void
addResourceAdapterConfig(String rarName, ResourceAdapterConfig raConfig)
Add the resource adapter configuration to the connector registryvoid
associateResourceAdapter(String rarName, jakarta.resource.spi.ResourceAdapterAssociation raa)
associates the given instance of ResourceAdapterAssociation with the ResourceAdapter java-bean of the specified RARboolean
checkAccessibility(String rarName, ClassLoader loader)
Check whether ClassLoader is permitted to access this resource adapter.void
cleanUpResourcesAndShutdownAllActiveRAs()
Shut down all pools and active resource-adaptersvoid
createActiveResourceAdapter(ConnectorDescriptor connectorDescriptor, String moduleName, String moduleDir)
Creates Active resource Adapter which abstracts the rar module.void
createActiveResourceAdapter(ConnectorDescriptor connectorDescriptor, String moduleName, String moduleDir, ClassLoader loader)
void
createActiveResourceAdapter(String moduleDir, String moduleName, ClassLoader loader)
Creates Active resource Adapter which abstracts the rar module.void
createActiveResourceAdapterForEmbeddedRar(String rarModuleName)
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
createConnectorConnectionPool(ConnectorConnectionPool connectorPoolObj)
Creates connector connection pool in the connector container.void
createConnectorConnectionPool(ConnectorConnectionPool ccp, String connectionDefinitionName, String rarName, List<Property> props, List<SecurityMap> securityMaps)
Creates connector connection pool in the connector container.void
createConnectorResource(ResourceInfo resourceInfo, PoolInfo poolInfo, String resourceType)
Creates the connector resource on a given connection poolvoid
deleteAdminObject(ResourceInfo resourceInfo)
void
deleteConnectorConnectionPool(PoolInfo poolInfo)
Deletes connector Connection poolvoid
deleteConnectorResource(ResourceInfo resourceInfo)
Deletes the connector resource.void
deleteResourceAdapterConfig(String rarName)
Delete the resource adapter configuration to the connector registryvoid
deployResourcesOfModule(String rarName)
deploy resources of 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 messageListenerTypeActiveRAFactory
getActiveRAFactory()
String[]
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 rarApplicationArchivist
getApplicationArchivist()
Applications
getApplications()
ApplicationRegistry
getAppRegistry()
AuthenticationService
getAuthenticationService(String rarName, PoolInfo poolInfo)
Obtain the authentication service associated with rar module.Map<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 handlerClassLoaderHierarchy
getClassLoaderHierarchy()
ComponentEnvManager
getComponentEnvManager()
List<String>
getConfidentialProperties(String rarName, String type, String... keyFields)
Retrieve the "confidential" config properties of specified artifact from a resource-adapterConnection
getConnection(ResourceInfo resourceInfo)
Get a sql connection from the DataSource specified by the jdbcJndiName.Connection
getConnection(ResourceInfo resourceInfo, String user, String password)
Get a sql connection from the DataSource specified by the jdbcJndiName.String[]
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 poolConnectorArchivist
getConnectorArchvist()
ConnectorJavaBeanValidator
getConnectorBeanValidator()
returns the bean validator that can be used to validate various connector bean artifacts (ResourceAdapter, ManagedConnetionFactory, AdministeredObject, ActivationSpec)DelegatingClassLoader
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)
Obtains the connector Descriptor pertaining to rar.Set<String>
getDatabaseVendorNames()
Get jdbc database vendor names list.String
getDefaultPoolName(String moduleName, String connectionDefName)
Returns the generated default connection poolName for a connection definition.String
getDefaultResourceName(String moduleName, String connectionDefName)
Returns the generated default connector resource for a connection definition.Domain
getDomain()
ProcessEnvironment.ProcessType
getEnvironment()
Returns the execution environment.FileArchive
getFileArchive()
ResourceManager
getGlobalResourceManager()
InvocationManager
getInvocationManager()
provides the invocationManagerSet<String>
getJdbcDriverClassNames(String dbVendor, String resType)
Get jdbc driver implementation class names list for the dbVendor and resource type supplied.Set<String>
getJdbcDriverClassNames(String dbVendor, String resType, boolean introspect)
Get jdbc driver implementation class names list for the dbVendor and resource type supplied.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.MonitoringBootstrap
getMonitoringBootstrap()
GlassfishNamingManager
getNamingManager()
boolean
getPingDuringPoolCreation(PoolInfo poolInfo)
Check if ping is on during pool creation.PoolManager
getPoolManager()
ConnectorConstants.PoolType
getPoolType(PoolInfo poolInfo)
ConnectionPoolProbeProviderUtil
getProbeProviderUtil()
Map<String,String>
getResourceAdapterConfigProps(String rarName)
Retrieves the Resource adapter javabean properties with default values.PrintWriter
getResourceAdapterLogWriter()
Provides resource adapter log writer to be given to MCF of a resource-adapterResourceDeployer
getResourceDeployer(Object resource)
ResourceNamingService
getResourceNamingService()
Set
getResourceReferenceDescriptor()
get resource reference descriptors from current component's jndi environmentResources
getResources()
Resources
getResources(PoolInfo poolInfo)
Resources
getResources(ResourceInfo resourceInfo)
static ConnectorRuntime
getRuntime()
Returns the ConnectorRuntime instance.String
getSecurityPermissionSpec(String moduleName)
Obtains the Permission string that needs to be added to the to the security policy files.SecurityRoleMapperFactory
getSecurityRoleMapperFactory()
ServerEnvironment
getServerEnvironment()
long
getShutdownTimeout()
Gets the shutdown-timeout attribute configured inconnector-service
String[]
getSystemConnectorsAllowingPoolCreation()
Returns the system RAR names that allow pool creationClassLoader
getSystemRARClassLoader(String rarName)
Timer
getTimer()
jakarta.transaction.Transaction
getTransaction()
provides the current transactionJavaEETransactionManager
getTransactionManager()
provides the transactionManagerWorkContextHandler
getWorkContextHandler()
jakarta.resource.spi.work.WorkManager
getWorkManagerProxy(String poolId, String moduleName, ClassLoader rarCL)
provides work manager proxy that is SerializableList<WorkSecurityMap>
getWorkSecurityMap(String raName)
get work security maps for a resource-adapter-namejakarta.resource.spi.XATerminator
getXATerminatorProxy(String moduleName)
provides XATerminator proxy that is Serializableboolean
hasAdminObject(String rarName, String intfName, String className)
checks whether the specified intfName, className has presence in admin objects of the RARboolean
isACCRuntime()
Checks whether the executing environment is appclient container runtimeboolean
isConnectorConnectionPoolDeployed(PoolInfo poolInfo)
Checks if a conncetor connection pool has been deployed to this server instanceboolean
isConnectorPoolMonitoringEnabled()
boolean
isEmbedded()
Checks whether the executing environment is embeddedboolean
isJdbcPoolMonitoringEnabled()
boolean
isNonACCRuntime()
Checks whether the executing environment is non-acc (standalone)boolean
isServer()
Checks whether the executing environment is application servervoid
loadDeferredResourceAdapter(String rarName)
Object
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.ConnectionManager
obtainConnectionManager(PoolInfo poolInfo, boolean forceNoLazyAssoc, ResourceInfo resourceInfo)
provides connection manager for a pooljakarta.resource.spi.ManagedConnectionFactory[]
obtainManagedConnectionFactories(PoolInfo poolInfo)
Returns the MCF instances in scenarions where a pool has to return multiple mcfs.jakarta.resource.spi.ManagedConnectionFactory
obtainManagedConnectionFactory(PoolInfo poolInfo)
Returns the MCF instance.jakarta.resource.spi.ManagedConnectionFactory
obtainManagedConnectionFactory(PoolInfo poolInfo, Hashtable env)
Returns the MCF instance.boolean
pingConnectionPool(PoolInfo poolInfo)
Tests whether the configuration for the pool is valid by making a connection.void
postConstruct()
The component has been injected with any dependency and will be placed into commission by the subsystem.void
preDestroy()
The component is about to be removed from commissionboolean
reconfigureConnectorConnectionPool(ConnectorConnectionPool ccp, Set excludedProps)
Reconfigure a connection pool.void
recreateConnectorConnectionPool(ConnectorConnectionPool ccp)
Recreate a connector connection pool.void
registerConnectorApplication(ConnectorApplication rarModule)
register the connector application with registryvoid
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
registerMailSessions(Application application)
void
removeWorkManagerProxy(String moduleName)
void
shutdownAllActiveResourceAdapters()
Shut down all active resource adaptersvoid
switchOnMatching(String rarName, PoolInfo poolInfo)
Causes pool to switch on the matching of connections.void
switchOnMatchingInJndi(PoolInfo poolInfo)
Causes matching to be switched on the ConnectorConnectionPool bound in JNDIvoid
undeployResourcesOfModule(String rarName)
undeploy resources of the modulevoid
unregisterConnectorApplication(String rarName)
unregister the connector application from registryvoid
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.void
unRegisterMailSessions(Application application)
-
-
-
Method Detail
-
getRuntime
public static ConnectorRuntime getRuntime()
Returns the ConnectorRuntime instance. It follows singleton pattern and only one instance exists at any point of time. External entities need to call this method to get ConnectorRuntime instance- Returns:
- ConnectorRuntime instance
-
getProbeProviderUtil
public ConnectionPoolProbeProviderUtil getProbeProviderUtil()
-
getResourceNamingService
public ResourceNamingService getResourceNamingService()
-
getEnvironment
public ProcessEnvironment.ProcessType getEnvironment()
Returns the execution environment.- Specified by:
getEnvironment
in interfaceConnectorRuntime
- Returns:
- ConnectorConstants.SERVER if execution environment is appserv runtime else it returns ConnectorConstants.CLIENT
-
getMonitoringBootstrap
public MonitoringBootstrap getMonitoringBootstrap()
-
getDefaultPoolName
public String getDefaultPoolName(String moduleName, String connectionDefName)
Returns the generated default connection poolName for a connection definition.- Parameters:
moduleName
- rar module nameconnectionDefName
- connection definition name- Returns:
- generated connection poolname
-
deleteConnectorConnectionPool
public void deleteConnectorConnectionPool(PoolInfo poolInfo) throws ConnectorRuntimeException
Deletes connector Connection pool- Parameters:
poolInfo
- Name of the pool to delete- Throws:
ConnectorRuntimeException
- if pool deletion operation fails
-
createConnectorConnectionPool
public void createConnectorConnectionPool(ConnectorConnectionPool connectorPoolObj) throws ConnectorRuntimeException
Creates connector connection pool in the connector container.- Parameters:
connectorPoolObj
- ConnectorConnectionPool instance to be bound to JNDI. This object contains the pool properties.- Throws:
ConnectorRuntimeException
- When creation of pool fails.
-
createConnectorResource
public void createConnectorResource(ResourceInfo resourceInfo, PoolInfo poolInfo, String resourceType) throws ConnectorRuntimeException
Creates the connector resource on a given connection pool- Parameters:
resourceInfo
- JNDI name of the resource to be createdpoolInfo
- to which the connector resource belongs.resourceType
- Unused.- Throws:
ConnectorRuntimeException
- If the resouce creation fails.
-
getDefaultResourceName
public String getDefaultResourceName(String moduleName, String connectionDefName)
Returns the generated default connector resource for a connection definition.- Parameters:
moduleName
- rar module nameconnectionDefName
- connection definition name- Returns:
- generated default connector resource name
-
getResourceAdapterLogWriter
public PrintWriter getResourceAdapterLogWriter()
Provides resource adapter log writer to be given to MCF of a resource-adapter- Returns:
- PrintWriter
-
deleteConnectorResource
public void deleteConnectorResource(ResourceInfo resourceInfo) throws ConnectorRuntimeException
Deletes the connector resource.- Parameters:
resourceInfo
- JNDI name of the resource to delete.- Throws:
ConnectorRuntimeException
- if connector resource deletion fails.
-
getConnectorDescriptor
public ConnectorDescriptor getConnectorDescriptor(String rarName) throws ConnectorRuntimeException
Obtains the connector Descriptor pertaining to rar. If ConnectorDescriptor is present in registry, it is obtained from registry and returned. Else it is explicitly read from directory where rar is exploded.- Specified by:
getConnectorDescriptor
in interfaceConnectorRuntime
- Parameters:
rarName
- Name of the rar- Returns:
- ConnectorDescriptor pertaining to rar.
- Throws:
ConnectorRuntimeException
- when unable to get descriptor
-
createActiveResourceAdapter
public void createActiveResourceAdapter(String moduleDir, 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.- Specified by:
createActiveResourceAdapter
in interfaceConnectorRuntime
- Parameters:
moduleDir
- Directory where rar module is exploded.moduleName
- Name of the moduleloader
- Classloader used to load the .rar- Throws:
ConnectorRuntimeException
- if creation fails.
-
createActiveResourceAdapter
public void createActiveResourceAdapter(ConnectorDescriptor connectorDescriptor, String moduleName, String moduleDir, ClassLoader loader) throws ConnectorRuntimeException
- Throws:
ConnectorRuntimeException
-
createActiveResourceAdapter
public void createActiveResourceAdapter(ConnectorDescriptor connectorDescriptor, String moduleName, String moduleDir) throws ConnectorRuntimeException
Creates Active resource Adapter which abstracts the rar module. During the creation of ActiveResourceAdapter, default pools and resources also are created.- Parameters:
connectorDescriptor
- object which abstracts the connector deployment descriptor i.e rar.xml and sun-ra.xml.moduleName
- Name of the modulemoduleDir
- Directory where rar module is exploded.- Throws:
ConnectorRuntimeException
- if creation fails.
-
destroyActiveResourceAdapter
public void destroyActiveResourceAdapter(String moduleName) throws ConnectorRuntimeException
Destroys/deletes the Active resource adapter object from the connector container. Active resource adapter abstracts the rar deployed.- Specified by:
destroyActiveResourceAdapter
in interfaceConnectorRuntime
- Parameters:
moduleName
- Name of the rarModule to destroy/delete- Throws:
ConnectorRuntimeException
- if the deletion fails
-
obtainManagedConnectionFactory
public 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.- Specified by:
obtainManagedConnectionFactory
in interfaceConnectorRuntime
- 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
public jakarta.resource.spi.ManagedConnectionFactory obtainManagedConnectionFactory(PoolInfo poolInfo, Hashtable env) 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.- Specified by:
obtainManagedConnectionFactory
in interfaceConnectorRuntime
- Parameters:
poolInfo
- Name of the pool.MCF pertaining to this pool is created/returned.env
- Environment entries to use for lookup- Returns:
- created/already present MCF instance
- Throws:
ConnectorRuntimeException
- if creation/retrieval of MCF fails
-
obtainManagedConnectionFactories
public jakarta.resource.spi.ManagedConnectionFactory[] obtainManagedConnectionFactories(PoolInfo poolInfo) throws ConnectorRuntimeException
Returns the MCF instances in scenarions where a pool has to return multiple mcfs. Should be used only during JMS RA recovery.- Parameters:
poolInfo
- Name of the pool.MCFs pertaining to this pool is created/returned.- Returns:
- created MCF instances
- Throws:
ConnectorRuntimeException
- if creation/retrieval of MCFs fails
-
obtainConnectionManager
public jakarta.resource.spi.ConnectionManager obtainConnectionManager(PoolInfo poolInfo, boolean forceNoLazyAssoc, ResourceInfo resourceInfo) throws ConnectorRuntimeException
provides connection manager for a pool- Parameters:
poolInfo
- pool nameforceNoLazyAssoc
- when set to true, lazy association feature will be turned off (even if it is ON via pool attribute)- Returns:
- ConnectionManager for the pool
- Throws:
ConnectorRuntimeException
- when unable to provide a connection manager
-
lookupPMResource
public 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"- Specified by:
lookupPMResource
in interfaceConnectorRuntime
- 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
public 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"- Specified by:
lookupPMResource
in interfaceConnectorRuntime
- 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
public 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.- Specified by:
lookupNonTxResource
in interfaceConnectorRuntime
- 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
public 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.- Specified by:
lookupNonTxResource
in interfaceConnectorRuntime
- 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.
-
getConnection
public Connection getConnection(ResourceInfo resourceInfo, String user, String password) throws SQLException
Get a sql connection from the DataSource specified by the jdbcJndiName. This API is intended to be used in the DAS. The motivation for having this API is to provide the CMP backend a means of acquiring a connection during the codegen phase. If a user is trying to deploy an 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
- the jndi name of the resource being used to get Connection from This resource can either be a pmf resource or a jdbc resourceuser
- the user used to authenticate this requestpassword
- the password used to authenticate this request- Returns:
- a java.sql.Connection
- Throws:
SQLException
- in case of errors
-
getConnection
public Connection getConnection(ResourceInfo resourceInfo) throws SQLException
Get a sql connection from the DataSource specified by the jdbcJndiName. This API is intended to be used in the DAS. The motivation for having this API is to provide the CMP backend a means of acquiring a connection during the codegen phase. If a user is trying to deploy an 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
- the jndi name of the resource being used to get Connection from This resource can either be a pmf resource or a jdbc resource- Returns:
- a java.sql.Connection
- Throws:
SQLException
- in case of errors
-
getConnectionDefinitionPropertiesAndDefaults
public 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.- Specified by:
getConnectionDefinitionPropertiesAndDefaults
in interfaceConnectorRuntime
- 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
public Map<String,String> getBuiltInCustomResources()
Provides the list of built in custom resources by resource-type and factory-class-name pair.- Specified by:
getBuiltInCustomResources
in interfaceConnectorRuntime
- Returns:
- map of resource-type & factory-class-name
-
getSystemConnectorsAllowingPoolCreation
public String[] getSystemConnectorsAllowingPoolCreation()
Returns the system RAR names that allow pool creation- Specified by:
getSystemConnectorsAllowingPoolCreation
in interfaceConnectorRuntime
- Returns:
- String array representing list of system-rars
-
getConnectionDefinitionNames
public String[] getConnectionDefinitionNames(String rarName) throws ConnectorRuntimeException
Obtains all the Connection definition names of a rar- Specified by:
getConnectionDefinitionNames
in interfaceConnectorRuntime
- Parameters:
rarName
- rar moduleName- Returns:
- Array of connection definition names.
- Throws:
ConnectorRuntimeException
- when unable to obtain connection definition from descriptor.
-
getSecurityPermissionSpec
public 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- Specified by:
getSecurityPermissionSpec
in interfaceConnectorRuntime
- Parameters:
moduleName
- rar module Name- Returns:
- security permission spec
- Throws:
ConnectorRuntimeException
- If rar.xml parsing or annotation processing fails.
-
getAdminObjectInterfaceNames
public String[] getAdminObjectInterfaceNames(String rarName) throws ConnectorRuntimeException
Obtains all the Admin object interface names of a rar- Specified by:
getAdminObjectInterfaceNames
in interfaceConnectorRuntime
- Parameters:
rarName
- rar moduleName- Returns:
- Array of admin object interface names.
- Throws:
ConnectorRuntimeException
- when unable to obtain admin object interface names
-
getAdminObjectClassNames
public String[] getAdminObjectClassNames(String rarName, String intfName) throws ConnectorRuntimeException
Obtains all the Admin object implementation class names of the admin-object-interface for a rar- Specified by:
getAdminObjectClassNames
in interfaceConnectorRuntime
- 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
public boolean hasAdminObject(String rarName, String intfName, String className) throws ConnectorRuntimeException
checks whether the specified intfName, className has presence in admin objects of the RAR- Specified by:
hasAdminObject
in interfaceConnectorRuntime
- 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
public 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- Specified by:
getResourceAdapterConfigProps
in interfaceConnectorRuntime
- Parameters:
rarName
- rar module name- Returns:
- Resource adapter javabean properties with default values.
- Throws:
ConnectorRuntimeException
- if property retrieval fails.
-
getMCFConfigProps
public 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- Specified by:
getMCFConfigProps
in interfaceConnectorRuntime
- Parameters:
rarName
- rar module nameconnectionDefName
- connection-definition-name- Returns:
- managed connection factory javabean properties with default values.
- Throws:
ConnectorRuntimeException
- if property retrieval fails.
-
getAdminObjectConfigProps
public 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- Specified by:
getAdminObjectConfigProps
in interfaceConnectorRuntime
- Parameters:
rarName
- rar module nameadminObjectIntf
- admin-object-interface name- Returns:
- admin object javabean properties with default values.
- Throws:
ConnectorRuntimeException
- if property retrieval fails.
-
getAdminObjectConfigProps
public 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- Specified by:
getAdminObjectConfigProps
in interfaceConnectorRuntime
- 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
public 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.- Specified by:
getConnectorConfigJavaBeans
in interfaceConnectorRuntime
- 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
public String getActivationSpecClass(String rarName, String messageListenerType) throws ConnectorRuntimeException
Return the ActivationSpecClass name for given rar and messageListenerType- Specified by:
getActivationSpecClass
in interfaceConnectorRuntime
- 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
public String[] getMessageListenerTypes(String rarName) throws ConnectorRuntimeException
Parses the ra.xml, processes the annotated rar artificats if any and returns all the Message listener types.- Specified by:
getMessageListenerTypes
in interfaceConnectorRuntime
- 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
public 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.- Specified by:
getMessageListenerConfigProps
in interfaceConnectorRuntime
- 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
public 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.- Specified by:
getMessageListenerConfigPropTypes
in interfaceConnectorRuntime
- 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
-
switchOnMatching
public void switchOnMatching(String rarName, PoolInfo poolInfo)
Causes pool to switch on the matching of connections. It can be either directly on the pool or on the ConnectorConnectionPool object that is bound in JNDI.- Parameters:
rarName
- Name of Resource Adpater.poolInfo
- Name of the pool.
-
switchOnMatchingInJndi
public void switchOnMatchingInJndi(PoolInfo poolInfo) throws ConnectorRuntimeException
Causes matching to be switched on the ConnectorConnectionPool bound in JNDI- Parameters:
poolInfo
- Name of the pool- Throws:
ConnectorRuntimeException
- when unable to set matching via jndi object
-
getNamingManager
public GlassfishNamingManager getNamingManager()
-
postConstruct
public void postConstruct()
The component has been injected with any dependency and will be placed into commission by the subsystem.- Specified by:
postConstruct
in interfaceorg.glassfish.hk2.api.PostConstruct
-
isConnectorConnectionPoolDeployed
public boolean isConnectorConnectionPoolDeployed(PoolInfo poolInfo)
Checks if a conncetor connection pool has been deployed to this server instance- Parameters:
poolInfo
- connection pool name- Returns:
- boolean indicating whether the resource is deployed or not
-
reconfigureConnectorConnectionPool
public boolean reconfigureConnectorConnectionPool(ConnectorConnectionPool ccp, Set excludedProps) throws ConnectorRuntimeException
Reconfigure a connection pool. This method compares the passed connector connection pool with the one in memory. If the pools are unequal and the MCF properties are changed a pool recreate is required. However if the pools are unequal and the MCF properties are not changed a recreate is not required- Parameters:
ccp
- - the Updated connector connection pool object that admin hands overexcludedProps
- - A set of excluded property names that we want to be excluded in the comparison check while comparing MCF properties- Returns:
- true - if a pool restart is required, false otherwise
- Throws:
ConnectorRuntimeException
- when unable to reconfigure ccp
-
recreateConnectorConnectionPool
public void recreateConnectorConnectionPool(ConnectorConnectionPool ccp) throws ConnectorRuntimeException
Recreate a connector connection pool. This method essentially does the following things: 1. Delete the said connector connection pool
2. Bind the pool to JNDI
3. Create an MCF for this pool and register with the connector registry- Parameters:
ccp
- - the ConnectorConnectionPool to publish- Throws:
ConnectorRuntimeException
- when unable to recreate ccp
-
createConnectorConnectionPool
public void createConnectorConnectionPool(ConnectorConnectionPool ccp, String connectionDefinitionName, String rarName, List<Property> props, List<SecurityMap> securityMaps) throws ConnectorRuntimeException
Creates connector connection pool in the connector container.- Parameters:
ccp
- ConnectorConnectionPool instance to be bound to JNDI. This object contains the pool properties.connectionDefinitionName
- Connection definition name against which connection pool is being createdrarName
- Name of the resource adapterprops
- Properties of MCF which are present in domain.xml These properties override the ones present in ra.xmlsecurityMaps
- Array fo security maps.- Throws:
ConnectorRuntimeException
- When creation of pool fails.
-
cleanUpResourcesAndShutdownAllActiveRAs
public void cleanUpResourcesAndShutdownAllActiveRAs()
Shut down all pools and active resource-adapters- Specified by:
cleanUpResourcesAndShutdownAllActiveRAs
in interfaceConnectorRuntime
-
shutdownAllActiveResourceAdapters
public void shutdownAllActiveResourceAdapters()
Shut down all active resource adapters- Specified by:
shutdownAllActiveResourceAdapters
in interfaceConnectorRuntime
-
getPoolManager
public PoolManager getPoolManager()
-
getInvocationManager
public InvocationManager getInvocationManager()
provides the invocationManager- Specified by:
getInvocationManager
in interfaceConnectorRuntime
- Returns:
- InvocationManager
-
getTimer
public Timer getTimer()
-
getResourceReferenceDescriptor
public Set getResourceReferenceDescriptor()
get resource reference descriptors from current component's jndi environment- Specified by:
getResourceReferenceDescriptor
in interfaceConnectorRuntime
- Returns:
- set of resource-refs
-
preDestroy
public void preDestroy()
The component is about to be removed from commission- Specified by:
preDestroy
in interfaceorg.glassfish.hk2.api.PreDestroy
-
getAuthenticationService
public AuthenticationService getAuthenticationService(String rarName, PoolInfo poolInfo)
Obtain the authentication service associated with rar module. Currently only the BasicPassword authentication is supported.- Parameters:
rarName
- Rar module NamepoolInfo
- Name of the pool. Used for creation of BasicPasswordAuthenticationService- Returns:
- AuthenticationService connector runtime's authentication service
-
isEmbedded
public boolean isEmbedded()
Checks whether the executing environment is embedded- Specified by:
isEmbedded
in interfaceConnectorRuntime
- Returns:
- true if execution environment is embedded
-
isNonACCRuntime
public boolean isNonACCRuntime()
Checks whether the executing environment is non-acc (standalone)- Returns:
- true if execution environment is non-acc (standalone)
-
isServer
public boolean isServer()
Checks whether the executing environment is application server- Specified by:
isServer
in interfaceConnectorRuntime
- Returns:
- true if execution environment is server false if it is client
-
isACCRuntime
public boolean isACCRuntime()
Checks whether the executing environment is appclient container runtime- Returns:
- true if execution environment is appclient container false if it is not ACC
-
getTransaction
public jakarta.transaction.Transaction getTransaction() throws jakarta.transaction.SystemException
provides the current transaction- Returns:
- Transaction
- Throws:
jakarta.transaction.SystemException
- when unable to get the transaction
-
getTransactionManager
public JavaEETransactionManager getTransactionManager()
provides the transactionManager- Specified by:
getTransactionManager
in interfaceConnectorRuntime
- Returns:
- TransactionManager
-
registerConnectorNamingEventListener
public void registerConnectorNamingEventListener(ConnectorNamingEventListener listener)
register the connector naming event listener- Specified by:
registerConnectorNamingEventListener
in interfaceConnectorRuntime
- Parameters:
listener
- connector-naming-event-listener
-
unregisterConnectorNamingEventListener
public void unregisterConnectorNamingEventListener(ConnectorNamingEventListener listener)
unregister the connector naming event listner- Specified by:
unregisterConnectorNamingEventListener
in interfaceConnectorRuntime
- Parameters:
listener
- connector-naming-event-listener
-
getConnectionPoolConfig
public ResourcePool getConnectionPoolConfig(PoolInfo poolInfo)
Description copied from interface:ConnectorRuntime
Provide the configuration of the pool- Specified by:
getConnectionPoolConfig
in interfaceConnectorRuntime
- Returns:
- ResourcePool connection pool configuration
-
pingConnectionPool
public boolean pingConnectionPool(PoolInfo poolInfo) throws jakarta.resource.ResourceException
Description copied from interface:ConnectorRuntime
Tests whether the configuration for the pool is valid by making a connection.- Specified by:
pingConnectionPool
in interfaceConnectorRuntime
- Returns:
- boolean indicating ping status
- Throws:
jakarta.resource.ResourceException
- when unable to ping
-
getPoolType
public ConnectorConstants.PoolType getPoolType(PoolInfo poolInfo) throws ConnectorRuntimeException
- Throws:
ConnectorRuntimeException
-
getWorkManagerProxy
public jakarta.resource.spi.work.WorkManager getWorkManagerProxy(String poolId, String moduleName, ClassLoader rarCL) throws ConnectorRuntimeException
provides work manager proxy that is Serializable- Parameters:
poolId
- ThreadPoolIdmoduleName
- resource-adapter namerarCL
- classloader of the resource-adapter- Returns:
- WorkManager
- Throws:
ConnectorRuntimeException
- when unable to get work manager
-
getXATerminatorProxy
public jakarta.resource.spi.XATerminator getXATerminatorProxy(String moduleName)
provides XATerminator proxy that is Serializable- Parameters:
moduleName
- resource-adapter name- Returns:
- XATerminator
-
removeWorkManagerProxy
public void removeWorkManagerProxy(String moduleName)
-
addAdminObject
public void addAdminObject(String appName, String connectorName, ResourceInfo resourceInfo, String adminObjectType, String adminObjectClassName, Properties props) throws ConnectorRuntimeException
- Throws:
ConnectorRuntimeException
-
deleteAdminObject
public void deleteAdminObject(ResourceInfo resourceInfo) throws ConnectorRuntimeException
- Throws:
ConnectorRuntimeException
-
getSystemRARClassLoader
public ClassLoader getSystemRARClassLoader(String rarName) throws ConnectorRuntimeException
- Throws:
ConnectorRuntimeException
-
createConnectorClassLoader
public ClassLoader createConnectorClassLoader(String moduleDirectory, ClassLoader parent, String rarModuleName) throws ConnectorRuntimeException
Given the module directory, creates a connector-class-finder (class-loader) for the module- Specified by:
createConnectorClassLoader
in interfaceConnectorRuntime
- 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
-
getResourceDeployer
public ResourceDeployer getResourceDeployer(Object resource)
-
addResourceAdapterConfig
public void addResourceAdapterConfig(String rarName, ResourceAdapterConfig raConfig) throws ConnectorRuntimeException
Add the resource adapter configuration to the connector registry- Parameters:
rarName
- rarmoduleraConfig
- Resource Adapter configuration object- Throws:
ConnectorRuntimeException
- if the addition fails.
-
deleteResourceAdapterConfig
public void deleteResourceAdapterConfig(String rarName) throws ConnectorRuntimeException
Delete the resource adapter configuration to the connector registry- Parameters:
rarName
- rarmodule- Throws:
ConnectorRuntimeException
-
registerConnectorApplication
public void registerConnectorApplication(ConnectorApplication rarModule)
register the connector application with registry- Parameters:
rarModule
- resource-adapter module
-
unregisterConnectorApplication
public void unregisterConnectorApplication(String rarName)
unregister the connector application from registry- Parameters:
rarName
- resource-adapter name
-
undeployResourcesOfModule
public void undeployResourcesOfModule(String rarName)
undeploy resources of the module- Parameters:
rarName
- resource-adapter name
-
deployResourcesOfModule
public void deployResourcesOfModule(String rarName)
deploy resources of the module- Parameters:
rarName
- resource-adapter name
-
getActiveRAFactory
public ActiveRAFactory getActiveRAFactory()
-
getApplications
public Applications getApplications()
-
getAppRegistry
public ApplicationRegistry getAppRegistry()
-
getApplicationArchivist
public ApplicationArchivist getApplicationArchivist()
-
getFileArchive
public FileArchive getFileArchive()
-
getDomain
public Domain getDomain()
-
getServerEnvironment
public ServerEnvironment getServerEnvironment()
-
createActiveResourceAdapterForEmbeddedRar
public void createActiveResourceAdapterForEmbeddedRar(String rarModuleName) throws ConnectorRuntimeException
Description copied from interface:ConnectorRuntime
Creates Active resource Adapter which abstracts the rar module. During the creation of ActiveResourceAdapter, default pools and resources also are created.- Specified by:
createActiveResourceAdapterForEmbeddedRar
in interfaceConnectorRuntime
- Parameters:
rarModuleName
- Name of the module- Throws:
ConnectorRuntimeException
- if creation fails.
-
checkAccessibility
public boolean checkAccessibility(String rarName, ClassLoader loader)
Check whether ClassLoader is permitted to access this resource adapter. If the RAR is deployed and is not a standalone RAR, then only the ClassLoader that loaded the archive (any of its child) should be able to access it. Otherwise everybody can access the RAR.- Parameters:
rarName
- Resource adapter module name.loader
-ClassLoader
to verify.
-
loadDeferredResourceAdapter
public void loadDeferredResourceAdapter(String rarName) throws ConnectorRuntimeException
- Throws:
ConnectorRuntimeException
-
getSecurityRoleMapperFactory
public SecurityRoleMapperFactory getSecurityRoleMapperFactory()
-
getCallbackHandler
public CallbackHandler getCallbackHandler()
provides container's (application server's) callback handler- Specified by:
getCallbackHandler
in interfaceConnectorRuntime
- Returns:
- container callback handler
-
getConnectorArchvist
public ConnectorArchivist getConnectorArchvist() throws ConnectorRuntimeException
- Throws:
ConnectorRuntimeException
-
getWorkContextHandler
public WorkContextHandler getWorkContextHandler()
-
getComponentEnvManager
public ComponentEnvManager getComponentEnvManager()
-
getConnectorClassLoader
public DelegatingClassLoader getConnectorClassLoader()
provides connector class loader- Specified by:
getConnectorClassLoader
in interfaceConnectorRuntime
- Returns:
- ClassLoader
-
getClassLoaderHierarchy
public ClassLoaderHierarchy getClassLoaderHierarchy()
-
registerDataSourceDefinitions
public 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- Specified by:
registerDataSourceDefinitions
in interfaceConnectorRuntime
- Parameters:
application
- Application being deployed.
-
unRegisterDataSourceDefinitions
public 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- Specified by:
unRegisterDataSourceDefinitions
in interfaceConnectorRuntime
- Parameters:
application
- Application being undeployed.
-
registerMailSessions
public void registerMailSessions(Application application)
-
unRegisterMailSessions
public void unRegisterMailSessions(Application application)
-
getWorkSecurityMap
public List<WorkSecurityMap> getWorkSecurityMap(String raName)
get work security maps for a resource-adapter-name- Specified by:
getWorkSecurityMap
in interfaceConnectorRuntime
- Parameters:
raName
- resource-adapter name- Returns:
- all work security maps of a resource-adapter
-
getResources
public Resources getResources(ResourceInfo resourceInfo)
-
getResources
public Resources getResources()
-
getShutdownTimeout
public long getShutdownTimeout()
Description copied from interface:ConnectorRuntime
Gets the shutdown-timeout attribute configured inconnector-service
- Specified by:
getShutdownTimeout
in interfaceConnectorRuntime
- Returns:
- long shutdown timeout (in milli-seconds)
-
flushConnectionPool
public boolean flushConnectionPool(String poolName) throws ConnectorRuntimeException
Flush Connection pool by reinitializing the connections established in the pool.- Specified by:
flushConnectionPool
in interfaceConnectorRuntime
- Parameters:
poolName
-- Throws:
ConnectorRuntimeException
-
flushConnectionPool
public boolean flushConnectionPool(PoolInfo poolInfo) throws ConnectorRuntimeException
Flush Connection pool by reinitializing the connections established in the pool.- Specified by:
flushConnectionPool
in interfaceConnectorRuntime
- Parameters:
poolInfo
-- Throws:
ConnectorRuntimeException
-
getJdbcDriverClassNames
public Set<String> getJdbcDriverClassNames(String dbVendor, String resType)
Get jdbc driver implementation class names list for the dbVendor and resource type supplied.- Specified by:
getJdbcDriverClassNames
in interfaceConnectorRuntime
- Parameters:
dbVendor
-resType
-- Returns:
- all jdbc driver implementation class names
-
getJdbcDriverClassNames
public Set<String> getJdbcDriverClassNames(String dbVendor, String resType, boolean introspect)
Get jdbc driver implementation class names list for the dbVendor and resource type supplied. If introspect is true, classnames are got from introspection of the jdbc driver jar. Else a pre-defined list is used to retrieve the class names.- Specified by:
getJdbcDriverClassNames
in interfaceConnectorRuntime
- Parameters:
dbVendor
-resType
-introspect
-- Returns:
- all jdbc driver implementation class names
-
getConnectorBeanValidator
public ConnectorJavaBeanValidator getConnectorBeanValidator()
returns the bean validator that can be used to validate various connector bean artifacts (ResourceAdapter, ManagedConnetionFactory, AdministeredObject, ActivationSpec)- Returns:
- ConnectorBeanValidator
-
getPingDuringPoolCreation
public boolean getPingDuringPoolCreation(PoolInfo poolInfo)
Check if ping is on during pool creation.- Specified by:
getPingDuringPoolCreation
in interfaceConnectorRuntime
- Parameters:
poolInfo
-- Returns:
-
getDatabaseVendorNames
public Set<String> getDatabaseVendorNames()
Get jdbc database vendor names list.- Specified by:
getDatabaseVendorNames
in interfaceConnectorRuntime
- Returns:
- set of common database vendor names
-
isJdbcPoolMonitoringEnabled
public boolean isJdbcPoolMonitoringEnabled()
-
isConnectorPoolMonitoringEnabled
public boolean isConnectorPoolMonitoringEnabled()
-
associateResourceAdapter
public void associateResourceAdapter(String rarName, jakarta.resource.spi.ResourceAdapterAssociation raa) throws jakarta.resource.ResourceException
Description copied from interface:ConnectorRuntime
associates the given instance of ResourceAdapterAssociation with the ResourceAdapter java-bean of the specified RAR- Specified by:
associateResourceAdapter
in interfaceConnectorRuntime
- 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.
-
getGlobalResourceManager
public ResourceManager getGlobalResourceManager()
-
getConfidentialProperties
public List<String> getConfidentialProperties(String rarName, String type, String... keyFields) throws ConnectorRuntimeException
Description copied from interface:ConnectorRuntime
Retrieve the "confidential" config properties of specified artifact from a resource-adapter- Specified by:
getConfidentialProperties
in interfaceConnectorRuntime
- 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
-
-