在创建之后如何调用流程动作? [英] how to Invoke process action aftter creating it?

查看:64
本文介绍了在创建之后如何调用流程动作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个简单的类来创建一个过程,并且希望使用该过程可以执行的操作(方法),但我不知道该怎么做..

我的简单方法是:

i am writing simple class which create a process and i wish to use the actions(methods) this process can do and i dont know how..

my simple method is :

public void initProcesses()
   {
       Process pA;
       Process pB;
       Process pC;

       try
       {
           pA = Runtime.getRuntime().exec("java -cp ProccesA.java ");
                   Class<ProccesA> a = pA.getClass<ProccesA>();
       }
       catch (IOException e)
       {
           e.printStackTrace();
       }
   }


现在,我不太确定我是否知道getclass是否会有所帮助(而且我知道我可以改用reflation),但是我需要在进程中执行此操作,所以这是我的问题,

最重要的是-我正在编写一个由几个进程构建的服务器,每个进程都可以做一件事,当客户端发送请求时,服务器应该在寻找可以完成此工作的写进程.

关于我如何使用我的过程ProccessA.Java和使用hie方法的任何建议?

感谢


now, i am not really sure i know if getclass will help (and i know i can use reflation instead) but i need to do this with process so this is my problem,

bottom line - i am writing a server which build from couple of process and each one of the process can do one thing, when client sent request the server should be looking for the write process which can do the job.

any suggestion someone on how i can use my proccess ProccessA.Java and use hie methods ?

thanks

推荐答案

您不想使用进程,但要使用线程处理:

线程处理简介 [
You do not want to use Process but Thread Handling:

Introduction to Thread Handling[^]

That will help making the calculations without blocking the GUI.


这篇关于在创建之后如何调用流程动作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆