jdk/src/share/classes/javax/management/openmbean/MXBeanMappingFactoryClass.java
author xdono
Wed, 02 Jul 2008 12:55:45 -0700
changeset 715 f16baef3a20e
parent 687 874e25a9844a
permissions -rw-r--r--
6719955: Update copyright year Summary: Update copyright year for files that have been modified in 2008 Reviewed-by: ohair, tbell
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
687
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
     1
/*
715
f16baef3a20e 6719955: Update copyright year
xdono
parents: 687
diff changeset
     2
 * Copyright 2007-2008 Sun Microsystems, Inc.  All Rights Reserved.
687
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
     4
 *
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Sun designates this
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
     9
 * by Sun in the LICENSE file that accompanied this code.
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    10
 *
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    15
 * accompanied this code).
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    16
 *
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    20
 *
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    21
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    22
 * CA 95054 USA or visit www.sun.com if you need additional information or
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    23
 * have any questions.
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    24
 */
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    25
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    26
package javax.management.openmbean;
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    27
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    28
import java.lang.annotation.Documented;
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    29
import java.lang.annotation.ElementType;
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    30
import java.lang.annotation.Inherited;
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    31
import java.lang.annotation.Retention;
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    32
import java.lang.annotation.RetentionPolicy;
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    33
import java.lang.annotation.Target;
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    34
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    35
/**
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    36
 * <p>Specifies the MXBean mapping factory to be used for Java types
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    37
 * in an MXBean interface, or in all MXBean interfaces in a package.</p>
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    38
 *
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    39
 * <p>Applying a mapping factory to all Java types in an MXBean interface
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    40
 * looks like this:</p>
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    41
 *
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    42
 * <pre>
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    43
 * {@literal @MXBeanMappingFactoryClass}(MyLinkedListMappingFactory.class)
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    44
 * public interface SomethingMXBean {
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    45
 *     public MyLinkedList getSomething();
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    46
 * }
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    47
 * </pre>
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    48
 *
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    49
 * <p>Applying a mapping factory to all Java types in all MXBean interfaces
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    50
 * in a package, say {@code com.example.mxbeans}, looks like this.  In the
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    51
 * package source directory, create a file called {@code package-info.java}
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    52
 * with these contents:</p>
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    53
 *
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    54
 * <pre>
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    55
 * {@literal @MXBeanMappingFactoryClass}(MyLinkedListMappingFactory.class)
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    56
 * package com.example.mxbeans;
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    57
 * </pre>
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    58
 *
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    59
 * @see MXBeanMappingFactory
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    60
 */
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    61
@Retention(RetentionPolicy.RUNTIME)
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    62
@Target({ElementType.TYPE, ElementType.PACKAGE})
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    63
@Documented @Inherited
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    64
public @interface MXBeanMappingFactoryClass {
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    65
    /**
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    66
     * <p>The {@link MXBeanMappingFactory} class to be used to map
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    67
     * types in the annotated interface or package.  This class must
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    68
     * have a public constructor with no arguments.  See the {@code
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    69
     * MXBeanMappingFactory} documentation for an example.</p>
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    70
     */
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    71
    public Class<? extends MXBeanMappingFactory> value();
874e25a9844a 6562936: Support custom type mappings in MXBeans
emcmanus
parents:
diff changeset
    72
}