01: package org.terracotta.modules.ehcache_1_2_4;
02:
03: import org.osgi.framework.Bundle;
04: import org.osgi.framework.BundleContext;
05: import org.terracotta.modules.ehcache.commons_1_0.EhcacheTerracottaCommonsConfigurator;
06:
07: import com.tc.object.bytecode.ClassAdapterFactory;
08: import com.tc.object.config.TransparencyClassSpec;
09:
10: public final class EhcacheTerracottaConfigurator extends
11: EhcacheTerracottaCommonsConfigurator {
12: protected void addInstrumentation(BundleContext context) {
13: super .addInstrumentation(context);
14:
15: Bundle bundle = getExportedBundle(context,
16: getExportedBundleName());
17: addClassReplacement(bundle, MEMORYSTORE_CLASS_NAME_DOTS,
18: MEMORYSTORETC_CLASS_NAME_DOTS);
19:
20: ClassAdapterFactory factory = new EhcacheCacheManagerClassAdapter();
21: TransparencyClassSpec spec = configHelper
22: .getOrCreateSpec(CACHE_MANAGER_CLASS_NAME_DOTS);
23: spec.setCustomClassAdapter(factory);
24: }
25:
26: protected String getExportedBundleName() {
27: return EHCACHE_124_BUNDLE_NAME;
28: }
29: }
|