summaryrefslogtreecommitdiffstats
path: root/logserver/src/main/java/com/yahoo/plugin/Plugin.java
blob: e53bc3a1faa1ee4dbbec5a945ec6c39c5d907137 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.plugin;

/**
 * This interface specifies an API for runtime-loadable server
 * plugins.  The interface is deliberately simple to allow it to be
 * used in different servers.  Typically, the initPlugin() method
 * calls application-specific registration methods to connect the
 * plugin to the hosting application.
 *
 * @author <a href="mailto:stig@yahoo-inc.com">Stig Bakken</a>
 */
public interface Plugin
{
    /**
     * @return a unique and simple name for the plugin
     */
    public String getPluginName();

    /**
     * Initialize the plugin.
     *
     * @param config Config object for this plugin
     */
    public void initPlugin(Config config);

    /**
     * Shut down the plugin.  Must clean up all resources allocated by
     * initPlugin() or any of the handler methods.
     */
    public void shutdownPlugin();

}