THE PACKAGE JAVA.LANG
java.lang.Object
20.1
20.1.9
public final void notify()
throws IllegalMonitorStateException
If any threads are waiting ( 20.1.7) on this object, one of them is chosen to be
awakened. The choice is arbitrary and at the discretion of the implementation.
The
notify
method may be called only when the current thread is already
synchronized on this object. If the current thread does not own the lock on this
object, an
IllegalMonitorStateException
is thrown.
The awakened thread will not be able to proceed until the current thread relin
quishes the lock on this object. The awakened thread will compete in the usual
manner with any other threads that might be actively competing to synchronize on
this object; for example, the awakened thread enjoys no reliable privilege or dis
advantage in being the next thread to lock this object.
20.1.10
public final void notifyAll()
throws IllegalMonitorStateException
All the threads waiting ( 20.1.7) on this object are awakened.
The
notifyAll
method may be called only when the current thread is already
synchronized on this object. If the current thread does not own the lock on this
object, an
IllegalMonitorStateException
is thrown.
The awakened threads will not be able to proceed until the current thread
relinquishes the lock on this object. The awakened threads will compete in the
usual manner with any other threads that might be actively competing to synchro
nize on this object; for example, the awakened threads enjoy no reliable privilege
or disadvantage in being the next thread to lock this object.
20.1.11
protected void finalize() throws Throwable
The general contract of
finalize
is that it is invoked if and when the Java Virtual
Machine has determined that there is no longer any means by which this object
can be accessed by any thread that has not yet died ( 12.7), except as a result of an
action taken by the finalization of some other object or class which is ready to be
finalized. The
finalize
method may take any action, including making this
object available again to other threads; the usual purpose of
finalize
, however,
is to perform cleanup actions before the object is irrevocably discarded. For exam
ple, the
finalize
method for an object that represents an input/output connection
might perform explicit I/O transactions to break the connection before the object
is permanently discarded.
463
footer
Our partners:
PHP: Hypertext Preprocessor Best Web Hosting
Java Web Hosting
Inexpensive Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Jsp Hosting
Cheap Hosting
Visionwebhosting.net Business web hosting division of Web
Design Plus. All rights reserved