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 / February 2007

Tip: Looking for answers? Try searching our database.

Monitoring native threads using JNI

Thread view: 
Nataraj M Basppa - 05 Feb 2007 05:01 GMT
Hi All,
 I have simple java application which monitors a directory (on
windows). Monitoring part is in c++ and i want to call that from java
using JNI.  I search web, but couldn't get a reasonable response. Is
there a way to listen or monitor a native thread. Coz c++ part of the
code runs a thread which monitors and notifies the listen if there is
change in directory. any pointers
Nataraj
dagarwal82@gmail.com - 05 Feb 2007 12:01 GMT
> Hi All,
>   I have simple java application which monitors a directory (on
[quoted text clipped - 4 lines]
> change in directory. any pointers
> Nataraj
What is the problem here?
Assuming your C++ is running quite fine and whenever there is a change
in directory it is notifing the code in java. rite?
>Monitoring part is in c++ and i want to call that from java
> using JNI.
You want the help in C++ part or Java part? I mean are you able to
monitor the native thread in C++?
Nataraj M Basppa - 05 Feb 2007 12:29 GMT
> > Hi All,
> >   I have simple java application which monitors a directory (on
[quoted text clipped - 11 lines]
> You want the help in C++ part or Java part? I mean are you able to
> monitor the native thread in C++?
I am sorry my mistake... C++ notifies in C++ part of the code. Is
there a way to get
the notification from C++ code to java Code. Like making a Java thread
an observer for C++ directory change notification
Gordon Beaton - 05 Feb 2007 12:45 GMT
> C++ notifies in C++ part of the code. Is there a way to get the
> notification from C++ code to java Code. Like making a Java thread
> an observer for C++ directory change notification

You can invoke any Java methods from the C++ code.

For example, pass a reference to your observer object when you make
the initial native call to set up the directory watcher. When it's
time to notify, call the appropriate method.

/gordon

Signature

[ don't email me support questions or followups ]
g o r d o n  +  n e w s  @  b a l d e r 1 3 . s e



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.