1 23 24 37 package com.sun.enterprise.server.event; 38 39 import com.sun.enterprise.deployment.EjbDescriptor; 40 41 55 public class EjbContainerEvent { 56 57 public static final int BEFORE_EJB_CONTAINER_LOAD = 20; 58 public static final int AFTER_EJB_CONTAINER_LOAD = 21; 59 public static final int BEFORE_EJB_CONTAINER_UNLOAD = 22; 60 public static final int AFTER_EJB_CONTAINER_UNLOAD = 23; 61 62 private int eventType; 63 private EjbDescriptor ejbDescriptor; 64 private ClassLoader loader; 65 66 public EjbContainerEvent(int eventType, EjbDescriptor ejbDescriptor, 67 ClassLoader loader) 68 { 69 this.eventType = eventType; 70 this.ejbDescriptor = ejbDescriptor; 71 this.loader = loader; 72 } 73 74 public int getEventType() { 75 return this.eventType; 76 } 77 78 public EjbDescriptor getEjbDescriptor() { 79 return this.ejbDescriptor; 80 } 81 82 public ClassLoader getClassLoader() { 83 return this.loader; 84 } 85 86 public String toString() { 87 StringBuffer sbuf = new StringBuffer ("EjbEvent: "); 88 switch (eventType) { 89 case BEFORE_EJB_CONTAINER_LOAD: 90 sbuf.append("BEFORE_LOAD -> "); 91 break; 92 case AFTER_EJB_CONTAINER_LOAD: 93 sbuf.append("AFTER_LOAD -> "); 94 break; 95 case BEFORE_EJB_CONTAINER_UNLOAD: 96 sbuf.append("BEFORE_UNLOAD -> "); 97 break; 98 case AFTER_EJB_CONTAINER_UNLOAD: 99 sbuf.append("AFTER_UNLOAD -> "); 100 break; 101 default: 102 } 104 105 if (ejbDescriptor != null) { 106 sbuf.append(ejbDescriptor.getName()); 107 } 108 109 return sbuf.toString(); 110 } 111 112 } 113 | Popular Tags |