Class ConnectorConfigurationParserServiceImpl
- java.lang.Object
-
- com.sun.enterprise.connectors.service.ConnectorService
-
- com.sun.enterprise.connectors.service.ConnectorConfigurationParserServiceImpl
-
- All Implemented Interfaces:
ConnectorConstants
,ResourceConstants
public class ConnectorConfigurationParserServiceImpl extends ConnectorService
This is configuration parser service. Retrieves various configuration information from ra.xml- Author:
- Srikanth P
-
-
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 class com.sun.enterprise.connectors.service.ConnectorService
_logger, _registry, _runtime
-
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 ConnectorConfigurationParserServiceImpl()
Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getActivationSpecClass(String rarName, String messageListenerType)
Return the ActivationSpecClass name for given rar and messageListenerTypeString[]
getAdminObjectClassNames(String rarName, String intfName)
gets the adminObjectClassNames pertaining to a rar & a specific adminObjectInterfaceNameProperties
getAdminObjectConfigProps(String rarName, String adminObjectIntf)
Retrieves the admin object javabean properties with default values.Properties
getAdminObjectConfigProps(String rarName, String adminObjectIntf, String adminObjectClass)
Retrieves the admin object javabean properties with default values.String[]
getAdminObjectInterfaceNames(String rarName)
Obtains all the Connection definition names of a rarString[]
getConnectionDefinitionNames(String rarName)
Obtains all the Connection definition names of a rarProperties
getConnectorConfigJavaBeans(String rarName, String connectionDefName, String type)
Retrieves the XXX javabean properties with default values.String
getFileContent(File file)
Obtain the content of server.policy fileProperties
getMCFConfigProps(String rarName, String connectionDefName)
Retrieves the MCF javabean properties with default values.Properties
getMessageListenerConfigProps(String rarName, String messageListenerType)
Parses the ra.xml for the ActivationSpec javabean properties.Properties
getMessageListenerConfigPropTypes(String rarName, String messageListenerType)
Returns the Properties object consisting of propertyname as the key and datatype as the value.String[]
getMessageListenerTypes(String rarName)
Properties
getResourceAdapterConfigProps(String rarName)
Retrieves the Resource adapter javabean properties with default values.String
getSecurityPermissionSpec(String moduleName)
Obtains the Permission string that needs to be added to the to the security policy files.boolean
hasAdminObject(String rarName, String intfName, String className)
checks whether the specified intfName, className has presence in admin objects of the RAR-
Methods inherited from class com.sun.enterprise.connectors.service.ConnectorService
checkAccessibility, checkAndLoadPool, createActiveResourceAdapterForEmbeddedRar, getConnectorDescriptor, getDefaultPoolName, getDefaultResourceName, getResourcesUtil, ifSystemRarLoad, loadDeferredResourceAdapter, loadDeferredResources, loadResourcesAndItsRar, switchOnMatching
-
-
-
-
Method Detail
-
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- Parameters:
moduleName
- rar module Name- Returns:
- Required policy permissions in server.policy file
- Throws:
ConnectorRuntimeException
- If rar.xml parsing fails.
-
getFileContent
public String getFileContent(File file)
Obtain the content of server.policy file- Parameters:
file
- File server.policy file- Returns:
- String content of server.policy file
-
getConnectionDefinitionNames
public 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
-
getResourceAdapterConfigProps
public Properties 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.- Parameters:
rarName
- rar module name- Returns:
- Resource adapter javabean properties with default values.
- Throws:
ConnectorRuntimeException
- if property retrieval fails.
-
getMCFConfigProps
public Properties 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.- Parameters:
rarName
- rar module name- Returns:
- managed connection factory javabean properties with default values.
- Throws:
ConnectorRuntimeException
- if property retrieval fails.
-
getAdminObjectConfigProps
public Properties 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.- Parameters:
rarName
- rar module name- Returns:
- admin object javabean properties with default values.
- Throws:
ConnectorRuntimeException
- if property retrieval fails.
-
getAdminObjectConfigProps
public Properties 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.- Parameters:
rarName
- rar module nameadminObjectIntf
- admin object interfaceadminObjectClass
- admin object class- Returns:
- admin object javabean properties with default values.
- Throws:
ConnectorRuntimeException
- if property retrieval fails.
-
getConnectorConfigJavaBeans
public Properties 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 name- 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- Parameters:
moduleDir
- The directory where rar is exploded.messageListenerType
- MessageListener type- Throws:
ConnectorRuntimeException
- If moduleDir is null. If corresponding rar is not deployed.
-
getMessageListenerTypes
public String[] getMessageListenerTypes(String rarName) throws ConnectorRuntimeException
- Throws:
ConnectorRuntimeException
-
getMessageListenerConfigProps
public Properties getMessageListenerConfigProps(String rarName, String messageListenerType) throws ConnectorRuntimeException
Parses the ra.xml for the ActivationSpec javabean properties. 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
-
getMessageListenerConfigPropTypes
public Properties 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.xml
-
getAdminObjectInterfaceNames
public String[] getAdminObjectInterfaceNames(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
-
getAdminObjectClassNames
public String[] getAdminObjectClassNames(String rarName, String intfName) throws ConnectorRuntimeException
gets the adminObjectClassNames pertaining to a rar & a specific adminObjectInterfaceName- Parameters:
rarName
- resource-adapter nameintfName
- admin-object-interface name- Returns:
- Array of AdminObjectInterface names as Strings
- Throws:
ConnectorRuntimeException
- if parsing fails
-
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- 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
-
-