Examples of toMethod()


Examples of javassist.CtConstructor.toMethod()

        try
        {
            CtConstructor defaultConstructor = _ctClass.getConstructor("()V");

            CtMethod initializerMethod = defaultConstructor.toMethod(initializer, _ctClass);

            _ctClass.addMethod(initializerMethod);
        }
        catch (Exception ex)
        {
View Full Code Here

Examples of javassist.CtConstructor.toMethod()

         return;
      }

      LOGGER.debug("Apply serializable bytecode modifier");

      CtMethod defaultConstMethod = defaultCons.toMethod(DEFAULT_CONS_METHOD_NAME, classToModify);
      defaultConstMethod.setModifiers(Modifier.PUBLIC);

      if (hasDefaultConstMethod(classToModify.getSuperclass())) {
         defaultConstMethod.insertBefore("super." + DEFAULT_CONS_METHOD_NAME + "();");
      }
View Full Code Here

Examples of javassist.CtConstructor.toMethod()

    for (CtClass CtInterface : from.getInterfaces()) {
      ctClass.addInterface(CtInterface);
    }
    CtConstructor initializer = from.getClassInitializer();
    if (initializer != null) {
      ctClass.addMethod(initializer.toMethod("patchStaticInitializer", ctClass));
      ctClass.makeClassInitializer().insertAfter("patchStaticInitializer();");
    }
  }

  @Patch(
View Full Code Here

Examples of org.jboss.ejb3.common.lang.SerializableMethod.toMethod()

      assert serializableMethodArg instanceof SerializableMethod : "2nd Argument was expected to be of type "
            + SerializableMethod.class.getName() + ", was instead " + serializableMethodArg;
      SerializableMethod serializableMethod = (SerializableMethod) serializableMethodArg;

      // Obtain the Method represented by the SerializableMethod
      Method dynamicInvokeMethod = serializableMethod.toMethod();
      long hash = MethodHashing.calculateHash(dynamicInvokeMethod);

      // Log
      log.debug("Received invocation request to method " + serializableMethod + "; using hash: " + hash);
View Full Code Here

Examples of org.jboss.ejb3.common.lang.SerializableMethod.toMethod()

      final SerializableMethod invokedMethod = new SerializableMethod(method, actualClass);
     
      /*
       * Obtain the Container
       */
      final InvokableContext container = this.getContainer(invokedMethod.toMethod(), usedArgs);

      /*
       * Invoke
       */

 
View Full Code Here

Examples of org.jboss.ejb3.common.lang.SerializableMethod.toMethod()

      final SerializableMethod invokedMethod = new SerializableMethod(method, actualClass);
     
      /*
       * Obtain the Container
       */
      final InvokableContext container = this.getContainer(invokedMethod.toMethod(), usedArgs);

      /*
       * Invoke
       */

 
View Full Code Here

Examples of org.jboss.ejb3.common.lang.SerializableMethod.toMethod()

      Method methodWithoutPrimitivesParams = myClass.getClass().getMethod("methodWithParamAndReturningVoid",
            new Class[]
            {Integer.class});
      SerializableMethod serializableMethod = new SerializableMethod(methodWithoutPrimitivesParams, myClass.getClass());
      // invoke the toMethod()
      Method copyOfMethodWithoutPrimitiveParams = serializableMethod.toMethod();

      // test equals
      assertTrue(
            "Failure - The method returned by toMethod() of SerializableMethod is not equal to the original method",
            methodWithoutPrimitivesParams.equals(copyOfMethodWithoutPrimitiveParams));
View Full Code Here

Examples of org.jboss.ejb3.common.lang.SerializableMethod.toMethod()

      Method methodWithGenerics = myClass.getClass().getMethod("methodWithGenerics", new Class[]
      {List.class, int.class});
      SerializableMethod serializableMethod = new SerializableMethod(methodWithGenerics, myClass.getClass());

      Method copyOfMethodWithGenerics = serializableMethod.toMethod();

      // test equals
      assertTrue(
            "Failure - The method returned by toMethod() of SerializableMethod is not equal to the original method",
            methodWithGenerics.equals(copyOfMethodWithGenerics));
View Full Code Here

Examples of org.jboss.ejb3.common.lang.SerializableMethod.toMethod()

      Method method = myClass.getClass().getMethod("methodWithPrimitiveParamsAndReturningVoid", new Class[]
      {byte.class, short.class, int.class, long.class, char.class, float.class, double.class, boolean.class});
      SerializableMethod serializableMethod = new SerializableMethod(method, myClass.getClass());
      // invoke the toMethod()
      Method copyOfMethod = serializableMethod.toMethod();

      // test equals
      assertTrue(
            "Failure - The method returned by toMethod() of SerializableMethod is not equal to the original method",
            method.equals(copyOfMethod));
View Full Code Here

Examples of org.jboss.ejb3.common.lang.SerializableMethod.toMethod()

      Method methodReturningInteger = myClass.getClass().getMethod("methodReturingInteger", new Class[]
      {Integer.class});
      SerializableMethod serializableMethod = new SerializableMethod(methodReturningInteger, myClass.getClass());
      // invoke the toMethod()
      Method copyOfMethodReturingInteger = serializableMethod.toMethod();

      // test equals
      assertTrue(
            "Failure - The method returned by toMethod() of SerializableMethod is not equal to the original method",
            methodReturningInteger.equals(copyOfMethodReturingInteger));
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.