Class ConnectorsUtil
- java.lang.Object
-
- com.sun.appserv.connectors.internal.api.ConnectorsUtil
-
public class ConnectorsUtil extends Object
Util class for connector related classes
-
-
Constructor Summary
Constructors Constructor Description ConnectorsUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanbelongsToJdbcRA(String raName)determine whether the RAR in question is a System RARstatic booleanbelongsToSystemRA(String raName)determine whether the RAR in question is a System RARstatic Map<String,String>convertPropertiesToMap(Properties properties)static StringderiveJndiName(String name, Hashtable env)Given the name of the resource and its jndi env, derive the complete jndi name.static StringderiveResourceName(String compId, String name, JavaEEResourceType resType)static StringescapeResourceNameForMonitoring(String name)static booleanextractRar(String fileName, String rarName, String destDir)GlassFish (Embedded) Uber jar will have .rar bundled in it.static StringgetActualModuleName(String moduleName)static Collection<String>getAllPoolNames(Collection<ConnectorConnectionPool> connectionPools)get the list of pool namesstatic Collection<ConnectorConnectionPool>getAllPoolsOfModule(String moduleName, Resources allResources)get the pools for a particular resource-adapterstatic Collection<Resource>getAllResources(Collection<String> poolNames, Resources allResources)static Collection<Resource>getAllSystemRAResourcesAndPools(Resources allResources)Get all System RAR pools and resourcesstatic Collection<WorkSecurityMap>getAllWorkSecurityMaps(Resources resources, String moduleName)static StringgetApplicationName(Resource resource)static StringgetApplicationName(DeploymentContext context)static StringgetApplicationName(PoolInfo poolInfo)static StringgetApplicationNameOfEmbeddedRar(String embeddedRarName)static Map<String,String>getBuiltInCustomResources()Provides the list of built in custom resources by resource-type and factory-class-name pair.static ResourcePoolgetConnectionPoolConfig(PoolInfo poolInfo, Resources allResources)static StringgetEmbeddedRarModuleName(String applicationName, String moduleName)static List<URI>getInstalledLibrariesFromManifest(String moduleDirectory, ServerEnvironment env)static StringgetLocation(String moduleName)static SetgetMergedActivationConfigProperties(EjbMessageBeanDescriptor msgDesc)Prepares the name/value pairs for ActivationSpec.static StringgetModuleName(EjbDescriptor descriptor)static Collection<String>getNonJdbcSystemRars()static booleangetPingDuringPoolCreation(PoolInfo poolInfo, Resources allResources)static StringgetPMJndiName(String jndiName)Return the system PM name for the JNDI namestatic ConnectorConnectionPoolgetPool(Collection<Resource> configBeanResources, String poolName)static PoolInfogetPoolInfo(ResourcePool resource)static StringgetPoolMonitoringSubTreeRoot(PoolInfo poolInfo, boolean escapeSlashes)static ResourceAdapterConfiggetRAConfig(String raName, Resources allResources)static StringgetRarNameFromApplication(String appName)static StringgetRarNameOfResource(Resource resource, Resources resources)static StringgetReservePrefixedJNDINameForDescriptor(String moduleName)static StringgetReservePrefixedJNDINameForResource(String compId, String resourceName, JavaEEResourceType resType)static StringgetResourceAdapterNameOfPool(String poolName, Resources allResources)Given the poolname, retrieve the resourceadapter namestatic <T> ResourcegetResourceByName(Resources resources, Class<T> type, String name)static ResourceInfogetResourceInfo(BindableResource resource)static Collection<BindableResource>getResourcesOfPool(Resources resources, String connectionPoolName)static longgetShutdownTimeout(ConnectorService connectorService)Gets the shutdown-timeout attribute from domain.xml via the connector server config bean.static StringgetSystemModuleLocation(String moduleName)get the installation directory of System RARsstatic Collection<String>getSystemRARs()static StringgetTransactionIsolationInt(int tranIsolation)static StringgetValidSuffix(String name)check whether the jndi Name has connector related suffix and return if any.static List<WorkSecurityMap>getWorkSecurityMaps(String raName, Resources allResources)given the ra-name, returns all the configured connector-work-security-maps for the .rarstatic booleanisApplicationScopedResource(GenericResourceInfo resourceInfo)static booleanisDynamicReconfigurationEnabled(ResourcePool pool)static booleanisEmbedded(DeploymentContext context)static ResourceConstants.TriStateisEmbeddedRarResource(Resource configBeanResource, Collection<Resource> configBeanResources)static booleanisJMSRA(String moduleName)static booleanisModuleScopedResource(GenericResourceInfo resourceInfo)static booleanisRARResource(Resource resource)static booleanisStandAloneRA(String moduleName)static booleanisValidJndiSuffix(String suffix)If the suffix is one of the valid context return true.static booleanparseBoolean(String enabled)static booleansystemRarExists(String location)
-
-
-
Method Detail
-
belongsToSystemRA
public static boolean belongsToSystemRA(String raName)
determine whether the RAR in question is a System RAR- Parameters:
raName- RarName- Returns:
- boolean
-
getPingDuringPoolCreation
public static boolean getPingDuringPoolCreation(PoolInfo poolInfo, Resources allResources)
-
belongsToJdbcRA
public static boolean belongsToJdbcRA(String raName)
determine whether the RAR in question is a System RAR- Parameters:
raName- RarName- Returns:
- boolean
-
getSystemModuleLocation
public static String getSystemModuleLocation(String moduleName)
get the installation directory of System RARs- Parameters:
moduleName- RARName- Returns:
- directory location
-
getLocation
public static String getLocation(String moduleName) throws ConnectorRuntimeException
- Throws:
ConnectorRuntimeException
-
getPMJndiName
public static String getPMJndiName(String jndiName)
Return the system PM name for the JNDI name- Parameters:
jndiName- jndi name- Returns:
- String jndi name for PM resource
-
getValidSuffix
public static String getValidSuffix(String name)
check whether the jndi Name has connector related suffix and return if any.- Parameters:
name- jndi name- Returns:
- suffix, if found
-
isValidJndiSuffix
public static boolean isValidJndiSuffix(String suffix)
If the suffix is one of the valid context return true. Return false, if that is not the case.- Parameters:
suffix- __nontx / __pm- Returns:
- boolean whether the suffix is valid or not
-
deriveJndiName
public static String deriveJndiName(String name, Hashtable env)
Given the name of the resource and its jndi env, derive the complete jndi name. (eg; with __PM / __nontx)- Parameters:
name- name of the resourceenv- env- Returns:
- derived name
-
getConnectionPoolConfig
public static ResourcePool getConnectionPoolConfig(PoolInfo poolInfo, Resources allResources)
-
getAllResources
public static Collection<Resource> getAllResources(Collection<String> poolNames, Resources allResources)
-
getAllPoolNames
public static Collection<String> getAllPoolNames(Collection<ConnectorConnectionPool> connectionPools)
get the list of pool names- Parameters:
connectionPools- list of pools- Returns:
- list of pol names
-
getAllWorkSecurityMaps
public static Collection<WorkSecurityMap> getAllWorkSecurityMaps(Resources resources, String moduleName)
-
getAllPoolsOfModule
public static Collection<ConnectorConnectionPool> getAllPoolsOfModule(String moduleName, Resources allResources)
get the pools for a particular resource-adapter- Parameters:
moduleName- resource-adapter name- Returns:
- collection of connectorConnectionPool
-
getAllSystemRAResourcesAndPools
public static Collection<Resource> getAllSystemRAResourcesAndPools(Resources allResources)
Get all System RAR pools and resources- Parameters:
allResources- all configured resources- Returns:
- Collection of system RAR pools
-
getResourceAdapterNameOfPool
public static String getResourceAdapterNameOfPool(String poolName, Resources allResources)
Given the poolname, retrieve the resourceadapter name- Parameters:
poolName- connection pool nameallResources- resources- Returns:
- resource-adapter name
-
getRAConfig
public static ResourceAdapterConfig getRAConfig(String raName, Resources allResources)
-
getWorkSecurityMaps
public static List<WorkSecurityMap> getWorkSecurityMaps(String raName, Resources allResources)
given the ra-name, returns all the configured connector-work-security-maps for the .rar- Parameters:
raName- resource-adapter nameallResources- resources- Returns:
- list of work-security-maps
-
isDynamicReconfigurationEnabled
public static boolean isDynamicReconfigurationEnabled(ResourcePool pool)
-
getMergedActivationConfigProperties
public static Set getMergedActivationConfigProperties(EjbMessageBeanDescriptor msgDesc)
Prepares the name/value pairs for ActivationSpec.Rule:
1. The name/value pairs are the union of activation-config on standard DD (message-driven) and runtime DD (mdb-resource-adapter) 2. If there are duplicate property settings, the value in runtime activation-config will overwrite the one in the standard activation-config.
-
isJMSRA
public static boolean isJMSRA(String moduleName)
-
parseBoolean
public static boolean parseBoolean(String enabled)
-
getShutdownTimeout
public static long getShutdownTimeout(ConnectorService connectorService)
Gets the shutdown-timeout attribute from domain.xml via the connector server config bean.- Parameters:
connectorService- connector-service configuration- Returns:
- long shutdown timeout (in mill-seconds)
-
getBuiltInCustomResources
public static 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
-
getTransactionIsolationInt
public static String getTransactionIsolationInt(int tranIsolation)
-
deriveResourceName
public static String deriveResourceName(String compId, String name, JavaEEResourceType resType)
-
getReservePrefixedJNDINameForResource
public static String getReservePrefixedJNDINameForResource(String compId, String resourceName, JavaEEResourceType resType)
-
convertPropertiesToMap
public static Map<String,String> convertPropertiesToMap(Properties properties)
-
getEmbeddedRarModuleName
public static String getEmbeddedRarModuleName(String applicationName, String moduleName)
-
getApplicationNameOfEmbeddedRar
public static String getApplicationNameOfEmbeddedRar(String embeddedRarName)
-
isEmbedded
public static boolean isEmbedded(DeploymentContext context)
-
getApplicationName
public static String getApplicationName(DeploymentContext context)
-
getInstalledLibrariesFromManifest
public static List<URI> getInstalledLibrariesFromManifest(String moduleDirectory, ServerEnvironment env) throws ConnectorRuntimeException
- Throws:
ConnectorRuntimeException
-
getReservePrefixedJNDINameForDescriptor
public static String getReservePrefixedJNDINameForDescriptor(String moduleName)
-
isStandAloneRA
public static boolean isStandAloneRA(String moduleName)
-
getSystemRARs
public static Collection<String> getSystemRARs()
-
getNonJdbcSystemRars
public static Collection<String> getNonJdbcSystemRars()
-
systemRarExists
public static boolean systemRarExists(String location)
-
extractRar
public static boolean extractRar(String fileName, String rarName, String destDir)
GlassFish (Embedded) Uber jar will have .rar bundled in it. This method will extract the .rar from the uber jar into specified directory. As of now, this method is only used in EMBEDDED mode- Parameters:
fileName- rar-directory-namerarName- resource-adapter namedestDir- destination directory- Returns:
- status indicating whether .rar is exploded successfully or not
-
getPoolInfo
public static PoolInfo getPoolInfo(ResourcePool resource)
-
getResourceInfo
public static ResourceInfo getResourceInfo(BindableResource resource)
-
isApplicationScopedResource
public static boolean isApplicationScopedResource(GenericResourceInfo resourceInfo)
-
isModuleScopedResource
public static boolean isModuleScopedResource(GenericResourceInfo resourceInfo)
-
getPoolMonitoringSubTreeRoot
public static String getPoolMonitoringSubTreeRoot(PoolInfo poolInfo, boolean escapeSlashes)
-
getModuleName
public static String getModuleName(EjbDescriptor descriptor)
-
getResourcesOfPool
public static Collection<BindableResource> getResourcesOfPool(Resources resources, String connectionPoolName)
-
getResourceByName
public static <T> Resource getResourceByName(Resources resources, Class<T> type, String name)
-
isEmbeddedRarResource
public static ResourceConstants.TriState isEmbeddedRarResource(Resource configBeanResource, Collection<Resource> configBeanResources)
-
getPool
public static ConnectorConnectionPool getPool(Collection<Resource> configBeanResources, String poolName)
-
isRARResource
public static boolean isRARResource(Resource resource)
-
-