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 com.tc.object.config;
06:
07: /**
08: * This interface defines the contract between StandardDsoClientConfigHelper and a module so that the configHelper can get
09: * information such as custom applicator of a class from a module.
10: *
11: * The concept of "rank" comes from the OSGi "service rank", which lets you define how
12: * likely a service is to be returned as the default service from a bundle.
13: * @see org.osgi.framework.BundleContext#getServiceReference
14: * @see org.osgi.framework.Constants#SERVICE_RANKING
15: */
16: public interface ModuleSpec {
17:
18: /** OSGi service ranking defining which service is returned - LOW=0 */
19: public final static Integer LOW_RANK = new Integer(0);
20: /** OSGi service ranking defining which service is returned - NORMAL=1 */
21: public final static Integer NORMAL_RANK = new Integer(1); // default ranking
22: /** OSGi service ranking defining which service is returned - HIGH=2 */
23: public final static Integer HIGH_RANK = new Integer(2);
24:
25: /**
26: * Get specification of all change applicators to apply
27: * @return The spec
28: */
29: public ChangeApplicatorSpec getChangeApplicatorSpec();
30:
31: /**
32: * Ask module whether this class uses a non-default constructor.
33: * @param clazz The class in question
34: * @return True if uses non-default constructor
35: */
36: public boolean isUseNonDefaultConstructor(Class clazz);
37:
38: /**
39: * Get alternate peer class to use, generally if clazz is non-portable.
40: * @param clazz The class to check
41: * @return An alternate peer class or the original clazz
42: */
43: public Class getPeerClass(Class clazz);
44:
45: /**
46: * Check with module whether the specified class is portable.
47: * @param clazz The class
48: * @return True if portable, false if unknown (should check with other modules)
49: */
50: public boolean isPortableClass(Class clazz);
51: }
|