Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Advanced-java] JNI : Multiple Client Threads in Java APP using COM Server in DLL
- From: diya7874@xxxxxxxxx (diya prakash)
- Subject: [Advanced-java] JNI : Multiple Client Threads in Java APP using COM Server in DLL
- Date: Wed, 23 Jan 2002 01:27:39 -0800 (PST)
Hello,
I have a Java application which calls in to a DLL.This
call basically creates a new C++ thread
2.Which attaches itself to the JVM
3. and also creates a CCmdTarget object thereby
connecting to the COM Server through connection
points(OLE automation and the sorts!!!)
I have a dispatch Map which exposes a method called
MsgReceived; which is fired on receipt of a COM
message.In MsgReceived,I do a CALLBACK to the
respective java method using the jobject which made
the initial DLL call.
Something like
BEGIN_DISPATCH_MAP(CServerEvents, CCmdTarget)
//{{AFX_DISPATCH_MAP(CServerEvents)
DISP_FUNCTION(CServerEvents, "method MsgReceived",
MsgReceived, VT_ERROR, VTS_VARIANT VTS_I4 )
//}}AFX_DISPATCH_MAP
END_DISPATCH_MAP()
The PC Ref Stack will receive all API calls made from
multiple
threads by default.
The Problem:
However,multiple threads do not all receive messages
by default.
I would like different threads in one java application
to make API calls(which is fine) and receive the
respective message(which is the problem).
My question is
1. Should i create a new C++ thread for each thread
that I create in Java...
and should this thread in C++ register itself as a
seperate COM client?
2. Or should i somehow implement a mechanism such that
the Parent thread receives all notifications from
the com server and forwards the messages to the
respective thread? If so,are you aware of any such a
mechanism?
3. How do i delegate the messages notifications to the
right client thread?
Please help!!!!Any pointers will be deeply
appreciated.
Thank you for all the valuable suggestions,in advance.
Diya
__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/
- Prev by Date: [Advanced-java] NYJavaSIG - Java Technology on Wall Street Conference - Feb 4/5
- Next by Date: [Advanced-java] RMI and threading
- Previous by thread: [Advanced-java] NYJavaSIG - Java Technology on Wall Street Conference - Feb 4/5
- Next by thread: [Advanced-java] RMI and threading
- Index(es):