1 16 package org.apache.cocoon.portal.layout.renderer.aspect.impl; 17 18 import org.apache.avalon.framework.activity.Disposable; 19 import org.apache.avalon.framework.activity.Initializable; 20 import org.apache.cocoon.portal.event.EventManager; 21 import org.apache.cocoon.portal.event.Receiver; 22 23 30 public abstract class AbstractActionAspect 31 extends AbstractAspect 32 implements Receiver, Disposable, Initializable { 33 34 37 public void dispose() { 38 if ( this.manager != null ) { 39 EventManager eventManager = null; 40 try { 41 eventManager = (EventManager)this.manager.lookup(EventManager.ROLE); 42 eventManager.unsubscribe( this ); 43 } catch (Exception ignore) { 44 } finally { 46 this.manager.release( eventManager ); 47 } 48 49 this.manager = null; 50 } 51 } 52 53 56 public void initialize() throws Exception { 57 EventManager eventManager = null; 58 try { 59 eventManager = (EventManager)this.manager.lookup(EventManager.ROLE); 60 eventManager.subscribe( this ); 61 } finally { 62 this.manager.release( eventManager ); 63 } 64 } 65 66 } 67 | Popular Tags |