/** * record the fact that a trigger call has failed to install into bytecode associated with a specific * class and loader * @param loader the loader of the class for which injection was attempted * @param internalClassName the internal Java name of the class * @param triggerMethodName the name of the method injected into * @param desc the descriptor of the method injected into * @param rule the rule which was injected * @param th throwable generated during the attempt to parse the rule text or inject code at the trigger point * @return true if the successful injection was recorded false if not */ public synchronized boolean recordTransform(ClassLoader loader, String internalClassName, String triggerMethodName, String desc, Rule rule, Throwable th) { if (deleted) { return false; } String fullMethodName = null; if (triggerMethodName != null) { fullMethodName = triggerMethodName + TypeHelper.internalizeDescriptor(desc); } // make sure we know about this specific loader and classname combination TransformSet transformSet = ensureTransformSet(loader, internalClassName, null); // and install the transform in the set transformSet.add(new Transform(loader, internalClassName, fullMethodName, rule, th)); return true; }
/** * record the fact that a trigger call has failed to install into bytecode associated with a specific * class and loader * @param loader the loader of the class for which injection was attempted * @param internalClassName the internal Java name of the class * @param triggerMethodName the name of the method injected into * @param desc the descriptor of the method injected into * @param rule the rule which was injected * @param th throwable generated during the attempt to parse the rule text or inject code at the trigger point * @return true if the successful injection was recorded false if not */ public synchronized boolean recordTransform(ClassLoader loader, String internalClassName, String triggerMethodName, String desc, Rule rule, Throwable th) { if (deleted) { return false; } String fullMethodName = null; if (triggerMethodName != null) { fullMethodName = triggerMethodName + TypeHelper.internalizeDescriptor(desc); } // make sure we know about this specific loader and classname combination TransformSet transformSet = ensureTransformSet(loader, internalClassName, null); // and install the transform in the set transformSet.add(new Transform(loader, internalClassName, fullMethodName, rule, th)); return true; }
newTransformSet.setInstalled(oldTransformSet.getInstalledRule()); } else { newRuleScript.ensureTransformSet(oldTransformSet.getLoader(), oldTransformSet.getTriggerClass(), oldTransformSet.getInstalledRule());
newTransformSet.setInstalled(oldTransformSet.getInstalledRule()); } else { newRuleScript.ensureTransformSet(oldTransformSet.getLoader(), oldTransformSet.getTriggerClass(), oldTransformSet.getInstalledRule());
/** * record the fact that a rule has been compiled with or without success * @param triggerClass the name of the trigger class to which the rule is attached * @param loader the classloader of the trigger class * @param successful true if the rule compiled successfully and false if it suffered from parse, * type or compile errors * @param detail text describing more details of the compilation outcome * @return true if the rule needs to be installed otherwise false */ public synchronized boolean recordCompile(Rule rule, String triggerClass, ClassLoader loader, boolean successful, String detail) { if(deleted) { return false; } // find an existing transform set or create a new one TransformSet transformSet = ensureTransformSet(loader, triggerClass, null); for (Transform transform : transformSet.getTransforms()) { if(transform.getRule() == rule) { transform.setCompiled(successful, detail); boolean isInstalled = transformSet.isInstalled(); // record this as the latest rule to be installed transformSet.setInstalled(rule); // if this is the first installed rule then // we need to perform lifecycle processing return !isInstalled; } } // no such rule so no lifecycle processing return false; }
/** * record the fact that a rule has been compiled with or without success * @param triggerClass the name of the trigger class to which the rule is attached * @param loader the classloader of the trigger class * @param successful true if the rule compiled successfully and false if it suffered from parse, * type or compile errors * @param detail text describing more details of the compilation outcome * @return true if the rule needs to be installed otherwise false */ public synchronized boolean recordCompile(Rule rule, String triggerClass, ClassLoader loader, boolean successful, String detail) { if(deleted) { return false; } // find an existing transform set or create a new one TransformSet transformSet = ensureTransformSet(loader, triggerClass, null); for (Transform transform : transformSet.getTransforms()) { if(transform.getRule() == rule) { transform.setCompiled(successful, detail); boolean isInstalled = transformSet.isInstalled(); // record this as the latest rule to be installed transformSet.setInstalled(rule); // if this is the first installed rule then // we need to perform lifecycle processing return !isInstalled; } } // no such rule so no lifecycle processing return false; }
newTransformSet.setInstalled(oldTransformSet.getInstalledRule()); } else { newRuleScript.ensureTransformSet(oldTransformSet.getLoader(), oldTransformSet.getTriggerClass(), oldTransformSet.getInstalledRule());
newTransformSet.setInstalled(oldTransformSet.getInstalledRule()); } else { newRuleScript.ensureTransformSet(oldTransformSet.getLoader(), oldTransformSet.getTriggerClass(), oldTransformSet.getInstalledRule());