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