*/
protected void registerInstanceMethod(final String methodName, final Closure callable) {
final boolean inited = this.initCalled;
performOperationOnMetaClass(new Callable() {
public void call() {
ClosureMetaMethod metaMethod = new ClosureMetaMethod(methodName, theClass,callable);
checkIfGroovyObjectMethod(metaMethod, methodName);
MethodKey key = new DefaultCachedMethodKey(theClass,methodName, metaMethod.getParameterTypes(),false );
addMetaMethod(metaMethod);
dropMethodCache(methodName);
expandoMethods.put(key,metaMethod);
if(inited && isGetter(methodName, metaMethod.getParameterTypes())) {
String propertyName = getPropertyForGetter(methodName);
registerBeanPropertyForMethod(metaMethod, propertyName, true, false);
}
else if(inited && isSetter(methodName, metaMethod.getParameterTypes())) {
String propertyName = getPropertyForSetter(methodName);
registerBeanPropertyForMethod(metaMethod, propertyName, false, false);
}
performRegistryCallbacks();
}