public List<Transform> allTransforms() { List<Transform> allTransforms = new ArrayList<Transform>(); for (TransformSet transformSet : transformSets) { allTransforms.addAll(transformSet.getTransforms()); } return allTransforms; }
public List<Transform> allTransforms() { List<Transform> allTransforms = new ArrayList<Transform>(); for (TransformSet transformSet : transformSets) { allTransforms.addAll(transformSet.getTransforms()); } return allTransforms; }
/** * uninstall all transforms associated with this script. this is called after marking the script as * deleted and regenerating the methods for any associated transformed class to ensure that it does * not cause a rule trigger call to fail. */ public synchronized void purge() { for (TransformSet transformSet : transformSets) { for (Transform transform : transformSet.getTransforms()) { Rule rule = transform.getRule(); if(rule != null) { rule.purge(); } } transformSet.clearTransforms(); } transformSets.clear(); }
/** * uninstall all transforms associated with this script. this is called after marking the script as * deleted and regenerating the methods for any associated transformed class to ensure that it does * not cause a rule trigger call to fail. */ public synchronized void purge() { for (TransformSet transformSet : transformSets) { for (Transform transform : transformSet.getTransforms()) { Rule rule = transform.getRule(); if(rule != null) { rule.purge(); } } transformSet.clearTransforms(); } transformSets.clear(); }
/** * delete any transforms associated with a specific trigger class and loader for * deletion. this is called just before any attempt to retransform the class * to inject the script's associated rule. it ensures that records of previous * transforms associated with a prior retransformation of the class are removed * before any new ones are added */ public synchronized void purge(ClassLoader loader, String triggerClassName) { TransformSet transformSet = lookupTransformSet(loader, triggerClassName); if (transformSet != null) { for (Transform transform : transformSet.getTransforms()) { Rule rule = transform.getRule(); if(rule != null) { rule.purge(); } } transformSet.clearTransforms(); } }
/** * delete any transforms associated with a specific trigger class and loader for * deletion. this is called just before any attempt to retransform the class * to inject the script's associated rule. it ensures that records of previous * transforms associated with a prior retransformation of the class are removed * before any new ones are added */ public synchronized void purge(ClassLoader loader, String triggerClassName) { TransformSet transformSet = lookupTransformSet(loader, triggerClassName); if (transformSet != null) { for (Transform transform : transformSet.getTransforms()) { Rule rule = transform.getRule(); if(rule != null) { rule.purge(); } } transformSet.clearTransforms(); } }
/** * 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; }