Package java.lang.reflect

Examples of java.lang.reflect.Method.invoke()


      Object object = constructor.newInstance(new Object[] {});

      Method method = uiswClass.getMethod("open", new Class[] {});

      method.invoke(object, new Object[] {});

    } catch (Exception e) {
      Debug.printStackTrace(e);
    }
View Full Code Here


      
        Class  main_class = Class.forName( uiclass );
     
        Method main_method = main_class.getMethod( "main", new Class[]{ String[].class });
       
         main_method.invoke( null, new Object[]{ commands.getArgs()});
       
        return( true );
       
      }catch( Throwable e ){
       
View Full Code Here

            serverClass = loader.loadClass("helma.main.Server");
            Class[] cargs = new Class[]{args.getClass()};
            Method loadServer = serverClass.getMethod("loadServer", cargs);
            Object[] nargs = new Object[]{args};
            // and invoke the static loadServer(String[]) method
            server = loadServer.invoke(null, nargs);
            Method init = serverClass.getMethod("init", EMPTY_CLASS_ARRAY);
            init.invoke(server, EMPTY_OBJECT_ARRAY);
        } catch (Exception x) {
            // unable to get Helma installation dir from launcher jar
            System.err.println("Unable to load Helma: ");
View Full Code Here

            Method loadServer = serverClass.getMethod("loadServer", cargs);
            Object[] nargs = new Object[]{args};
            // and invoke the static loadServer(String[]) method
            server = loadServer.invoke(null, nargs);
            Method init = serverClass.getMethod("init", EMPTY_CLASS_ARRAY);
            init.invoke(server, EMPTY_OBJECT_ARRAY);
        } catch (Exception x) {
            // unable to get Helma installation dir from launcher jar
            System.err.println("Unable to load Helma: ");
            x.printStackTrace();
            System.exit(2);
View Full Code Here

    }

    public void start() {
        try {
            Method start = serverClass.getMethod("start", EMPTY_CLASS_ARRAY);
            start.invoke(server, EMPTY_OBJECT_ARRAY);
        } catch (Exception x) {
            // unable to get Helma installation dir from launcher jar
            System.err.println("Unable to start Helma: ");
            x.printStackTrace();
            System.exit(2);
View Full Code Here

    }

    public void stop() {
        try {
            Method start = serverClass.getMethod("stop", EMPTY_CLASS_ARRAY);
            start.invoke(server, EMPTY_OBJECT_ARRAY);
        } catch (Exception x) {
            // unable to get Helma installation dir from launcher jar
            System.err.println("Unable to stop Helma: ");
            x.printStackTrace();
            System.exit(2);
View Full Code Here

    }

    public void destroy() {
        try {
            Method start = serverClass.getMethod("shutdown", EMPTY_CLASS_ARRAY);
            start.invoke(server, EMPTY_OBJECT_ARRAY);
        } catch (Exception x) {
            // unable to get Helma installation dir from launcher jar
            System.err.println("Unable to shutdown Helma: ");
            x.printStackTrace();
            System.exit(2);
View Full Code Here

        } finally {
          classToMethod.put(type, method);
        }
      }
      try {
        method.invoke(this, connection, object);
      } catch (Throwable ex) {
        if (ex instanceof InvocationTargetException && ex.getCause() != null) ex = ex.getCause();
        if (ex instanceof RuntimeException) throw (RuntimeException)ex;
        throw new RuntimeException("Error invoking method: " + getClass().getName() + "#received(Connection, "
          + type.getName() + ")", ex);
View Full Code Here

          });

          Method methSetUrl = claBrowser.getMethod("setUrl", new Class[] {
            String.class
          });
          methSetUrl.invoke(browser, new Object[] {
            "about:blank"
          });

          break;
        }
View Full Code Here

          break;
        }
      }
      Method methDisposeShell = claShell.getMethod("dispose", new Class[] {});
      methDisposeShell.invoke(shell, new Object[] {});

      return true;
    } catch (Throwable e) {
      log("Browser check failed with: " + Debug.getNestedExceptionMessage(e));
      return false;
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.