1 18 package org.apache.activemq.command; 19 20 25 public class BaseEndpoint implements Endpoint { 26 27 private String name; 28 BrokerInfo brokerInfo; 29 30 public BaseEndpoint(String name) { 31 this.name = name; 32 } 33 34 public String getName() { 35 return name; 36 } 37 38 public String toString() { 39 String brokerText = ""; 40 BrokerId brokerId = getBrokerId(); 41 if (brokerId != null) { 42 brokerText = " broker: " + brokerId; 43 } 44 return "Endpoint[name:" + name + brokerText + "]"; 45 } 46 47 51 public BrokerId getBrokerId() { 52 if (brokerInfo != null) { 53 return brokerInfo.getBrokerId(); 54 } 55 return null; 56 } 57 58 62 public BrokerInfo getBrokerInfo() { 63 return brokerInfo; 64 } 65 66 public void setBrokerInfo(BrokerInfo brokerInfo) { 67 this.brokerInfo = brokerInfo; 68 } 69 70 } 71 | Popular Tags |