Modify

Opened 15 years ago

#231 new defect

Embedded objects

Reported by: hauma Owned by: hauma
Priority: normal Milestone: 2.0
Component: uka.transport Version: 1.09b
Severity: normal Keywords:
Cc:

Description

When value mode marshaling is replaced with anonymous objects (see ticket:228), a possibility is required build complex anonymous objects that internally consist of multiple helper objects e.g. arrays (which in turn cannot be declared anonymous, because their class is not extendable). To prevent references to those helper objects from being marshaled "by reference", they should be declarable as being embedded into its owner object. In the following example, an anonymous class A internaly consists of an array of references to other objects stored in an array A.r. As well as the refernce to A as the reference to the internal helper array A.r should be marshaled in value mode. Only for the containing references A.r[n], regular marshaling should apply:

class A implements Anonymous {
   /** @embedded */
   Object[] r = new Object[10];
}

The @embedded anotation marks the refereced Object A.r as being anonymous in the context of A. This annotation is not restricted to variables of anonymous classes. Also helper objects of regular classes can be embedded (declared anonymous in the context of their owner).

By declaring an object embedded, a class guarantees that the embedded reference is the only reference to the embedded object (an that this reference cannot be null). With this guarantee, it should be possible for a JIT compliler to inline the embedded object.

Attachments (0)

Change History (0)

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain hauma.
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from hauma to the specified user. Next status will be 'new'.
The owner will be changed from hauma to anonymous. Next status will be 'assigned'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.