Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Private Attributes
MRJMonitor Class Reference

#include <MRJMonitor.h>

Inheritance diagram for MRJMonitor:
Inheritance graph
[legend]
Collaboration diagram for MRJMonitor:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 MRJMonitor (MRJSession *session, jobject monitor=NULL)
 ~MRJMonitor ()
virtual void enter ()
virtual void exit ()
virtual void wait ()
virtual void wait (long long millis)
virtual void notify ()
virtual void notifyAll ()
virtual jobject getObject ()
 MRJMonitor (MRJSession *session, jobject monitor=NULL)
 ~MRJMonitor ()
virtual void enter ()
virtual void exit ()
virtual void wait ()
virtual void wait (long long millis)
virtual void notify ()
virtual void notifyAll ()
virtual jobject getObject ()

Private Attributes

MRJSessionmSession
jobject mMonitor
jmethodID mWaitMethod
jmethodID mTimedWaitMethod
jmethodID mNotifyMethod
jmethodID mNotifyAllMethod

Detailed Description

Definition at line 53 of file MRJMonitor.h.


Constructor & Destructor Documentation

MRJMonitor::MRJMonitor ( MRJSession session,
jobject  monitor = NULL 
)

Definition at line 48 of file MRJMonitor.cpp.

       :      mSession(session), mMonitor(NULL), mWaitMethod(NULL), mNotifyMethod(NULL), mNotifyAllMethod(NULL)
{
       JNIEnv* env = mSession->getCurrentEnv();
       jclass javaLangObject = env->FindClass("java/lang/Object");
       if (javaLangObject != NULL) {
              // look up method IDs.
              mWaitMethod = env->GetMethodID(javaLangObject, "wait", "()V");
              mTimedWaitMethod = env->GetMethodID(javaLangObject, "wait", "(J)V");
              mNotifyMethod = env->GetMethodID(javaLangObject, "notify", "()V");
              mNotifyAllMethod = env->GetMethodID(javaLangObject, "notifyAll", "()V");
              
              Boolean allocateMonitor = (monitor == NULL);
              if (allocateMonitor)
                     monitor = env->AllocObject(javaLangObject);
              
              if (monitor != NULL)
                     mMonitor = env->NewGlobalRef(monitor);

              if (allocateMonitor)
                     env->DeleteLocalRef(monitor);

              env->DeleteLocalRef(javaLangObject);
       }
}

Here is the call graph for this function:

Definition at line 74 of file MRJMonitor.cpp.

Here is the call graph for this function:

MRJMonitor::MRJMonitor ( MRJSession session,
jobject  monitor = NULL 
)

Member Function Documentation

void MRJMonitor::enter ( ) [virtual]

Implements Monitor.

Definition at line 83 of file MRJMonitor.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void MRJMonitor::enter ( ) [virtual]

Implements Monitor.

void MRJMonitor::exit ( ) [virtual]

Implements Monitor.

Definition at line 89 of file MRJMonitor.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void MRJMonitor::exit ( ) [virtual]

Implements Monitor.

Definition at line 135 of file MRJMonitor.cpp.

{
       return mMonitor;
}
virtual jobject MRJMonitor::getObject ( ) [virtual]
void MRJMonitor::notify ( ) [virtual]

Implements Monitor.

Definition at line 115 of file MRJMonitor.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void MRJMonitor::notify ( ) [virtual]

Implements Monitor.

void MRJMonitor::notifyAll ( ) [virtual]

Implements Monitor.

Definition at line 125 of file MRJMonitor.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void MRJMonitor::notifyAll ( ) [virtual]

Implements Monitor.

void MRJMonitor::wait ( ) [virtual]

Implements Monitor.

Definition at line 95 of file MRJMonitor.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void MRJMonitor::wait ( ) [virtual]

Implements Monitor.

void MRJMonitor::wait ( long long  millis) [virtual]

Implements Monitor.

Definition at line 105 of file MRJMonitor.cpp.

Here is the call graph for this function:

virtual void MRJMonitor::wait ( long long  millis) [virtual]

Implements Monitor.


Member Data Documentation

Definition at line 70 of file MRJMonitor.h.

Definition at line 74 of file MRJMonitor.h.

Definition at line 73 of file MRJMonitor.h.

Definition at line 69 of file MRJMonitor.h.

Definition at line 72 of file MRJMonitor.h.

Definition at line 71 of file MRJMonitor.h.


The documentation for this class was generated from the following files: