Object management

SIDL-specified objects are managed through explicit creation but explicit reference counting is basically unnecessary. Thanks to the straightforward mapping between SIDL and Java types, SIDL-specified concrete classes can be instantiated through Java's new. For example, given a package test that includes the class HelloWorld, the following code snippet illustrates the creation of an object as well as its use$:$


import test.HelloWorld;

public static main(String args[]) {

  HelloWorld hi = new HelloWorld();
  hi.printMsg();
}

Writing the fully qualified class name would also have sufficed as in$:$


public static main(String args[]) {

  test.HelloWorld hi = new test.HelloWorld();
  hi.printMsg();
}

WARNING$:$ Although addRef and deleteRef exist in Java, they should not be used because Java decrements the reference count itself when it garbage collects a SIDL object.





babel-1.4.0
users_guide Last Modified 2008-10-16

http://www.llnl.gov/CASC/components
components@llnl.gov