?? plugin.java
字號:
/*
* Copyright (c) 2003 The Nutch Organization. All rights reserved. Use subject
* to the conditions in http://www.nutch.org/LICENSE.txt.
*/
package net.nutch.plugin;
/**
* A nutch-plugin is an container for a set of custom logic that provide
* extensions to the nutch core functionality or a other plugin that proides a
* API for extending. A plugin can provide one or a set of extensions.
* Extensions are components that can be dynamically installed as a kind of
* listener to extension points. Extension points are a kind of publisher that
* provide a API and invoke one or a set of installed extensions.
*
* Each plugin may extend the base <code>Plugin</code>. <code>Plugin</code>
* instances are used as the point of life cycle managemet of plugin related
* functionality.
*
* The <code>Plugin</code> will be startuped and shutdown by the nutch plugin
* management system.
*
* A possible usecase of the <code>Plugin</code> implementation is to create
* or close a database connection.
*
* @author joa23
*/
public class Plugin {
private PluginDescriptor fDescriptor;
/**
* Constructor
*
*/
public Plugin(PluginDescriptor pDescriptor) {
setDescriptor(pDescriptor);
}
/**
* Will be invoked until plugin start up. Since the nutch-plugin system use
* lazy loading the start up is invoked until the first time a extension is
* used.
*
* @throws PluginRuntimeException
* If the startup was without successs.
*/
public void startUp() throws PluginRuntimeException {}
/**
* Shutdown the plugin. This happens until nutch will be stopped.
*
* @throws PluginRuntimeException
* if a problems occurs until shutdown the plugin.
*/
public void shutDown() throws PluginRuntimeException {}
/**
* Returns the plugin descriptor
*
* @return PluginDescriptor
*/
public PluginDescriptor getDescriptor() {
return fDescriptor;
}
/**
* @param descriptor
* The descriptor to set
*/
private void setDescriptor(PluginDescriptor descriptor) {
fDescriptor = descriptor;
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#finalize()
*/
protected void finalize() throws Throwable {
super.finalize();
shutDown();
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -