public boolean refreshObjectState(boolean keepOldState){
  boolean changeDetected=false;
  Object[] args=null;
  if (keepOldState) {
    oldObjectState.putAll(objectState);
  }
  for (  Map.Entry<String,Method> gettorMethodEntry : getterMethodMap.entrySet()) {
    String property=gettorMethodEntry.getKey();
    Object propertyValue=null;
    try {
      Method m=gettorMethodEntry.getValue();
      propertyValue=m.invoke(mbeanObject,args);
      OpenMethod op=methodHandlerMap.get(m);
      propertyValue=op.toOpenReturnValue(propertyValue);
    }
 catch (    Exception e) {
      propertyValue=null;
      if (logger.isTraceEnabled()) {
        logger.trace(e.getMessage());
      }
    }
    Object oldValue=objectState.put(property,propertyValue);
    if (!changeDetected) {
      if (propertyValue != null) {
        if (!propertyValue.equals(oldValue)) {
          changeDetected=true;
        }
      }
 else {
        if (oldValue != null) {
          changeDetected=true;
        }
      }
    }
  }
  boolean retVal=prevRefreshChangeDetected || changeDetected;
  prevRefreshChangeDetected=changeDetected;
  return retVal;
}

public boolean refreshObjectState ( boolean keepOldState ) { boolean changeDetected = false ; Object [ ] args = null ; if ( keepOldState ) { oldObjectState . putAll ( objectState ) ; } for ( Map . Entry < String , Method > gettorMethodEntry : getterMethodMap . entrySet ( ) ) { String property = gettorMethodEntry . getKey ( ) ; Object propertyValue = null ; try { Method m = gettorMethodEntry . getValue ( ) ; propertyValue = m . invoke ( mbeanObject , args ) ; OpenMethod op = methodHandlerMap . get ( m ) ; propertyValue = op . toOpenReturnValue ( propertyValue ) ; } catch ( Exception e ) { propertyValue = null ; if ( logger . isTraceEnabled ( ) ) { logger . trace ( e . getMessage ( ) ) ; } } Object oldValue = objectState . put ( property , propertyValue ) ; if ( ! changeDetected ) { if ( propertyValue != null ) { if ( ! propertyValue . equals ( oldValue ) ) { changeDetected = true ; } } else { if ( oldValue != null ) { changeDetected = true ; } } } } boolean retVal = prevRefreshChangeDetected || changeDetected ; prevRefreshChangeDetected = changeDetected ; return retVal ; }
this method will get called from management thread . this will dynamically invoke the mbeans getter methods and set them in objectstate map . in future releases we can implement the delta propagation here
