Index: C:/Naidu/Projects/eclipse/june_policy_workspace/apache/imperius-javaspl/src/main/java/org/apache/imperius/javaspl/JavaActuatorImpl.java =================================================================== --- C:/Naidu/Projects/eclipse/june_policy_workspace/apache/imperius-javaspl/src/main/java/org/apache/imperius/javaspl/JavaActuatorImpl.java (revision 669817) +++ C:/Naidu/Projects/eclipse/june_policy_workspace/apache/imperius-javaspl/src/main/java/org/apache/imperius/javaspl/JavaActuatorImpl.java (working copy) @@ -152,20 +152,43 @@ // Retrieve value of the property Object value = memberMap.get(propName); - // Load field - Field member = c.getField(propName); - - // Set the value of the field - member.set(instance, value); - + try + { + // Load field + Field member = c.getField(propName); + + // Set the value of the field + member.set(instance, value); + } + catch (NoSuchFieldException e) + { + boolean isMethodExists = false; + Method[] classMethods = c.getMethods(); + if (classMethods != null) { + for (int i = 0; i < classMethods.length; i++) + { + if (classMethods[i].getName().equals( + getAccessorMethodName(propName))) + { + isMethodExists = true; + classMethods[i].invoke(instance, + new Object[] { value }); + break; + } + } + if (!isMethodExists) + throw new NoSuchMethodException(); + } + } } } catch (ClassNotFoundException e) { throw new SPLException(e.getMessage()); - } catch (SecurityException e) { throw new SPLException(e.getMessage()); - } catch (NoSuchFieldException e) { + } catch(NoSuchMethodException e) { throw new SPLException(e.getMessage()); + } catch(InvocationTargetException e) { + throw new SPLException(e.getMessage()); } catch (IllegalArgumentException e) { throw new SPLException(e.getMessage()); } catch (IllegalAccessException e) { @@ -208,5 +231,15 @@ } return paramTypeArray; } + + private String getAccessorMethodName(String identifier) + { + if(Character.isLetter(identifier.charAt(0))) + { + identifier = Character.toUpperCase(identifier.charAt(0)) + identifier.substring(1); + } + identifier = "set"+identifier; + return identifier; + } }