Fixed some npe I'd just introduced

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@382353 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2006-03-02 11:28:40 +00:00
parent c82f6f3309
commit 2eae0548d8
3 changed files with 3 additions and 4 deletions

View File

@ -129,7 +129,6 @@ public class ManagedRegionBroker extends RegionBroker{
}
public void registerSubscription(ConnectionContext context,Subscription sub){
// NEED CONTEXT TO GET CLIENT ID AND USE Subscription KEY!!!
SubscriptionKey key = new SubscriptionKey(context.getClientId(),sub.getConsumerInfo().getSubcriptionName());
Hashtable map=new Hashtable(brokerObjectName.getKeyPropertyList());
map.put("Type",JMXSupport.encodeObjectNamePart("Subscription"));

View File

@ -90,7 +90,7 @@ public class RegionBroker implements Broker {
public RegionBroker(BrokerService brokerService,TaskRunnerFactory taskRunnerFactory, UsageManager memoryManager, PersistenceAdapter adapter, PolicyMap policyMap) throws IOException {
this.brokerService = brokerService;
this.sequenceGenerator.setLastSequenceId( adapter.getLastMessageBrokerSequenceId() );
this.adaptor = adaptor;
this.adaptor = adapter;//weird - both are valid spellings ...
queueRegion = createQueueRegion(memoryManager, taskRunnerFactory, adapter, policyMap);
topicRegion = createTopicRegion(memoryManager, taskRunnerFactory, adapter, policyMap);

View File

@ -31,8 +31,8 @@ public class SubscriptionKey {
public SubscriptionKey(String clientId, String subscriptionName) {
this.clientId = clientId;
this.subscriptionName = subscriptionName;
hashValue = clientId.hashCode()^subscriptionName.hashCode();
this.subscriptionName = subscriptionName != null? subscriptionName : "NOT_SET";
hashValue = clientId.hashCode()^this.subscriptionName.hashCode();
}