1 Reply Latest reply on Nov 13, 2012 11:46 AM by Alejandro Profet

    invokeMethod() in oracle.jbo.server.ApplicationModuleImpl?

      Has anyone had experience with invokeMethod in class oracle.jbo.server.ApplicationModuleImpl?

      Documentation is very poor.
      How do you use it? What are the arguments?

      java.lang.Object target,
      java.lang.String methodName,
      java.lang.String[] argTypeNames,
      java.lang.Object[] args

      I want to write a generic method that would get any application module's instance and invoke it's method (client interface) with invokeMethod probably?
      Something like that:
      am = (ApplicationModuleImpl)Configuration.createRootApplicationModule(appModuleDef, conf);
      Object returnObject = am.invokeMethod(?, ?, ?, ?);
      Please, any info is appreciated :)
      Regars, Marko
        • 1. Re: invokeMethod() in oracle.jbo.server.ApplicationModuleImpl?
          Alejandro Profet
          Hi Marko,

          There is not much documentation about that method, and when I test it, always throws a UnsupportedOperationException.
          However, you can use reflection in order to invoke a method in your ApplicationModuleImpl (which is precisely what the invokeMethod should do).
          With this class you can invoke methods in safe mode: https://gist.github.com/4031974
          And then you would be able to invoke the method of ApplicationModuleImpl with something like this:
          oracle.jbo.server.ApplicationModuleImpl am = (oracle.jbo.server.ApplicationModuleImpl)Configuration.createRootApplicationModule("model.Model", "AppModuleLocal");
          SafeReflection.invoke(am, "setBindVariables", new Class[] { String.class, String.class, String.class }, new Object[] { "en", "john.doe", "John Doe" });
          Configuration.releaseRootApplicationModule(am, false);