01: package org.drools.objenesis.instantiator.gcj;
02:
03: import org.drools.objenesis.ObjenesisException;
04:
05: /**
06: * Instantiates a class by making a call to internal GCJ private methods. It is only supposed to
07: * work on GCJ JVMs. This instantiator will not call any constructors.
08: *
09: * @author Leonardo Mesquita
10: * @see org.drools.objenesis.instantiator.ObjectInstantiator
11: */
12: public class GCJInstantiator extends GCJInstantiatorBase {
13: public GCJInstantiator(final Class type) {
14: super (type);
15: }
16:
17: public Object newInstance() {
18: try {
19: return newObjectMethod.invoke(dummyStream, new Object[] {
20: this .type, Object.class });
21: } catch (final Exception e) {
22: throw new ObjenesisException(e);
23: }
24: }
25: }
|