The Talon Manual

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
// Create an embedded entity. This can be done at application
// startup to prevent allocation at runtime. 
MyEmbeddedEntity entityCopy = MyEmbeddedEntity.create();
.
.
.
if(message.hasMyEntity()) {
  message.copyMyEntityTogetMyEntityTo(entityCopy);
}
.
.
.

// At some later date, dispose of the embedded entity.
// It will be returned to the global pool.  
entityCopy.dispose();

...