| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
package org.kuali.rice.kns.util; |
| 17 |
|
|
| 18 |
|
import java.util.Properties; |
| 19 |
|
|
| 20 |
|
import org.apache.log4j.Logger; |
| 21 |
|
import org.apache.ojb.broker.Identity; |
| 22 |
|
import org.apache.ojb.broker.PersistenceBroker; |
| 23 |
|
import org.apache.ojb.broker.cache.ObjectCachePerBrokerImpl; |
| 24 |
|
|
|
|
|
| 0% |
Uncovered Elements: 26 (26) |
Complexity: 8 |
Complexity Density: 0.53 |
|
| 25 |
|
public class KualiObjectCachePerBrokerImpl extends ObjectCachePerBrokerImpl { |
| 26 |
|
private static final Logger LOG = Logger.getLogger(KualiObjectCachePerBrokerImpl.class); |
| 27 |
|
|
| 28 |
|
|
| 29 |
|
private final String brokerId; |
| 30 |
|
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
| 31 |
0
|
public KualiObjectCachePerBrokerImpl(PersistenceBroker broker, Properties prop) {... |
| 32 |
0
|
super(broker, prop); |
| 33 |
0
|
brokerId = broker.getClass().getName() + "@" + broker.hashCode(); |
| 34 |
|
|
| 35 |
0
|
LOG.debug("created objectCache for broker " + brokerId); |
| 36 |
|
} |
| 37 |
|
|
| 38 |
|
|
| 39 |
|
|
| 40 |
|
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
| 41 |
0
|
public void clear() {... |
| 42 |
0
|
super.clear(); |
| 43 |
|
|
| 44 |
0
|
LOG.debug("cleared objectCache for broker " + brokerId); |
| 45 |
|
} |
| 46 |
|
|
| 47 |
|
|
| 48 |
|
@see |
| 49 |
|
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
| 50 |
0
|
public void cache(Identity oid, Object obj) {... |
| 51 |
0
|
super.cache(oid, obj); |
| 52 |
|
|
| 53 |
0
|
boolean cached = (super.lookup(oid) != null); |
| 54 |
0
|
LOG.debug((cached ? "cached oid " : "unable to cache oid ") + oid + " in objectCache for broker " + brokerId); |
| 55 |
|
} |
| 56 |
|
|
| 57 |
|
|
| 58 |
|
@see |
| 59 |
|
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
| 60 |
0
|
public boolean cacheIfNew(Identity oid, Object obj) {... |
| 61 |
0
|
boolean cachedIfNew = super.cacheIfNew(oid, obj); |
| 62 |
|
|
| 63 |
0
|
boolean cached = (super.lookup(oid) != null); |
| 64 |
0
|
LOG.debug((cached ? "cached new oid " : "unable to cache new oid ") + oid + " in objectCache for broker " + brokerId); |
| 65 |
|
|
| 66 |
0
|
return cachedIfNew; |
| 67 |
|
} |
| 68 |
|
|
| 69 |
|
|
| 70 |
|
@see |
| 71 |
|
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
| 72 |
0
|
public Object lookup(Identity oid) {... |
| 73 |
0
|
Object o = super.lookup(oid); |
| 74 |
|
|
| 75 |
0
|
LOG.debug((o != null ? "found oid " : "cannot find oid ") + oid + " in objectCache for broker " + brokerId); |
| 76 |
|
|
| 77 |
0
|
return o; |
| 78 |
|
} |
| 79 |
|
} |