/** * Invokes the method passed and returns the value obtained. If method * invocation fails empty string is returned. If the return type is not * of Wrapper class of the primitive types, empty string is returned. */ private String getPropValue(Method method, Class loadedClass, Object loadedInstance) { Object retValue = null; Method getMethod = correspondingGetMethod(method, loadedClass); if(getMethod != null) { try { retValue = getMethod.invoke(loadedInstance, (java.lang.Object[])null); } catch (IllegalAccessException ie) { if (_logger.isLoggable(Level.FINE)) { _logger.log(Level.FINE, "rardeployment.illegalaccess_error", loadedClass.getName()); } } catch (InvocationTargetException ie) { if (_logger.isLoggable(Level.FINE)) { _logger.log(Level.FINE, "Failed to invoke the method", loadedClass.getName()); } } } return convertToString(retValue); }
Class loadedClass = loadClass(className, rarName); Method[] methods = loadedClass.getMethods(); Properties props = new Properties(); if(isProperty(methods[i])&&!presentInDDProps(methods[i],ddProps)) { name = getPropName(methods[i]); value = getPropType(methods[i]); if(value != null) { props.setProperty(name,value);
_logger.fine("Method -> " + methods[i].getName() + ":" + methods[i].getReturnType()); if(isProperty(methods[i]) && !presentInDDProps(methods[i],ddProps) && isValid(methods[i], loadedClass)) { name = getPropName(methods[i]); value = getPropValue(methods[i], loadedClass, javaBeanInstance); props.setProperty(name,value);
private Properties getMergedValues(AdminObject adminObject, Properties mergedVals, String raName) throws ConnectorRuntimeException { /* ddVals -> Properties present in ra.xml * introspectedVals -> All properties with values * obtained by introspection of resource * adapter javabean * mergedVals -> merged props of raConfigPros and * allraConfigPropsWithDefVals */ Set ddVals = adminObject.getConfigProperties(); String className = adminObject.getAdminObjectClass(); if (className != null && className.length() != 0) { Properties introspectedVals = configParserUtil.introspectJavaBean(className, ddVals, false, raName); mergedVals = configParserUtil.mergeProps(ddVals, introspectedVals); } return mergedVals; }
public Properties introspectJavaBean(String className, Set ddPropsSet, boolean associateResourceAdapter, String resourceAdapterName) throws ConnectorRuntimeException { Class loadedClass = loadClass(className, resourceAdapterName); Object loadedInstance = instantiate(loadedClass); try { if (associateResourceAdapter) { return introspectJavaBean(loadedInstance, ddPropsSet);
if(className != null && className.length() != 0) { Properties introspectedVals = configParserUtil.introspectJavaBeanReturnTypes(className,ddVals, rarName); mergedVals = configParserUtil.mergePropsReturnTypes( ddVals,introspectedVals);
public Properties introspectJavaBean(String className, Set ddPropsSet) throws ConnectorRuntimeException { return introspectJavaBean(className, ddPropsSet, false, null); }
/** * Checks whether the property is valid or not. */ private boolean isValid(Method setMethod, Class loadedClass) { Method getMethod = correspondingGetMethod( setMethod, loadedClass); if (getMethod != null) { return RARUtils.isValidRABeanConfigProperty(getMethod.getReturnType()); } else { return false; } }
Properties introspectedVals = null; if (className != null && className.length() != 0) { introspectedVals = configParserUtil.introspectJavaBean( className, ddVals, false, rarName); mergedVals = configParserUtil.mergeProps(ddVals, introspectedVals);
String className = cdd.getManagedConnectionFactoryImpl(); if(className != null && className.length() != 0) { Properties introspectedVals = configParserUtil.introspectJavaBean( className,ddVals, true, rarName); mergedVals = configParserUtil.mergeProps(ddVals,introspectedVals);
String className = messageListener.getActivationSpecClass(); if(className != null && className.length() != 0) { Properties introspectedVals = configParserUtil.introspectJavaBean( className,ddVals, false, rarName); mergedVals = configParserUtil.mergeProps(ddVals,introspectedVals);