1 5 package ve.luz.ica.jackass.client; 6 7 import org.apache.commons.logging.Log; 8 import org.apache.commons.logging.LogFactory; 9 10 import org.omg.CORBA.LocalObject ; 11 import org.omg.PortableInterceptor.ORBInitInfo ; 12 import org.omg.PortableInterceptor.ORBInitInfoPackage.DuplicateName ; 13 import org.omg.PortableInterceptor.ORBInitializer ; 14 15 20 public class Initializer extends LocalObject implements ORBInitializer 21 { 22 private static final Log LOG = LogFactory.getLog(Initializer.class); 23 24 private static boolean loaded = false; 25 26 30 public void post_init(ORBInitInfo info) 31 { 32 try 33 { 34 if (!loaded) 35 { 36 if (LOG.isInfoEnabled()) LOG.info("Loading interceptor"); 37 info.add_client_request_interceptor(new Interceptor()); 38 loaded = true; 39 if (LOG.isInfoEnabled()) LOG.info("Interceptor loaded"); 40 } 41 else 42 { 43 if (LOG.isInfoEnabled()) LOG.info("No need to load interceptor"); 44 } 45 } 46 catch (DuplicateName e) 47 { 48 e.printStackTrace(); 49 } 50 } 51 52 56 public void pre_init(ORBInitInfo info) 57 { 58 } 59 60 } 61 | Popular Tags |