public VelGetterImpl(AbstractExecutor abstractExecutor) { this.abstractExecutor = abstractExecutor; }
public VelGetterImpl(AbstractExecutor exec) { ae = exec; }
/// <summary> invokes the method on the object passed in /// </summary> public override System.Object execute(System.Object o, InternalContextAdapter context) { AbstractExecutor executor = null; try { System.Type c = o.GetType(); /* * first, see if we have this information cached. */ IntrospectionCacheData icd = context.ICacheGet(this); /* * if we have the cache data and the class of the object we are * invoked with is the same as that in the cache, then we must * be allright. The last 'variable' is the method name, and * that is fixed in the template :) */ if (icd != null && icd.contextData == c) { executor = (AbstractExecutor)icd.thingy; } else { /* * otherwise, do the introspection, and cache it */ executor = doIntrospection(c); if (executor != null) { icd = new IntrospectionCacheData(); icd.contextData = c; icd.thingy = executor; context.ICachePut(this, icd); } } } catch (System.Exception e) { rsvc.error("ASTIdentifier.execute() : identifier = " + identifier + " : " + e); } /* * we have no executor... punt... */ if (executor == null) { return(null); } /* * now try and execute. If we get a MIE, throw that * as the app wants to get these. If not, log and punt. */ try { return(executor.execute(o, context)); } catch (MethodInvocationException mie) { throw mie; } catch (System.Exception e) { rsvc.error("ASTIdentifier() : exception invoking method for identifier '" + identifier + "' in " + o.GetType() + " : " + e); } return(null); }