Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2008

Tip: Looking for answers? Try searching our database.

runtime

Thread view: 
zamba - 27 Mar 2008 22:48 GMT
hi..im using this piece of code in a class wich is thread type :

//Se llama al ejecutable de formatter//
            Runtime rt = Runtime.getRuntime();
            Process proc = rt.exec(_strFormatter + " "+ full_xml_file + " " +
_strXSLFile + " " +  full_pdf_file);
            InputStream stderr = proc.getErrorStream();
            InputStreamReader isr = new InputStreamReader(stderr);
            BufferedReader br = new BufferedReader(isr);
            String line = null;
            System.out.println("");
            while ( (line = br.readLine()) != null)
            System.out.println(line);
            System.out.println("");
            int exitVal = proc.waitFor();

this is because i need to call an external program from my class to
convert xml to pdf , im doing this with a class which make run of this
thread class and first one is called about 30.000 times (one for each
xml), but the process is too slow...i suppouse that proc.waitFor and
while...etc..can do my process slow, but i didn't find another wy to
call an external program and test if worked...can anybody help me...tks
Roedy Green - 29 Mar 2008 00:21 GMT
On Thu, 27 Mar 2008 14:48:28 -0700 (PDT), zamba
<CRISTIAN_FERRERO@hotmail.com> wrote, quoted or indirectly quoted
someone who said :

>this is because i need to call an external program from my class to
>convert xml to pdf , im doing this with a class which make run of this
>thread class and first one is called about 30.000 times (one for each
>xml), but the process is too slow...i suppouse that proc.waitFor and
>while...etc..can do my process slow, but i didn't find another wy to
>call an external program and test if worked...can anybody help me...tks

If you have some control over the source code for the other program
you can:

1. have it communicate via sockets, files, a database... and stay
resident..

2. create a JNI hook to it.

3. rewrite it in Java.

4. write it so that most of it is a DLL that stays resident. You can
then reload it quickly.

If you have no control, you can put it on a RAMDRIVE to help it load
faster.

Signature

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.