1 16 package org.apache.cocoon.portal.event.impl; 17 18 import java.util.Iterator ; 19 import java.util.Map ; 20 21 import org.apache.avalon.framework.parameters.Parameters; 22 import org.apache.cocoon.portal.PortalService; 23 import org.apache.cocoon.portal.event.EventConverter; 24 import org.apache.cocoon.portal.event.Publisher; 25 import org.apache.cocoon.portal.event.aspect.EventAspect; 26 import org.apache.cocoon.portal.event.aspect.EventAspectContext; 27 import org.apache.cocoon.util.Deprecation; 28 29 36 public final class DefaultEventAspectContext 37 implements EventAspectContext { 38 39 private Iterator iterator; 40 private Iterator configIterator; 41 private Parameters config; 42 43 private Publisher publisher; 44 private Map objectModel; 45 private EventConverter converter; 46 47 public DefaultEventAspectContext(EventAspectChain chain) { 48 this.iterator = chain.getIterator(); 49 this.configIterator = chain.getConfigIterator(); 50 } 51 52 55 public void invokeNext(PortalService service) { 56 if (iterator.hasNext()) { 57 this.config = (Parameters) this.configIterator.next(); 58 final EventAspect aspect = (EventAspect) iterator.next(); 59 aspect.process( this, service ); 60 } 61 62 } 63 64 67 public Parameters getAspectParameters() { 68 return this.config; 69 } 70 71 74 public EventConverter getEventConverter(){ 75 return this.converter; 76 } 77 78 81 public Publisher getEventPublisher() { 82 Deprecation.logger.info("The getEventPublisher() method in the EventAspectContext is deprecated."); 83 return this.publisher; 84 } 85 86 89 public Map getObjectModel() { 90 return this.objectModel; 91 } 92 93 96 public void setEventConverter(EventConverter converter) { 97 this.converter = converter; 98 } 99 100 103 public void setObjectModel(Map map) { 104 objectModel = map; 105 } 106 107 110 public void setEventPublisher(Publisher publisher) { 111 this.publisher = publisher; 112 } 113 114 } 115 | Popular Tags |