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: ElementDetector.java 3811 2007-06-25 15:06:16Z gbevin $
07: */
08: package com.uwyn.rife.engine.instrument;
09:
10: import com.uwyn.rife.engine.EngineClassLoader;
11: import com.uwyn.rife.instrument.ClassInterfaceDetector;
12:
13: public class ElementDetector extends ClassInterfaceDetector {
14: private static final String ELEMENT_NAME = "com.uwyn.rife.engine.Element";
15: private static final String ELEMENTAWARE_INTERNAL_NAME = "com/uwyn/rife/engine/ElementAware";
16: private static final String ELEMENTAWARE_NAME = "com.uwyn.rife.engine.ElementAware";
17:
18: public ElementDetector(EngineClassLoader classLoader) {
19: super (classLoader, ELEMENTAWARE_INTERNAL_NAME);
20: }
21:
22: public boolean detect(String classname, byte[] bytes,
23: boolean doAutoReload) throws ClassNotFoundException {
24: if (ELEMENT_NAME == classname || ELEMENTAWARE_NAME == classname) {
25: return false;
26: }
27:
28: return super.detect(bytes, doAutoReload);
29: }
30: }
|