Examples of ObjenesisException


Examples of ext.jtester.objenesis.ObjenesisException

  public ConstructorInstantiator(Class type) {
    try {
      constructor = type.getDeclaredConstructor((Class[]) null);
    } catch (Exception e) {
      throw new ObjenesisException(e);
    }
  }
View Full Code Here

Examples of org.drools.objenesis.ObjenesisException

     * @param type Class to instantiate
     * @return The ObjectInstantiator for the class
     */
    public ObjectInstantiator newInstantiatorOf(final Class type) {
        if ( !Serializable.class.isAssignableFrom( type ) ) {
            throw new ObjenesisException( new NotSerializableException( type + " not serializable" ) );
        }
        if ( JVM_NAME.startsWith( SUN ) ) {
            if ( VM_VERSION.startsWith( "1.3" ) ) {
                return new Sun13SerializationInstantiator( type );
            }
View Full Code Here

Examples of org.drools.objenesis.ObjenesisException

    public Object newInstance() {
        try {
            return newObjectMethod.invoke( dummyStream,
                                           new Object[]{this.type, this.superType} );
        } catch ( final Exception e ) {
            throw new ObjenesisException( e );
        }
    }
View Full Code Here

Examples of org.drools.objenesis.ObjenesisException

                newObjectMethod = ObjectInputStream.class.getDeclaredMethod( "newObject",
                                                                             new Class[]{Class.class, Class.class} );
                newObjectMethod.setAccessible( true );
                dummyStream = new DummyStream();
            } catch ( final Exception e ) {
                throw new ObjenesisException( e );
            }
        }
    }
View Full Code Here

Examples of org.drools.objenesis.ObjenesisException

    public Object newInstance() {
        try {
            return allocateNewObjectMethod.invoke( null,
                                                   new Object[]{this.type, this.superType} );
        } catch ( final Exception e ) {
            throw new ObjenesisException( e );
        }
    }
View Full Code Here

Examples of org.drools.objenesis.ObjenesisException

            try {
                allocateNewObjectMethod = ObjectInputStream.class.getDeclaredMethod( "allocateNewObject",
                                                                                     new Class[]{Class.class, Class.class} );
                allocateNewObjectMethod.setAccessible( true );
            } catch ( final Exception e ) {
                throw new ObjenesisException( e );
            }
        }
    }
View Full Code Here

Examples of org.drools.objenesis.ObjenesisException

             * @todo (Henri) I think we should throw a NotSerializableException just to put the same
             *       message a ObjectInputStream. Otherwise, the user won't know if the null returned
             *       if a "Not serializable", a "No default constructor on ancestor" or a "Exception in
             *       constructor"
             */
            throw new ObjenesisException( new NotSerializableException( type + " has no suitable superclass constructor" ) );
        }

        this.mungedConstructor = reflectionFactory.newConstructorForSerialization( type,
                                                                              nonSerializableAncestorConstructor );
        this.mungedConstructor.setAccessible( true );
View Full Code Here

Examples of org.drools.objenesis.ObjenesisException

    public Object newInstance() {
        try {
            return this.mungedConstructor.newInstance( (Object[]) null );
        } catch ( final Exception e ) {
            throw new ObjenesisException( e );
        }
    }
View Full Code Here

Examples of org.drools.objenesis.ObjenesisException

    public Object newInstance() {
        try {
            return allocateNewObjectMethod.invoke( null,
                                                   new Object[]{this.type, Object.class} );
        } catch ( final Exception e ) {
            throw new ObjenesisException( e );
        }
    }
View Full Code Here

Examples of org.objenesis.ObjenesisException

      newInstanceMethod = getNewInstanceMethod();
      Method m = null;
      try {
         m = ObjectStreamClass.class.getMethod("lookupAny", Class.class);
      } catch (NoSuchMethodException e) {
         throw new ObjenesisException(e);
      }
      try {
         objectStreamClass = (ObjectStreamClass) m.invoke(null, type);
      } catch (IllegalAccessException e) {
         throw new ObjenesisException(e);
      } catch (InvocationTargetException e) {
         throw new ObjenesisException(e);
      }
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.