Examples of newInstance()


Examples of com.caucho.bytecode.CodeWriterAttribute.newInstance()

    CodeWriterAttribute code = jMethod.createCodeWriter();
    code.setMaxLocals(1 + 2 * parameterTypes.length);
    code.setMaxStack(3 + 2 * parameterTypes.length);

    code.newInstance("java/lang/UnsupportedOperationException");
    code.dup();
    code.invokespecial("java/lang/UnsupportedOperationException",
                       "<init>",
                       "()V",
                       3, 1);
View Full Code Here

Examples of com.esotericsoftware.reflectasm.ConstructorAccess.newInstance()

        try {
          final ConstructorAccess access = ConstructorAccess.get(type);
          return new ObjectInstantiator() {
            public Object newInstance () {
              try {
                return access.newInstance();
              } catch (Exception ex) {
                throw new KryoException("Error constructing instance of class: " + className(type), ex);
              }
            }
          };
View Full Code Here

Examples of com.gemstone.gemfire.Instantiator.newInstance()

  @Test
  public void testClassGeneration() throws Exception {
    Instantiator instantiator = asmFactory.getInstantiator(SomeClass.class, 100);
    assertEquals(100, instantiator.getId());
    assertEquals(SomeClass.class, instantiator.getInstantiatedClass());
    Object instance = instantiator.newInstance();
    assertEquals(SomeClass.class, instance.getClass());
    assertTrue(SomeClass.instantiated);
  }

  @Test
View Full Code Here

Examples of com.gwtent.reflection.client.Constructor.newInstance()

public class JsonSerializer extends AbstractDataContractSerializer{
  protected Object deserializeObject(String json, ClassType type){
    JSONValue value = JSONParser.parse(json);
   
    Constructor constructor = type.findConstructor(new String[0]);
    Object result = constructor.newInstance();
   
    deserialize(value, result, type);
   
    return result;
  }
View Full Code Here

Examples of com.jengine.orm.model.ModelClassBase.newInstance()

        List keys = (List) values.get(fieldName);
        ModelClassBase middleModelClass = getMiddleClass();
        Field middleModelField = getMiddleField();
        Field middleModelReferenceField = getReverseField().getMiddleField();
        for (Object key : keys) {
            Model middleObj = middleModelClass.newInstance();
            middleObj.setValue(middleModelField, values.get(getKeyFieldName()));
            middleObj.setValue(middleModelReferenceField, key);
            middleObj.save();
        }
    }
View Full Code Here

Examples of com.mobixess.jodb.core.transaction.JODBSession.ClassDescriptor.newInstance()

        if (persistentDataContainer.isArray()) {
            return Array.newInstance(type, persistentDataContainer.getActiveFieldsIterator().getRemainingInCurrentCategory());
        }
           
        try {
            return classDescriptor.newInstance();
        } catch (IllegalClassTypeException e) {
            throw new JodbIOException(e);
        }
    }
View Full Code Here

Examples of com.mysema.query.types.QTuple.newInstance()

    public void In_Tuple() throws ClassNotFoundException, IOException {
        //(survey.id, survey.name)
        QSurvey survey = QSurvey.survey;
        QTuple tuple = new QTuple(survey.id, survey.name);
        serialize(tuple);
        serialize(tuple.newInstance(1, "a"));
    }

    private Object serialize(Object obj) throws IOException, ClassNotFoundException{
        ByteArrayOutputStream bytesOut = new ByteArrayOutputStream();
        ObjectOutputStream out = new ObjectOutputStream(bytesOut);
View Full Code Here

Examples of com.mysql.clusterj.Session.newInstance()

            final int id = i;
            pool.submit(new Runnable() {
               
                public void run() {
                    Session session = Manager.getSessionFactory().getSession();
                    Employee entity = session.newInstance(Employee.class); // crash here?
                    entity.setId(id);
                    entity.setAge(id);
                    entity.setMagic(id);
                    entity.setName("Employee " + id);
                    session.currentTransaction().begin();
View Full Code Here

Examples of com.mysql.clusterj.core.spi.SessionSPI.newInstance()

        try {
            // execute the query
            ResultData resultData = getResultData(context);
            // put the result data into the result list
            while (resultData.next()) {
                T row = (T) session.newInstance(cls);
                ValueHandler handler =domainTypeHandler.getValueHandler(row);
                // set values from result set into object
                domainTypeHandler.objectSetValues(resultData, handler);
                resultList.add(row);
            }
View Full Code Here

Examples of com.nokia.dempsy.container.internal.LifecycleHelper.newInstance()

   throws Exception
   {
      InvocationTestMP prototype = new InvocationTestMP();
      LifecycleHelper invoker = new LifecycleHelper(prototype);

      InvocationTestMP instance = (InvocationTestMP)invoker.newInstance();
      assertNotNull("instantiation failed; null instance", instance);
      assertNotSame("instantiation failed; returned prototype", prototype, instance);

      assertFalse("instance activated before activation method called", instance.isActivated);
      assertTrue(invoker.activate(instance, null, "ABC".getBytes()));
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.