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.

API for OS access

Thread view: 
Todd - 07 Mar 2008 14:36 GMT
Hello all,

I want to create a task tracking utility that has insights into system
information much like the Windows Task Manager does.  I do not know
which API(s) to start researching for appropriate methods.  Any hints?

Thanks,
Todd
Zig - 07 Mar 2008 17:41 GMT
> Hello all,
>
[quoted text clipped - 4 lines]
> Thanks,
> Todd

On Unix, you can get a bunch of information by looking at files in the  
/proc folder. Note that different Unix flavors have different files, and  
the format of the individual files is very different between Linux &  
Solaris.

For Windows, there are NtQueryInformationProcess &  
NtQuerySystemInformation, but those functions are pretty specific to Task  
Manager. On Vista / Win 2008, you can use PSAPI, but there are some  
lower-level APIs that will give you the same information on some earlier  
versions of Windows. Don't expect much for Win 95/98/Me though (they don't  
even have task manager - and for a reason).

On the Java end, there is the Java Attach API that will give you  
information about Java processes on the local machine. As process  
managment is pretty intimate with the OS kernel, there aren't many Java  
APIs that I can think of that offer platform independant access.

HTH,

-Zig
Arne Vajhøj - 08 Mar 2008 00:01 GMT
> For Windows, there are NtQueryInformationProcess &
> NtQuerySystemInformation, but those functions are pretty specific to
> Task Manager. On Vista / Win 2008, you can use PSAPI, but there are some
> lower-level APIs that will give you the same information on some earlier
> versions of Windows. Don't expect much for Win 95/98/Me though (they
> don't even have task manager - and for a reason).

I think PSAPI is in 2000 and newer.

Arne
Zig - 08 Mar 2008 00:21 GMT
>> For Windows, there are NtQueryInformationProcess &  
>> NtQuerySystemInformation, but those functions are pretty specific to  
[quoted text clipped - 4 lines]
>
> I think PSAPI is in 2000 and newer.

Ooops, you're right. I glanced and spotted the Vista only functions :/  
Looks MS even provides a DLL if you need to run PSAPI on NT 4.

-Zig
Arne Vajhøj - 08 Mar 2008 00:00 GMT
> I want to create a task tracking utility that has insights into system
> information much like the Windows Task Manager does.  I do not know
> which API(s) to start researching for appropriate methods.  Any hints?

I don't think Java is a good choice of language for that.

You can do:
  Java GUI---(JNI call)---C code that get the info
but unless that program are doing something else where
Java is needed, then it seems unnecessary complex.

Arne


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.