// get Method (reflection)
Method m = null;
try {
m = this.activationSpec.getClass().getMethod(methodName, new Class[] {String.class});
} catch (SecurityException e) {
throw new FactoryException("Cannot get a method named '" + methodName
+ "' on activation spec object '" + this.activationSpec + "'.", e);
} catch (NoSuchMethodException e) {
throw new FactoryException("Cannot get a method named '" + methodName
+ "' on activation spec object '" + this.activationSpec + "'.", e);
}
// invoke method
try {
m.invoke(this.activationSpec, value);
} catch (IllegalArgumentException e) {
throw new FactoryException("Cannot invoke method named '" + methodName + "' with value '" + value
+ "' on activation spec object '" + this.activationSpec + "'.", e);
} catch (IllegalAccessException e) {
throw new FactoryException("Cannot invoke method named '" + methodName + "' with value '" + value
+ "' on activation spec object '" + this.activationSpec + "'.", e);
} catch (InvocationTargetException e) {
throw new FactoryException("Cannot invoke method named '" + methodName + "' with value '" + value
+ "' on activation spec object '" + this.activationSpec + "'.", e);
}
}