本文整理汇总了Java中org.opennms.netmgt.config.PollerConfigFactory.init方法的典型用法代码示例。如果您正苦于以下问题:Java PollerConfigFactory.init方法的具体用法?Java PollerConfigFactory.init怎么用?Java PollerConfigFactory.init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.opennms.netmgt.config.PollerConfigFactory
的用法示例。
在下文中一共展示了PollerConfigFactory.init方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initPollerConfigFactory
import org.opennms.netmgt.config.PollerConfigFactory; //导入方法依赖的package包/类
private void initPollerConfigFactory() throws ServletException {
try {
PollerConfigFactory.init();
} catch (Throwable e) {
throw new ServletException(e);
}
m_pollerFactory = PollerConfigFactory.getInstance();
m_pollerConfig = m_pollerFactory.getConfiguration();
if (m_pollerConfig == null) {
throw new ServletException("Poller Configuration file is empty");
}
}
示例2: init
import org.opennms.netmgt.config.PollerConfigFactory; //导入方法依赖的package包/类
/**
* <p>init</p>
*
* @throws javax.servlet.ServletException if any.
*/
public void init() throws ServletException {
ServletConfig config = this.getServletConfig();
try {
props.load(new FileInputStream(ConfigFileConstants.getFile(ConfigFileConstants.POLLER_CONF_FILE_NAME)));
PollerConfigFactory.init();
pollerFactory = PollerConfigFactory.getInstance();
pollerConfig = pollerFactory.getConfiguration();
if (pollerConfig == null) {
// response.sendRedirect( "error.jsp?error=2");
errorflag = true;
throw new ServletException("Poller Configuration file is empty");
}
CapsdConfigFactory.init();
capsdFactory = CapsdConfigFactory.getInstance();
capsdConfig = capsdFactory.getConfiguration();
if (capsdConfig == null) {
// response.sendRedirect( "error.jsp?error=3");
errorflag = true;
throw new ServletException("Capsd Configuration file is empty");
}
} catch (Throwable e) {
throw new ServletException(e.getMessage());
}
initPollerServices();
initCapsdProtocols();
this.redirectSuccess = config.getInitParameter("redirect.success");
if (this.redirectSuccess == null) {
throw new ServletException("Missing required init parameter: redirect.success");
}
}
示例3: reloadFiles
import org.opennms.netmgt.config.PollerConfigFactory; //导入方法依赖的package包/类
/**
* <p>reloadFiles</p>
*
* @throws javax.servlet.ServletException if any.
*/
public void reloadFiles() throws ServletException {
ServletConfig config = this.getServletConfig();
try {
props.load(new FileInputStream(ConfigFileConstants.getFile(ConfigFileConstants.POLLER_CONF_FILE_NAME)));
PollerConfigFactory.init();
pollerFactory = PollerConfigFactory.getInstance();
pollerConfig = pollerFactory.getConfiguration();
if (pollerConfig == null) {
// response.sendRedirect( "error.jsp?error=2");
errorflag = true;
throw new ServletException("Poller Configuration file is empty");
}
CapsdConfigFactory.init();
capsdFactory = CapsdConfigFactory.getInstance();
capsdConfig = capsdFactory.getConfiguration();
if (capsdConfig == null) {
errorflag = true;
// response.sendRedirect( "error.jsp?error=3");
throw new ServletException("Capsd Configuration file is empty");
}
} catch (Throwable e) {
throw new ServletException(e.getMessage());
}
initPollerServices();
initCapsdProtocols();
this.redirectSuccess = config.getInitParameter("redirect.success");
if (this.redirectSuccess == null) {
throw new ServletException("Missing required init parameter: redirect.success");
}
}
示例4: init
import org.opennms.netmgt.config.PollerConfigFactory; //导入方法依赖的package包/类
/**
* <p>init</p>
*
* @throws javax.servlet.ServletException if any.
*/
public void init() throws ServletException {
ServletConfig config = this.getServletConfig();
try {
props.load(new FileInputStream(ConfigFileConstants.getFile(ConfigFileConstants.POLLER_CONF_FILE_NAME)));
PollerConfigFactory.init();
pollerFactory = PollerConfigFactory.getInstance();
pollerConfig = pollerFactory.getConfiguration();
if (pollerConfig == null) {
throw new ServletException("Poller Configuration file is empty");
}
CapsdConfigFactory.init();
capsdFactory = CapsdConfigFactory.getInstance();
capsdConfig = capsdFactory.getConfiguration();
if (capsdConfig == null) {
throw new ServletException("Poller Configuration file is empty");
}
} catch (Throwable e) {
throw new ServletException(e.getMessage());
}
initPollerServices();
initCapsdProtocols();
this.redirectSuccess = config.getInitParameter("redirect.success");
if (this.redirectSuccess == null) {
throw new ServletException("Missing required init parameter: redirect.success");
}
}
示例5: reloadFiles
import org.opennms.netmgt.config.PollerConfigFactory; //导入方法依赖的package包/类
/**
* <p>reloadFiles</p>
*
* @throws javax.servlet.ServletException if any.
*/
public void reloadFiles() throws ServletException {
ServletConfig config = this.getServletConfig();
try {
props.load(new FileInputStream(ConfigFileConstants.getFile(ConfigFileConstants.POLLER_CONF_FILE_NAME)));
PollerConfigFactory.init();
pollerFactory = PollerConfigFactory.getInstance();
pollerConfig = pollerFactory.getConfiguration();
if (pollerConfig == null) {
throw new ServletException("Poller Configuration file is empty");
}
CapsdConfigFactory.init();
capsdFactory = CapsdConfigFactory.getInstance();
capsdConfig = capsdFactory.getConfiguration();
if (capsdConfig == null) {
throw new ServletException("Poller Configuration file is empty");
}
} catch (Throwable e) {
throw new ServletException(e.getMessage());
}
initPollerServices();
initCapsdProtocols();
this.redirectSuccess = config.getInitParameter("redirect.success");
if (this.redirectSuccess == null) {
throw new ServletException("Missing required init parameter: redirect.success");
}
}
示例6: readPollerConfiguration
import org.opennms.netmgt.config.PollerConfigFactory; //导入方法依赖的package包/类
private PollerConfiguration readPollerConfiguration() throws IOException, MarshalException, ValidationException {
PollerConfigFactory.init();
PollerConfigFactory pollerConfigFactory = new PollerConfigFactory(0, new FileInputStream(new File(CONFIG_FOLDER.concat(File.separator + CONFIG_FILE))), "LocalServer?", false);
return pollerConfigFactory.getConfiguration();
}