Author: chris.laprun(a)jboss.com
Date: 2011-09-16 18:31:51 -0400 (Fri, 16 Sep 2011)
New Revision: 7458
Modified:
components/wsrp/trunk/jcr-impl/src/main/java/org/gatein/wsrp/consumer/registry/JCRConsumerRegistry.java
Log:
- Should have been included in last commit?\226?\128?\166
Modified:
components/wsrp/trunk/jcr-impl/src/main/java/org/gatein/wsrp/consumer/registry/JCRConsumerRegistry.java
===================================================================
---
components/wsrp/trunk/jcr-impl/src/main/java/org/gatein/wsrp/consumer/registry/JCRConsumerRegistry.java 2011-09-16
22:27:25 UTC (rev 7457)
+++
components/wsrp/trunk/jcr-impl/src/main/java/org/gatein/wsrp/consumer/registry/JCRConsumerRegistry.java 2011-09-16
22:31:51 UTC (rev 7458)
@@ -257,19 +257,22 @@
ProducerInfosMapping producerInfosMapping = getProducerInfosMapping(session);
// check if we need to refresh the local cache
- if (lastModified < producerInfosMapping.getLastModified())
+ if (consumers.isInvalidated() || lastModified <
producerInfosMapping.getLastModified())
{
List<ProducerInfoMapping> mappings =
producerInfosMapping.getProducerInfos();
for (ProducerInfoMapping pim : mappings)
{
- if (lastModified < pim.getLastModified())
+ String id = pim.getId();
+ // only recreate the consumer if it's not in the cache or it's been
modified after we've been last modified
+ if (consumers.getConsumer(id) == null || lastModified <
pim.getLastModified())
{
- consumers.putConsumer(pim.getId(), createConsumerFrom(pim.toModel(null,
this)));
+ consumers.putConsumer(id, createConsumerFrom(pim.toModel(null, this)));
}
}
lastModified = System.currentTimeMillis();
+ consumers.setInvalidated(false);
}
return consumers;
Show replies by date