01: /*
02: * Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com>
03: * Distributed under the terms of either:
04: * - the common development and distribution license (CDDL), v1.0; or
05: * - the GNU Lesser General Public License, v2.1 or later
06: * $Id: ContinuableDetector.java 3811 2007-06-25 15:06:16Z gbevin $
07: */
08: package com.uwyn.rife.continuations.instrument;
09:
10: import com.uwyn.rife.continuations.ContinuationConfigInstrument;
11: import com.uwyn.rife.instrument.ClassBytesProvider;
12: import com.uwyn.rife.instrument.ClassInterfaceDetector;
13:
14: /**
15: * Detects whether a class implements the continuable marker interface that is
16: * setup in the provided instrumentation config.
17: * <p>This is done without actually loading the class and by analyzing the
18: * bytecode itself. It's important to not load the class because the class is
19: * supposed to be instrumented before actually loading it, if it implements
20: * the marker interface.
21: *
22: * @author Geert Bevin (gbevin[remove] at uwyn dot com)
23: * @version $Revision: 3811 $
24: * @since 1.6
25: */
26: public class ContinuableDetector extends ClassInterfaceDetector {
27: /**
28: * Creates a new instance of the detector.
29: *
30: * @param config the instrumentation configuration
31: * @param bytesProvider the bytecode provider that will be used to load
32: * the bytes relevant classes and interfacse
33: * @since 1.6
34: */
35: public ContinuableDetector(ContinuationConfigInstrument config,
36: ClassBytesProvider bytesProvider) {
37: super (bytesProvider, config.getContinuableMarkerInterfaceName()
38: .replace('.', '/').intern());
39: }
40: }
|