Jonas B. Lim 2006-10-03 08:33:15 +00:00
parent fa4279c433
commit 62cb1b6cb0
1 changed files with 31 additions and 22 deletions

View File

@ -170,16 +170,25 @@ public class ManagedRegionBroker extends RegionBroker {
public ObjectName registerSubscription(ConnectionContext context, Subscription sub) {
Hashtable map = brokerObjectName.getKeyPropertyList();
String name="";
String persistentMode = "";
String destinationType = "";
String destinationName = "";
String clientID = "";
SubscriptionKey key = new SubscriptionKey(context.getClientId(), sub.getConsumerInfo().getSubcriptionName());
if (sub.getConsumerInfo().isDurable()) {
name=key.toString();
persistentMode = "Durable";
} else {
name=sub.getConsumerInfo().getConsumerId().toString();
persistentMode = "Non-Durable";
}
destinationType = sub.getConsumerInfo().getDestination().getDestinationTypeAsString();
destinationName = sub.getConsumerInfo().getDestination().getPhysicalName();
clientID = context.getClientId();
try {
ObjectName objectName = new ObjectName(brokerObjectName.getDomain() + ":" + "BrokerName=" + map.get("BrokerName")
+","+"Type=Subscription,"+"active=true,"+"name="+JMXSupport.encodeObjectNamePart(name)+"");
+ "," + "Type=Subscription, persistentMode=" + persistentMode + ", destinationType=" + destinationType + " ,destinationName=" + JMXSupport.encodeObjectNamePart(destinationName) + " ,clientID=" + JMXSupport.encodeObjectNamePart(clientID) + "");
SubscriptionView view;
if (sub.getConsumerInfo().isDurable()) {
view = new DurableSubscriptionView(this, context.getClientId(), sub);