taylor 2004/10/20 09:29:40 Modified: components/profiler/src/java/org/apache/jetspeed/profiler/impl JetspeedProfiler.java Log: maintenance impl for persisting rules Revision Changes Path 1.10 +58 -1 jakarta-jetspeed-2/components/profiler/src/java/org/apache/jetspeed/profiler/impl/JetspeedProfiler.java Index: JetspeedProfiler.java =================================================================== RCS file: /home/cvs/jakarta-jetspeed-2/components/profiler/src/java/org/apache/jetspeed/profiler/impl/JetspeedProfiler.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- JetspeedProfiler.java 15 Oct 2004 18:50:44 -0000 1.9 +++ JetspeedProfiler.java 20 Oct 2004 16:29:40 -0000 1.10 @@ -30,6 +30,7 @@ import org.apache.jetspeed.components.persistence.store.LockFailedException; import org.apache.jetspeed.components.persistence.store.PersistenceStore; import org.apache.jetspeed.components.persistence.store.Transaction; +import org.apache.jetspeed.om.common.portlet.MutablePortletApplication; import org.apache.jetspeed.profiler.ProfileLocator; import org.apache.jetspeed.profiler.ProfiledPageContext; import org.apache.jetspeed.profiler.Profiler; @@ -388,6 +389,62 @@ locators.put(locatorNames[ix], getProfile(context, locatorNames[ix])); } return locators; + } + + public void addProfilingRule(ProfilingRule rule) + throws ProfilerException + { + try + { + System.out.println("making pers : " + rule.getId()); + Transaction tx = persistentStore.getTransaction(); + tx.begin(); + persistentStore.makePersistent(rule); + persistentStore.lockForWrite(rule); + tx.commit(); + System.out.println("done making pers : " + rule.getId()); + + } + catch (Exception e) + { + throw new ProfilerException("failed to store: " + rule.getId(), e); + } + } + + public void updateProfilingRule(ProfilingRule rule) + throws ProfilerException + { + try + { + System.out.println("UP making pers : " + rule.getId()); + Transaction tx = persistentStore.getTransaction(); + tx.begin(); + persistentStore.lockForWrite(rule); + tx.commit(); + System.out.println("UP done making pers : " + rule.getId()); + + } + catch (Exception e) + { + throw new ProfilerException("failed to store: " + rule.getId(), e); + } + } + + public void removeProfilingRule(ProfilingRule rule) + throws ProfilerException + { + try + { + Transaction tx = persistentStore.getTransaction(); + tx.begin(); + persistentStore.deletePersistent(rule); + tx.commit(); + } + catch (Exception e) + { + throw new ProfilerException("failed to remove: " + rule.getId(), e); + } + } }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]