Package java.lang.reflect

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


      Method meth = m_Methods[i].getMethod();
      if (name.equals("globalInfo")) {
  if (meth.getReturnType().equals(String.class)) {
    try {
      Object args[] = { };
      String globalInfo = (String)(meth.invoke(m_Target, args));
            String summary = globalInfo;
            int ci = globalInfo.indexOf('.');
            if (ci != -1) {
              summary = globalInfo.substring(0, ci + 1);
            }
View Full Code Here


    String mname = m_Methods[j].getDisplayName();
    Method meth = m_Methods[j].getMethod();
    if (mname.equals(tipName)) {
      if (meth.getReturnType().equals(String.class)) {
        try {
    String tempTip = (String)(meth.invoke(m_Target, args));
    int ci = tempTip.indexOf('.');
    if (ci < 0) {
      m_TipTexts[i] = tempTip;
    } else {
      m_TipTexts[i] = tempTip.substring(0, ci);
View Full Code Here

    m_Values[i] = value;
    Method setter = property.getWriteMethod();
    try {
      Object args[] = { value };
      args[0] = value;
      setter.invoke(m_Target, args);
    } catch (InvocationTargetException ex) {
      if (ex.getTargetException()
    instanceof PropertyVetoException) {
              String message = "WARNING: Vetoed; reason is: "
                               + ex.getTargetException().getMessage();
View Full Code Here

        Method method = this.getClass().getMethod(methodName, new Class[]
        {
          type
        });
        method.invoke(this, new Object[]
        {
          convert
        });

      }
View Full Code Here

   
    Class service = null;
    service = Class.forName(desc.getClassName());
    Method init = service.getMethod("init", ptypes);

    init.invoke(null, args);
    desc.running = true;
    desc.initialized = true;
   
    if (xlogmon.isLoggable(BasicLevel.DEBUG)) {
      xlogmon.log(BasicLevel.DEBUG, getName() + " service started");
View Full Code Here

    // DF: idempotency (could be done in AgentAdmin)
    if (! desc.running) return;
//       throw new Exception("Service already stopped");
    Class service = Class.forName(desc.getClassName());
    Method stop = service.getMethod("stopService", new Class[0]);
    stop.invoke(null, (Object[]) null);
    desc.running = false;

    if (xlogmon.isLoggable(BasicLevel.DEBUG))
      xlogmon.log(BasicLevel.DEBUG, "Service " + desc.scname + " stopped.");
  }
View Full Code Here

   */
  public void close() throws HibernateException {
    if(dataSource != null)
    try {
      Method mClose = dataSource.getClass().getMethod("close", null);
      mClose.invoke(dataSource, null);
    } catch (Exception e) {
      throw new HibernateException(e);
    }
    dataSource = null;
  }
View Full Code Here

           
            Class  cla = root_class_loader.loadClass( builtin_plugins[i][1]);
                   
                Method  load_method = cla.getMethod( "load", new Class[]{ PluginInterface.class });
               
                load_method.invoke( null, new Object[]{ getDefaultInterfaceSupport() });
               
          Logger.log(new LogEvent(LOGID, LogEvent.LT_WARNING,
              "Built-in plugin '" + builtin_plugins[i][0] + "' ok"));
              }catch( NoSuchMethodException e ){
               
View Full Code Here

          // if we need to improve on this then we'll have to move to a system more akin to
          // the dir-loaded plugins
                         
        Method  load_method = cla.getMethod( "load", new Class[]{ PluginInterface.class });
           
            load_method.invoke( null, new Object[]{ getDefaultInterfaceSupport() });
           
        }catch( NoSuchMethodException e ){
           
        }catch( Throwable e ){
           
View Full Code Here

            try{

              Method  load_method = plugin.getClass().getMethod( "load", new Class[]{ PluginInterface.class });

              load_method.invoke( plugin, new Object[]{ plugin_interface });

            }catch( NoSuchMethodException e ){

            }catch( Throwable 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.