|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.isis.jaut.ApartmentObject
The ApartmentObject allows derived objects to release their resources from the same Apartment
when finalized. This class is abstract, derived classes must implement the release()
method,
and call #releaseInApartment
from their finalize method if a resource cannot be freed from the current Thread.
Field Summary | |
protected Apartment |
apartment
Holds the Apartment this object was created in. |
Constructor Summary | |
protected |
ApartmentObject()
Creates an ApartmentObject in the current Apartment . |
Method Summary | |
protected void |
finalizeInApartment()
Calls the release() method from a Thread that belongs to the Apartment of this object. |
Apartment |
getApartment()
Retrives the Apartment in which this object was created in. |
abstract void |
release()
This method is called from the Apartment.leave() when the last Thread leaves the Apartment. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Apartment apartment
Apartment
this object was created in.
Constructor Detail |
protected ApartmentObject()
Apartment
.
JAutException
- if this Thread did not enter an Apartment. If you receive this exception,
then probably you forgot to initialize COM by calling Apartment.enter(boolean)
.Apartment.currentApartment()
,
Apartment.enter(boolean)
Method Detail |
public Apartment getApartment()
Apartment
in which this object was created in.
public abstract void release()
Apartment.leave()
when the last Thread leaves the Apartment.
Derived classes must override this to release all Apartment specific resources (like interface pointers).
It is guaranteed that this method will be called from a Thread that is part of the Apartment this object
was created in.
protected final void finalizeInApartment()
release()
method from a Thread that belongs to the Apartment of this object.
Call this method from the derived object finalizer. If the current Thread belongs to the Apartment
of this object, then release()
is called immediately, otherwise the release()
will be
called later.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |