001//
002// Name
003//  $RCSfile: Managed.java,v $
004// 
005// COPYRIGHT
006//  Copyright 2009-2015 Cloud Software Group, Inc. ALL RIGHTS RESERVED.
007//  Cloud Software Group, Inc. Confidential Information
008//
009// History
010//  $Revision: 1.1.2.12 $ $Date: 2015/01/27 03:24:21 $
011//
012
013package com.kabira.platform.annotation;
014
015import java.lang.annotation.*;
016
017/**
018  * Marks a class as being a Managed Object - a shared memory
019  * backed class. Any class that extends a Managed class is 
020  * also considered Managed.
021  *<p>
022  * ManagedObject subtypes are audited for the following restrictions:
023  * <ul><li>Does not implement <code>finalize</code>.</li>
024  * <li>Does not have static fields.</li>
025  * <li>All member fields must be mappable to shared memory.</li> 
026  * </ul>
027  * <p>
028  * See the ManagedObject class for utility methods to manage
029  * extents, cardinality, and lifecycle of Managed Objects.
030  *
031  * @see com.kabira.platform.ManagedObject
032  */
033@Documented
034@Inherited
035@Retention(RetentionPolicy.RUNTIME)
036@Target(ElementType.TYPE)
037public @interface Managed
038{
039    /**
040      * Set the allocation space reserved for this object. Default is 0,
041      * which causes the system to calculate a default size.
042      * @return long
043      */
044    long allocationSpaceBytes() default 0;
045
046    /**
047      * Dynamically allocate/deallocate the transaction lock memory for
048      * this object, whenever it is locked in a transaction.
049      * This will save approximately 112 bytes per object, when the
050      * object is not locked.
051      * The default is false, which causes the system to allocate the
052      * lock memory once at object create time, and increases performance
053      * by simplifying the work that the system needs to do whenever
054      * the object is locked and unlocked.
055      * @return boolean
056      */
057    boolean dynamicLockMemory() default false;
058}