001    /**
002     *  Licensed to the Apache Software Foundation (ASF) under one or more
003     *  contributor license agreements.  See the NOTICE file distributed with
004     *  this work for additional information regarding copyright ownership.
005     *  The ASF licenses this file to You under the Apache License, Version 2.0
006     *  (the "License"); you may not use this file except in compliance with
007     *  the License.  You may obtain a copy of the License at
008     *
009     *     http://www.apache.org/licenses/LICENSE-2.0
010     *
011     *  Unless required by applicable law or agreed to in writing, software
012     *  distributed under the License is distributed on an "AS IS" BASIS,
013     *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014     *  See the License for the specific language governing permissions and
015     *  limitations under the License.
016     */
017    package javax.util.concurrent;
018    
019    import java.util.Locale;
020    
021    /**
022     * A tasks submitted to an {@link javax.util.concurrent.ManagedExecutorService}
023     * can optionally implement this interface.<p>
024     *
025     * The intent of this interface is to allow management facilities to inspect the task to determine
026     * the intent of the task and its state.  Implementations should not depend upon any thread execution
027     * context and should typically return only readily-available instance data.
028     */
029    public interface Identifiable {
030    
031        /**
032         * The name or ID of the identifiable object.
033         * @return the name or ID of the identifiable object.
034         */
035        public String getIdentityName();
036    
037        /**
038         * The description of the identifiable object translated for a given locale.
039         * @param locale the locale to use to generate the description.  If null, the default locale will be
040         * used.
041         * @return the description of the identifiable object  in the specified locale.
042         */
043        public String getIdentityDescription(Locale locale);
044    
045    }