1 | |
package org.kuali.student.common.assembly.util.spring; |
2 | |
|
3 | |
import org.aspectj.lang.ProceedingJoinPoint; |
4 | |
import org.kuali.student.common.assembly.data.Metadata; |
5 | |
import org.kuali.student.common.util.spring.MethodArgsToObjectEhcacheAdvice; |
6 | |
|
7 | 0 | public class MetadataMethodEhcacheAdvice extends MethodArgsToObjectEhcacheAdvice { |
8 | |
|
9 | |
@Override |
10 | |
public Object getFromCache(ProceedingJoinPoint pjp) throws Throwable { |
11 | |
try{ |
12 | |
|
13 | 0 | Metadata result = (Metadata) super.getFromCache(pjp); |
14 | 0 | return new Metadata(result); |
15 | 0 | }catch(ClassCastException e){ |
16 | 0 | throw new RuntimeException("This cache should only be used on methods that return Metadata", e); |
17 | |
} |
18 | |
} |
19 | |
|
20 | |
|
21 | |
} |