001//
002// Name
003//      $RCSfile: Distributed.java,v $
004// 
005// Copyright
006//      Confidential Property of Kabira Technologies, Inc.
007//      Copyright 2008 by Kabira Technologies, Inc.
008//      All rights reserved.
009//
010// History
011//      $Revision: 1.1.2.6.4.1 $ $Date: 2012/08/30 01:01:54 $
012//
013package com.kabira.platform.annotation;
014
015import java.lang.annotation.*;
016
017/** 
018 *  Define a distributed class with initial configuration values.
019 *
020 * @deprecated  All managed objects are now implicitly distributed.
021 */
022@SuppressWarnings("deprecation")
023@Documented
024@Inherited
025@Retention(RetentionPolicy.RUNTIME)
026@Target(ElementType.TYPE)
027@Deprecated
028public @interface Distributed
029{
030    /**
031     * Distributed cache policies.
032     * @deprecated Cache policy is now controlled via the cache management
033                   target.
034     */
035    @Deprecated
036    public static enum CacheType
037    {
038        /** The cached copy is never considered valid. Every 
039          * access to this object will cause the cached data
040          * to be refreshed.
041          */
042        NEVER,
043
044        /** The cached copy is always considered valid. It is
045          * never refreshed.
046          */
047        ALWAYS,
048
049        /** Behaves the same as ALWAYS */
050        ONCE,
051
052        /** Behaves the same as ALWAYS */
053        TIMED
054    };
055
056    /** The cache policy controls when cached data is considered 
057      * stale and should be read from the node on which the object 
058      * was created. Default value is CacheType.ALWAYS.
059      *
060      * Refreshing a stale object implicitly takes a transaction
061      * write lock on that object.
062      */
063    CacheType cacheType() default CacheType.ALWAYS;
064
065    /** Refresh time in seconds. This is only valid if
066      * cacheType is CacheType.TIMED.
067      */
068    long cacheTimeSeconds() default 0L;
069
070    /** A value of true enables asynchronous writes. Default false.
071      */
072    boolean asyncWrite() default false;
073
074    /** A value of true enables asynchronous destroys. Default false.
075      */
076    boolean asyncDestroy() default false;
077
078    /** Cache groups provide support for pushing cache data 
079      * to a configured cache group by mapping the cache group to a 
080      * set of network nodes. By default, the cache group is disabled.
081      */
082    CacheGroup cacheGroup() default @CacheGroup(
083                enabled = false,
084                groupName = "",
085                asyncCreate = false);
086
087    /** Directed create causes all object creates to be directed
088      * to the node indicated by nodeName. By default,
089      * directed create is disabled.
090      */
091    DirectedCreate directedCreate() default @DirectedCreate(
092                enabled = false,
093                nodeName = "");
094}