Language

The Free and Open Productivity Suite
Released: Apache OpenOffice 4.1.15

OpenOfficeThe life cycle of Java components


Contents

Introduction
C++ object mapped to Java
Java object mapped to C++

Introduction

In Java, objects live as long as they are reachable by a thread. In UNO, objects have a reference count and live as long as the reference count is greater than zero. When using pure Java UNO, the normal Java life cycle mechanism applies. When using Java UNO in cooperation with e.g. binary UNO, objects live as long as their reference count is not zero.

In the following the life cycle of Java and C++ objects are described.

C++ object mapped to Java

If a C++ object is mapped to Java, it lives as long as it is reachable from a Java thread. That is to say that the life cycle of a C++ object mapped to Java corresponds to the Java life cycle mechanism as normal.

An Object is created to cope with a certain work. In Java, once an object has completed its work, it is garbage-collected and its resources are recycled for use by other objects. Now, such an object is unreachable from a Java thread.

Life cycle of objects

Java object mapped to C++

If a Java object is mapped to C++, the Java object lives as long as there is a C++ reference. That is to say that the life cycle of a Java object mapped to C++ corresponds to the C++ life cycle mechanism as normal.

You can find further information to the life cycle of objects on the following page:
http://udk.openoffice.org/project/udk/common/man/comparison_uno_corba.html#life_time_mechanism

 


Author: Bertram Nolte, Kay Ramme (Mon 18 Jun 2001 11:54:14)
Copyright 2001 Sun Microsystems, Inc., 901 San Antonio Road, Palo Alto, CA 94303 USA.



Apache Software Foundation

Copyright & License | Privacy | Contact Us | Donate | Thanks

Apache, OpenOffice, OpenOffice.org and the seagull logo are registered trademarks of The Apache Software Foundation. The Apache feather logo is a trademark of The Apache Software Foundation. Other names appearing on the site may be trademarks of their respective owners.