1 16 package org.apache.cocoon.portal.pluto.om.common; 17 18 import java.util.HashSet ; 19 import java.util.Iterator ; 20 21 28 public abstract class AbstractSupportSet 29 extends HashSet 30 implements java.io.Serializable , Support { 31 32 public AbstractSupportSet() { 33 } 35 36 37 public void postLoad(Object parameter) throws Exception { 39 dispatch(parameter, POST_LOAD); 40 } 41 42 public void preBuild(Object parameter) throws Exception { 43 dispatch(parameter, PRE_BUILD); 44 } 45 46 public void postBuild(Object parameter) throws Exception { 47 dispatch(parameter, POST_BUILD); 48 } 49 50 public void preStore(Object parameter) throws Exception { 51 dispatch(parameter, PRE_STORE); 52 } 53 54 public void postStore(Object parameter) throws Exception { 55 dispatch(parameter, POST_STORE); 56 } 57 58 protected void dispatch(Object parameter, int id) throws Exception { 60 Iterator iterator = this.iterator(); 61 while (iterator.hasNext()) { 62 Support support = (Support)iterator.next(); 63 switch (id) { 64 case POST_LOAD : support.postLoad(parameter); break; 65 case PRE_BUILD : support.preBuild(parameter); break; 66 case POST_BUILD: support.postBuild(parameter); break; 67 case PRE_STORE : support.preStore(parameter); break; 68 case POST_STORE: support.postStore(parameter); break; 69 } 70 } 71 } 72 } 73 | Popular Tags |