01: /*
02: * All content copyright (c) 2003-2007 Terracotta, Inc., except as may otherwise be noted in a separate copyright
03: * notice. All rights reserved.
04: */
05: package org.terracotta.modules.cglib_2_1_3;
06:
07: import org.osgi.framework.BundleContext;
08: import org.osgi.framework.Constants;
09: import org.terracotta.modules.cglib_2_1_3.object.config.CGLibChangeApplicatorSpec;
10: import org.terracotta.modules.cglib_2_1_3.object.config.CGLibModuleSpec;
11: import org.terracotta.modules.configuration.TerracottaConfiguratorModule;
12:
13: import com.tc.object.config.ModuleSpec;
14:
15: import java.util.Dictionary;
16: import java.util.Hashtable;
17:
18: public final class CGLibTerracottaConfigurator extends
19: TerracottaConfiguratorModule {
20: protected final void addInstrumentation(final BundleContext context) {
21: configHelper.addCustomAdapter("net.sf.cglib.proxy.Enhancer",
22: new CGLibProxyEnhancerAdapter(context.getBundle()));
23: configHelper.allowCGLIBInstrumentation();
24: }
25:
26: protected final void registerModuleSpec(final BundleContext context) {
27: final Dictionary serviceProps = new Hashtable();
28: serviceProps.put(Constants.SERVICE_VENDOR, "Terracotta, Inc.");
29: serviceProps.put(Constants.SERVICE_DESCRIPTION,
30: "CGLIB Plugin Spec");
31: context.registerService(ModuleSpec.class.getName(),
32: new CGLibModuleSpec(new CGLibChangeApplicatorSpec(
33: getClass().getClassLoader())), serviceProps);
34: }
35:
36: }
|