1 9 package org.jboss.remoting.network; 10 11 import javax.management.Notification ; 12 import javax.management.ObjectName ; 13 import org.jboss.remoting.InvokerLocator; 14 import org.jboss.remoting.detection.ServerInvokerMetadata; 15 import org.jboss.remoting.ident.Identity; 16 17 24 public class NetworkNotification extends Notification 25 { 26 public static final String SERVER_ADDED = "jboss.network.server.added"; 27 public static final String SERVER_UPDATED = "jboss.network.server.updated"; 28 public static final String SERVER_REMOVED = "jboss.network.server.removed"; 29 public static final String DOMAIN_CHANGED = "jboss.network.domain.changed"; 30 31 private final Identity identity; 32 private final ServerInvokerMetadata serverInvokers[]; 33 private final InvokerLocator locators[]; 34 35 36 public NetworkNotification(ObjectName source, String type, Identity identity, ServerInvokerMetadata serverInvokers[]) 37 { 38 super(type, source, System.currentTimeMillis()); 39 this.identity = identity; 40 this.serverInvokers = serverInvokers; 41 this.locators = null; 42 } 43 44 public NetworkNotification(ObjectName source, String type, Identity identity, InvokerLocator locators[]) 45 { 46 super(type, source, System.currentTimeMillis()); 47 this.identity = identity; 48 this.serverInvokers = null; 49 this.locators = locators; 50 } 51 52 57 public final Identity getIdentity() 58 { 59 return identity; 60 } 61 62 67 public final InvokerLocator[] getLocator() 68 { 69 if(locators != null) 70 { 71 return locators; 72 } 73 else 74 { 75 InvokerLocator[] locators = new InvokerLocator[serverInvokers.length]; 76 for(int x = 0; x < serverInvokers.length; x++) 77 { 78 locators[x] = serverInvokers[x].getInvokerLocator(); 79 } 80 return locators; 81 } 82 } 83 84 91 public final ServerInvokerMetadata[] getServerInvokers() 92 { 93 return serverInvokers; 94 } 95 } 96 | Popular Tags |