Package java.lang.reflect

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


             {
               try{

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

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

               }catch( NoSuchMethodException e ){

               }catch( Throwable e ){
View Full Code Here


                Object address = inetSocketAddressCtr.newInstance(
                        new Object[] { host, new Integer(port) });

                // now invoke the connect method with the timeout
                log.debug("Invoking connect with timeout=" + timeout);
                connectMethod.invoke(sock, new Object[]{address, new Integer(timeout)});
                log.debug("Connected successfully");
                return sock;
            }
            catch (InvocationTargetException ex) {
                Throwable target = ex.getTargetException();
View Full Code Here

            return true;
        try {
            // get the isConnected method
            Method connectedMethod = Socket.class.getMethod("isConnected", (Class[])null);
           
            Boolean result = (Boolean)connectedMethod.invoke(sock, (Object[])null);
            return result.booleanValue();
        }
        catch (InvocationTargetException ex) {
            Throwable target = ex.getTargetException();
            if (target instanceof IOException)
View Full Code Here

            Method getVersion = pluginClass.getMethod("getVersion", new Class[0]);

            Version version1 = null;
            try {
              version1 = (Version) getVersion.invoke(pluginClass, new Object[0]);
            } catch (Throwable t1) {
              t1.printStackTrace();
            }

            if (installedPlugin != null && (installedPlugin.getInfo().getVersion().compareTo(version1) > 0 || (installedPlugin.getInfo().getVersion().compareTo(version1) == 0 && version1.isStable()))) {
View Full Code Here

      if (moduleName.equals("Invoice"))
        return;

      classCV[0] = Class.forName(className);
      method = classCV[0].getMethod("getExternalID", null);
      ret = method.invoke(obj, null);

      id = getIDFromEXID(moduleName, ret.toString());

      if (isEntityModule(moduleName))
      {
View Full Code Here

        met = "setGlaccountID";
      }
      arg[0] = Integer.TYPE;
      idCV[0] = getObjectByName("int", id);
      method = classCV[0].getMethod(met, arg);
      method.invoke(obj, idCV);
    } catch (Exception e)
    {
      System.out.print(e);
      e.printStackTrace();
    }
View Full Code Here

        {
          argumentType[0] = Class.forName("java.lang.String");
          sep = getValueOfNodeByTagName(configXML, TAG_SEPARATOR);
          method = classCV[0].getMethod("setCustomType", argumentType);
          arguments[0] = sep;
          method.invoke(objectCV, arguments);

          arguments[0] = getObjectByName("int", "1");
        } else
        {
          arguments[0] = getObjectByName("int", "2");
View Full Code Here

        {
          arguments[0] = getObjectByName("int", "2");
        }
        argumentType[0] = Integer.TYPE;
        method = classCV[0].getMethod("setContactType", argumentType);
        method.invoke(objectCV, arguments);
      } else if (className.equals("com.centraview.account.item.ItemVO"))
      {
        String type = "";
        sep = getValueOfNodeByTagName(configXML, TAG_SEPARATOR);
        if (sep.equals("ItemInventory"))
View Full Code Here

          type = "3";
        }
        argumentType[0] = Integer.TYPE;
        arguments[0] = getObjectByName("int", type);
        method = classCV[0].getMethod("setItemTypeId", argumentType);
        method.invoke(objectCV, arguments);
      }

    } catch (Exception e)
    {
      logger.error("[setType] Exception thrown.", e);
View Full Code Here

        argumentType[0] = getArgType(typeArg);
        arguments[0] = getObjectByName(typeArg, value);

        method = classCV[0].getMethod(attr.getNamedItem("set").getNodeValue(), argumentType);
        method.invoke(objectCV, arguments);
      }
    } catch (Exception e)
    {
      logger.error("QBXMLTag = <" + tagName + "> ********* Error while loading up/down classes : ", 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.