1 23 24 package com.sun.enterprise.server.ondemand.entry; 25 26 import com.sun.enterprise.deployment.Descriptor; 27 import com.sun.enterprise.server.ondemand.OnDemandServer; 28 import javax.management.ObjectName ; 29 30 36 public class ServerEntryHelper { 37 38 public static void generateJndiEntryContext(String jndiName) { 39 sendEvent (new EntryContext(jndiName, EntryPoint.JNDI)); 40 } 41 42 public static void generatePortEntryContext(Integer port) { 43 sendEvent (new EntryContext(port, EntryPoint.PORT)); 44 } 45 46 public static void generateAppLoaderEntryContext(Descriptor desc) { 47 sendEvent (new EntryContext(desc, EntryPoint.APPLOADER)); 48 } 49 50 public static void generateStartUpEntryContext(Boolean obj) { 51 sendEvent (new EntryContext(obj, EntryPoint.STARTUP)); 52 } 53 54 public static void generateMbeanEntryContext(ObjectName name) { 55 sendEvent (new EntryContext(name, EntryPoint.MBEAN)); 56 } 57 58 public static void sendEvent(EntryContext context) { 60 ServerEntryListener listener = OnDemandServer.getServerEntryListener(); 61 if (listener != null) { 62 listener.notifyEntry(context); 63 } 64 } 65 66 public static boolean isNotifiedByPortEntryContext(Integer port) { 67 return isNotified(new EntryContext(port, EntryPoint.PORT)); 68 } 69 70 public static boolean isNotified(EntryContext context) { 71 ServerEntryListener listener = OnDemandServer.getServerEntryListener(); 72 return listener.isNotified(context); 73 } 74 75 } 76 | Popular Tags |