public class ConnectorConnectionPoolAdminServiceImpl extends ConnectorService
ConnectorConstants.PoolTypeResourceConstants.TriState_logger, _registry, _runtimeACCESS_ALL_RARS, ADMINISTERED_OBJECT_FACTORY, AIRA, AO, AOR, AORA, CAUTION_MESSAGE, CCP, CLASSLOADING_POLICY_DERIVED_ACCESS, CLASSLOADING_POLICY_GLOBAL_ACCESS, 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_STRINGADMINISTERED_OBJECT_DEFINITION_JNDINAME_PREFIX, APP_META_DATA_RESOURCES, APP_SCOPED_RESOURCES_JNDI_NAMES, APP_SCOPED_RESOURCES_MAP, APP_SCOPED_RESOURCES_RA_NAMES, 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 and Description |
|---|
ConnectorConnectionPoolAdminServiceImpl()
Default constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
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 |
deleteConnectorConnectionPool(PoolInfo poolInfo)
Deletes connector Connection pool
|
void |
deleteConnectorConnectionPool(PoolInfo poolInfo,
boolean cascade)
Deletes connector Connection pool.
|
boolean |
flushConnectionPool(PoolInfo poolInfo)
Flush Connection pool by reinitializing the connections
established in the pool.
|
Connection |
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.
|
static 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.
|
protected Subject |
getDefaultSubject(PoolInfo poolInfo,
javax.resource.spi.ManagedConnectionFactory mcf,
ResourcePrincipal prin)
Utility method that is used to get the default subject for the
specified mcf and resource principal.
|
protected javax.resource.spi.ManagedConnection |
getManagedConnection(javax.resource.spi.ManagedConnectionFactory mcf,
Subject defaultSubject,
javax.resource.spi.ConnectionRequestInfo cReqInfo)
Utility method to get Managed connection from the supplied mcf and
default subject.
|
ConnectorConstants.PoolType |
getPoolType(PoolInfo poolInfo) |
String |
getPropertyValue(String prop,
ConnectorConnectionPool connectorConnectionPool)
Utility method to get property value from ConnectorDescriptorInfo.
|
Object |
getUnpooledConnection(PoolInfo poolInfo,
ResourcePrincipal principal,
boolean returnConnectionHandle)
This method is used to provide backend functionality for the
ping-connection-pool asadmin command.
|
boolean |
isConnectorConnectionPoolDeployed(PoolInfo poolInfo)
Checks if a conncetor connection pool has been deployed to this server
instance
|
void |
killPool(PoolInfo poolInfo)
Kills a specific pool
|
javax.resource.spi.ManagedConnectionFactory[] |
obtainManagedConnectionFactories(PoolInfo poolInfo)
Returns the MCF instances.
|
javax.resource.spi.ManagedConnectionFactory |
obtainManagedConnectionFactory(PoolInfo poolInfo) |
javax.resource.spi.ManagedConnectionFactory |
obtainManagedConnectionFactory(PoolInfo poolInfo,
Hashtable env)
Returns the MCF instance.
|
boolean |
reconfigureConnectorConnectionPool(ConnectorConnectionPool ccp,
Set excludedProps)
Reconfigure a connection pool.
|
void |
recreateConnectorConnectionPool(ConnectorConnectionPool ccp)
Recreate a connector connection pool.
|
void |
switchOnMatching(PoolInfo poolInfo)
Rebinds the connection pool with matchning flag set.
|
boolean |
testConnectionPool(PoolInfo poolInfo)
asadmin test-connection-pool
This method is used to provide backend functionality for the
test-connection-pool asadmin command.
|
checkAccessibility, checkAndLoadPool, createActiveResourceAdapterForEmbeddedRar, getConnectorDescriptor, getDefaultPoolName, getDefaultResourceName, getResourcesUtil, ifSystemRarLoad, loadDeferredResourceAdapter, loadDeferredResources, loadResourcesAndItsRar, switchOnMatchingpublic ConnectorConnectionPoolAdminServiceImpl()
public void createConnectorConnectionPool(ConnectorConnectionPool connectorPoolObj) throws ConnectorRuntimeException
connectorPoolObj - ConnectorConnectionPool instance to be bound to JNDI. This
object contains the pool properties.ConnectorRuntimeException - When creation of pool fails.public void deleteConnectorConnectionPool(PoolInfo poolInfo) throws ConnectorRuntimeException
poolInfo - Name of the pool to deleteConnectorRuntimeException - if pool deletion operation failspublic void deleteConnectorConnectionPool(PoolInfo poolInfo, boolean cascade) throws ConnectorRuntimeException
poolInfo - Name of the pool to deletecascade - If true all the resources associed with that are also
deleted from connector container
If false and if some resources pertaining to pool
are present deletion operation fails . If no resources
are present pool is deleted.ConnectorRuntimeException - if pool deletion operation failspublic void killPool(PoolInfo poolInfo)
poolInfo - poolName to killpublic static Map<String,Object> getConnectionDefinitionPropertiesAndDefaults(String connectionDefinitionClassName, String resType)
connectionDefinitionClassName - The Connection Definition Java bean class for which
overrideable properties are required.public boolean testConnectionPool(PoolInfo poolInfo) throws javax.resource.ResourceException
poolInfo - connection-pool namejavax.resource.ResourceException - if pool is not usableprotected Subject getDefaultSubject(PoolInfo poolInfo, javax.resource.spi.ManagedConnectionFactory mcf, ResourcePrincipal prin) throws javax.resource.ResourceException
poolInfo - mcf - prin - javax.resource.ResourceExceptionprotected javax.resource.spi.ManagedConnection getManagedConnection(javax.resource.spi.ManagedConnectionFactory mcf,
Subject defaultSubject,
javax.resource.spi.ConnectionRequestInfo cReqInfo)
throws javax.resource.ResourceException
mcf - defaultSubject - javax.resource.ResourceExceptionpublic Object getUnpooledConnection(PoolInfo poolInfo, ResourcePrincipal principal, boolean returnConnectionHandle) throws javax.resource.ResourceException
poolInfo - The poolname from whose MCF to obtain the unpooled mcprincipal - The ResourcePrincipal to use for authenticating the request if not null.
If null, the pool's default authentication mechanism is usedreturnConnectionHandle - If true will return the logical connection handle
derived from the Managed Connection, else will only return mcjavax.resource.ResourceException - for various error conditionspublic String getPropertyValue(String prop, ConnectorConnectionPool connectorConnectionPool)
prop - public void switchOnMatching(PoolInfo poolInfo) throws ConnectorRuntimeException
poolInfo - pool for which matching need to be switched onConnectorRuntimeException - , if a Naming error occurs.public javax.resource.spi.ManagedConnectionFactory[] obtainManagedConnectionFactories(PoolInfo poolInfo) throws ConnectorRuntimeException
poolInfo - Name of the pool.MCF pertaining to this pool is
created/returned.ConnectorRuntimeException - if creation/retrieval of MCF failspublic javax.resource.spi.ManagedConnectionFactory obtainManagedConnectionFactory(PoolInfo poolInfo) throws ConnectorRuntimeException
ConnectorRuntimeExceptionpublic javax.resource.spi.ManagedConnectionFactory obtainManagedConnectionFactory(PoolInfo poolInfo, Hashtable env) throws ConnectorRuntimeException
poolInfo - Name of the pool.MCF pertaining to this pool is
created/returned.ConnectorRuntimeException - if creation/retrieval of MCF failspublic ConnectorConstants.PoolType getPoolType(PoolInfo poolInfo) throws ConnectorRuntimeException
ConnectorRuntimeExceptionpublic boolean isConnectorConnectionPoolDeployed(PoolInfo poolInfo)
poolInfo - public boolean reconfigureConnectorConnectionPool(ConnectorConnectionPool ccp, Set excludedProps) throws ConnectorRuntimeException
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 propertiesConnectorRuntimeExceptionpublic void recreateConnectorConnectionPool(ConnectorConnectionPool ccp) throws ConnectorRuntimeException
ccp - - the ConnectorConnectionPool to publishConnectorRuntimeExceptionpublic void createConnectorConnectionPool(ConnectorConnectionPool ccp, String connectionDefinitionName, String rarName, List<Property> props, List<SecurityMap> securityMaps) throws ConnectorRuntimeException
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.ConnectorRuntimeException - When creation of pool fails.public boolean flushConnectionPool(PoolInfo poolInfo) throws ConnectorRuntimeException
poolInfo - ConnectorRuntimeExceptionpublic Connection getConnection(ResourceInfo resourceInfo, String user, String password) throws SQLException
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 requestSQLException - in case of errorspublic Connection getConnection(ResourceInfo resourceInfo) throws SQLException
resourceInfo - the jndi name of the resource being used to get Connection from
This resource can either be a pmf resource or a jdbc resourceSQLException - in case of errorsCopyright © 2019. All rights reserved.