• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • paul wheaton
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • Mikalai Zaikin
  • Himai Minh

Interact with the window services

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to write a java application which can interact with the windows services. I may have to interact with the threads related to the operating system. Can you give the details about the approach and API's.
 
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
a discussion on this: http://www.javaranch.com
<https://coderanch.com/t/381806/java/java/create-Window-Service-JAVA>; &f=1&t=016583
 
author and iconoclast
Posts: 24203
44
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is a fairly vague question, but for the most part, the answer is probably "you can't without either using native code, or using Runtime.exec() to launch various Windows native programs." Java has no APIs for interacting with anything as platform-specific as Windows services.

If you have a more specific description of what you're actually trying to do, we might be able to give more help.
 
Ajay Singh
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
the https://coderanch.com/t/381806/java/java/create-Window-Service-JAVA>; &f=1&t=016583" target="_blank" rel="nofollow">link
 
Ernest Friedman-Hill
author and iconoclast
Posts: 24203
44
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In a private message, you wrote:


Ok i wil correct my question.



- go to control panel

- go to Administrative tools

- double click on services



In this window there is a column by name Status. I want to write a java application which pops up a message when the status gets changed.



I think i need to interact with the operating system threads to implement this. So i need some guidance on interacting with the Windows os from the java program.



Thank you.



Please UseTheForumNotEmail.

So, as I said, you're either going to need to use native methods -- code in C++ or some other native language, linked to Java -- or you're going to need to execute some external program. Most likely, to get notifications, it's native methods that you'll want to use. The Java Native Interface (JNI) is described, for example, here. You'll need to find out how to do what you need in the Win32 API, write the code in C/C++, then use the JNI to call it from Java.
 
Never trust an airline that limits their passengers to one carry on iguana. Put this tiny ad in your shoe:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic