jdk/src/jdk.jlink/share/classes/jdk/tools/jlink/plugin/Plugin.java
author alanb
Thu, 17 Mar 2016 19:04:16 +0000
changeset 36511 9d0388c6b336
child 37779 7c84df693837
permissions -rw-r--r--
8142968: Module System implementation Summary: Initial integration of JEP 200, JEP 260, JEP 261, and JEP 282 Reviewed-by: alanb, mchung, naoto, rriggs, psandoz, plevart, mullan, ascarpino, vinnie, prr, sherman, dfuchs, mhaupt Contributed-by: alan.bateman@oracle.com, alex.buckley@oracle.com, jonathan.gibbons@oracle.com, karen.kinnear@oracle.com, mandy.chung@oracle.com, mark.reinhold@oracle.com, chris.hegarty@oracle.com, alexandr.scherbatiy@oracle.com, amy.lu@oracle.com, calvin.cheung@oracle.com, daniel.fuchs@oracle.com, erik.joelsson@oracle.com, harold.seigel@oracle.com, jaroslav.bachorik@oracle.com, jean-francois.denise@oracle.com, jan.lahoda@oracle.com, james.laskey@oracle.com, lois.foltan@oracle.com, miroslav.kos@oracle.com, huaming.li@oracle.com, sean.mullan@oracle.com, naoto.sato@oracle.com, masayoshi.okutsu@oracle.com, peter.levart@gmail.com, philip.race@oracle.com, claes.redestad@oracle.com, sergey.bylokhov@oracle.com, alexandre.iline@oracle.com, volker.simonis@gmail.com, staffan.larsen@oracle.com, stuart.marks@oracle.com, semyon.sadetsky@oracle.com, serguei.spitsyn@oracle.com, sundararajan.athijegannathan@oracle.com, valerie.peng@oracle.com, vincent.x.ryan@oracle.com, weijun.wang@oracle.com, yuri.nesterenko@oracle.com, yekaterina.kantserova@oracle.com, alexander.kulyakhtin@oracle.com, felix.yang@oracle.com, andrei.eremeev@oracle.com, frank.yuan@oracle.com, sergei.pikalev@oracle.com, sibabrata.sahoo@oracle.com, tiantian.du@oracle.com, sha.jiang@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
     1
/*
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
     2
 * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
     4
 *
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    10
 *
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    15
 * accompanied this code).
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    16
 *
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    20
 *
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    23
 * questions.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    24
 */
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    25
package jdk.tools.jlink.plugin;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    26
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    27
import java.util.Collections;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    28
import java.util.EnumSet;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    29
import java.util.List;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    30
import java.util.Map;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    31
import java.util.Set;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    32
import jdk.tools.jlink.internal.plugins.PluginsResourceBundle;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    33
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    34
/**
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    35
 * Base interface that jlink plugins should implement.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    36
 */
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    37
public interface Plugin {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    38
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    39
    /**
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    40
     * Type of plugin.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    41
     */
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    42
    public interface PluginType {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    43
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    44
        public String getName();
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    45
    }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    46
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    47
    /**
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    48
     * Order of categories:
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    49
     * <ol>
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    50
     * <li>FILTER: Filter in/out resources or files.</li>
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    51
     * <li>TRANSFORMER: Transform resources or files(eg: refactoring, bytecode
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    52
     * manipulation).</li>
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    53
     * <li>MODULEINFO_TRANSFORMER: Transform only module-info.class</li>
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    54
     * <li>SORTER: Sort resources within the resource container.</li>
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    55
     * <li>COMPRESSOR: Compress resource within the resouce containers.</li>
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    56
     * <li>VERIFIER: Does some image verification.</li>
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    57
     * <li>PROCESSOR: Does some post processing on image.</li>
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    58
     * <li>PACKAGER: Final processing</li>
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    59
     * </ol>
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    60
     */
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    61
    public enum CATEGORY implements PluginType {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    62
        FILTER("FILTER"),
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    63
        TRANSFORMER("TRANSFORMER"),
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    64
        MODULEINFO_TRANSFORMER("MODULEINFO_TRANSFORMER"),
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    65
        SORTER("SORTER"),
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    66
        COMPRESSOR("COMPRESSOR"),
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    67
        VERIFIER("VERIFIER"),
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    68
        PROCESSOR("PROCESSOR"),
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    69
        PACKAGER("PACKAGER");
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    70
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    71
        private final String name;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    72
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    73
        CATEGORY(String name) {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    74
            this.name = name;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    75
        }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    76
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    77
        @Override
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    78
        public String getName() {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    79
            return name;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    80
        }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    81
    }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    82
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    83
    /**
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    84
     * Plugin state:
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    85
     * <ul>
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    86
     * <li>DISABLED: The plugin is not exposed in help and will be not called.</li>
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    87
     * <li>AUTO_ENABLED: The plugin is enabled by default. It doesn't require its
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    88
     * option to be present to be called.<li>
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    89
     * <li>FUNCTIONAL: The plugin is properly configured and can operate.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    90
     * Non functional plugin must advertise their status in the
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    91
     * {@link #getStateDescription() getStateDescription} method</li>
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    92
     * </ul>
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    93
     */
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    94
    public enum STATE {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    95
        DISABLED,
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    96
        AUTO_ENABLED,
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    97
        FUNCTIONAL
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    98
    }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
    99
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   100
    /**
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   101
     * The Plugin set of types.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   102
     * @return The set of types.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   103
     */
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   104
    public default Set<PluginType> getType() {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   105
        return Collections.emptySet();
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   106
    }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   107
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   108
    /**
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   109
     * The Plugin set of states.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   110
     * @return The set of states.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   111
     */
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   112
    public default Set<STATE> getState() {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   113
        return EnumSet.of(STATE.FUNCTIONAL);
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   114
    }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   115
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   116
    /**
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   117
     * The set of plugin names that must be located, within the stack of plugins,
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   118
     * before this plugin.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   119
     * @return The set of names. By default this set is empty.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   120
     */
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   121
    public default Set<String> isBefore() {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   122
        return Collections.emptySet();
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   123
    }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   124
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   125
    /**
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   126
     * The set of plugin names that must be located, within the stack of plugins,
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   127
     * after this plugin.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   128
     * @return The set of names. By default this set is empty.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   129
     */
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   130
    public default Set<String> isAfter() {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   131
        return Collections.emptySet();
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   132
    }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   133
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   134
    /**
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   135
     * The plugin name.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   136
     * @return The name.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   137
     */
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   138
    public default String getName() {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   139
        return getClass().getName().replace('.', '-');
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   140
    }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   141
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   142
    /**
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   143
     * The plugin description.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   144
     * @return  The description.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   145
     */
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   146
    public default String getDescription() {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   147
        return "";
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   148
    }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   149
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   150
    /**
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   151
     * The option that identifies this plugin. This may be null.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   152
     * "--" is prefixed to the String (when non-null) when invoking
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   153
     * this plugin from jlink command line.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   154
     *
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   155
     * @return The plugin option.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   156
     */
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   157
    public default String getOption() {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   158
        return getName();
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   159
    }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   160
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   161
    /**
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   162
     * Has this plugin require one or more arguments?
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   163
     * A plugin can have one or more optional arguments.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   164
     * <br>
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   165
     * A plugin option with a single argument is specified as follows:
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   166
     * <pre>
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   167
     *     --plugin-option=arg_value
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   168
     * </pre>
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   169
     * If there are more than arguments, command line option looks like:
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   170
     * <pre>
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   171
     *     --plugin-option=arg_value:arg2=value2:arg3=value3...
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   172
     *</pre>
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   173
     *
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   174
     * @return true if arguments are needed.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   175
     */
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   176
    public default boolean hasArguments() {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   177
        return false;
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   178
    }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   179
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   180
    /**
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   181
     * The plugin argument(s) description.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   182
     * @return  The argument(s) description.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   183
     */
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   184
    public default String getArgumentsDescription() {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   185
        return "";
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   186
    }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   187
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   188
    /**
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   189
     * Return a message indicating the status of the provider.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   190
     *
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   191
     * @return A status description.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   192
     */
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   193
    public default String getStateDescription() {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   194
        return getState().contains(STATE.FUNCTIONAL)
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   195
                ? PluginsResourceBundle.getMessage("main.status.ok")
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   196
                : PluginsResourceBundle.getMessage("main.status.not.ok");
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   197
    }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   198
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   199
    /**
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   200
     * Configure the plugin based on the passed configuration.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   201
     * This method is called prior to invoke the plugin.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   202
     *
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   203
     * @param config The plugin configuration.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   204
     */
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   205
    public default void configure(Map<String, String> config) {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   206
    }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   207
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   208
    /**
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   209
     * Configure the plugin based on the passed configuration.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   210
     * This method is called prior to invoke the plugin.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   211
     *
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   212
     * @param config The plugin configuration.
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   213
     * @param ctx The plugin context
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   214
     */
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   215
    public default void configure(Map<String, String> config, PluginContext ctx) {
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   216
        configure(config);
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   217
    }
9d0388c6b336 8142968: Module System implementation
alanb
parents:
diff changeset
   218
}