1 21 package org.jacorb.orb.portableInterceptor; 22 23 import org.omg.PortableInterceptor.*; 24 import org.omg.CORBA.UserException ; 25 26 32 33 public abstract class AbstractInterceptorIterator 34 { 35 protected Interceptor[] interceptors = null; 36 protected int index = 0; 37 protected int increment = 1; 38 39 public AbstractInterceptorIterator(Interceptor[] interceptors) 40 { 41 this.interceptors = interceptors; 42 } 43 44 47 protected boolean hasMoreElements() 48 { 49 return ( index >= 0 ) && ( index < interceptors.length ); 50 } 51 52 55 56 protected Interceptor nextElement() 57 { 58 Interceptor _tmp = interceptors[index]; 59 index += increment; 60 return _tmp; 61 } 62 63 protected void iterate() 64 throws UserException 65 { 66 while( hasMoreElements() ) 67 invoke( nextElement() ); 68 } 69 70 abstract protected void invoke(Interceptor interceptor) 71 throws UserException ; 72 73 } 75 76 77 78 79 80 81 82 83 84 85 86 | Popular Tags |