• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java SNMP4JSettings类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.snmp4j.SNMP4JSettings的典型用法代码示例。如果您正苦于以下问题:Java SNMP4JSettings类的具体用法?Java SNMP4JSettings怎么用?Java SNMP4JSettings使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SNMP4JSettings类属于org.snmp4j包,在下文中一共展示了SNMP4JSettings类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: initialize

import org.snmp4j.SNMP4JSettings; //导入依赖的package包/类
/**
     * Initialize for v3 communications
     */
    private static void initialize() {
        if (s_initialized) {
            return;
        }

//      LogFactory.setLogFactory(new Log4jLogFactory());
            
        MPv3.setEnterpriseID(5813);
        USM usm = new USM(SecurityProtocols.getInstance(), new OctetString(MPv3.createLocalEngineID()), 0);
        SecurityModels.getInstance().addSecurityModel(usm);
        
        // Enable extensibility in SNMP4J so that we can subclass some SMI classes to work around
        // agent bugs
        if (System.getProperty("org.snmp4j.smisyntaxes", null) != null) {
        	SNMP4JSettings.setExtensibilityEnabled(true);
        }
        
        if (Boolean.getBoolean("org.opennms.snmp.snmp4j.forwardRuntimeExceptions")) {
        	SNMP4JSettings.setForwardRuntimeExceptions(true);
        }
        
        s_initialized = true;
    }
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:27,代码来源:Snmp4JStrategy.java


示例2: initialize

import org.snmp4j.SNMP4JSettings; //导入依赖的package包/类
/**
 * Initializes the {@link SmiManager} instances used for structed management information (SMI)
 */
public void initialize() {
	try {
		smiManager = new SmiManager(license, new File(repositoryPath));
	    SNMP4JSettings.setOIDTextFormat(smiManager);
	    SNMP4JSettings.setVariableTextFormat(smiManager);

	} catch (IOException e) {
		Log.error("Failed to initialize SmiManager");
		e.printStackTrace();
	}
	// TBD??
    // If you need to disable full index formatting, then choose a different format below and uncomment the line:
    // smiManager.setOidFormat(OIDFormat.ObjectNameAndDecodedIndex4RoundTrip);
}
 
开发者ID:boundary,项目名称:boundary-event-sdk,代码行数:18,代码来源:SmiSupport.java


示例3: useExtendedSmi

import org.snmp4j.SNMP4JSettings; //导入依赖的package包/类
public void useExtendedSmi() {
  SNMP4JSettings.setExtensibilityEnabled(true);
  System.setProperty(
      org.snmp4j.smi.AbstractVariable.SMISYNTAXES_PROPERTIES,
      PROPERTIES_FILE_PATH
  );
}
 
开发者ID:kaitoy,项目名称:sneo,代码行数:8,代码来源:SmiSyntaxesPropertiesManager.java


示例4: extendTransportMappings

import org.snmp4j.SNMP4JSettings; //导入依赖的package包/类
public synchronized void extendTransportMappings() {
  logger.info("Extend TransportMappings.");

  SNMP4JSettings.setExtensibilityEnabled(true);
  System.setProperty(
    TransportMappings.TRANSPORT_MAPPINGS,
    PROPERTIES_FILE_PATH
  );
  extendingTransportMappings = true;
}
 
开发者ID:kaitoy,项目名称:sneo,代码行数:11,代码来源:TransportsPropertiesManager.java


示例5: main

import org.snmp4j.SNMP4JSettings; //导入依赖的package包/类
public static void main(String[] args) {
  LogFactory.setLogFactory(new Log4jLogFactory());
  Log4jPropertiesLoader.getInstance()
    .loadPropertyOf(SneoSnmpRequest.class);

  SmiSyntaxesPropertiesManager.getInstance().useExtendedSmi();

  SNMP4JSettings.setVariableTextFormat(
    SnmpRequestPropertiesLoader.getInstance().getVariableTextFormat()
  );

  SnmpRequest.main(args);
}
 
开发者ID:kaitoy,项目名称:sneo,代码行数:14,代码来源:SneoSnmpRequest.java


示例6: Threading

import org.snmp4j.SNMP4JSettings; //导入依赖的package包/类
/**
 * Constructs a new instance, limiting the total number of threads to count.
 */
public Threading(int count) {
    es = new ThreadPoolExecutor(count, count, 1000L, TimeUnit.MILLISECONDS,
            new LinkedBlockingQueue<Runnable>(100), this, this);
    joinTimeout = SNMP4JSettings.getThreadJoinTimeout();
}
 
开发者ID:genman,项目名称:rhq-plugins,代码行数:9,代码来源:Threading.java


示例7: initialize

import org.snmp4j.SNMP4JSettings; //导入依赖的package包/类
public void initialize(PluginContext context) throws Exception {
    threading = new Threading(5);
    SNMP4JSettings.setThreadFactory(threading);
    SNMP4JSettings.setTimerFactory(threading);
    org.snmp4j.log.LogFactory.setLogFactory(new Log4jLogFactory());
}
 
开发者ID:genman,项目名称:rhq-plugins,代码行数:7,代码来源:SnmpPluginLifecycleListener.java


示例8: shutdown

import org.snmp4j.SNMP4JSettings; //导入依赖的package包/类
public void shutdown() {
    threading.close();
    SNMP4JSettings.setThreadFactory(new DefaultThreadFactory());
    SNMP4JSettings.setTimerFactory(new DefaultTimerFactory());
    org.snmp4j.log.LogFactory.setLogFactory(null);
}
 
开发者ID:genman,项目名称:rhq-plugins,代码行数:7,代码来源:SnmpPluginLifecycleListener.java


示例9: main

import org.snmp4j.SNMP4JSettings; //导入依赖的package包/类
public static void main(String[] args) {
  LogFactory.setLogFactory(new Log4jLogFactory());
  mx4j.log.Log.redirectTo(new Log4JLogger());
  Log4jPropertiesLoader.getInstance().loadPropertyOf(HttpJmxAgent.class);

  if (AgentPropertiesLoader.getInstance().extendSmiSyntaxes()) {
    SmiSyntaxesPropertiesManager.getInstance().useExtendedSmi();
  }
  if (AgentPropertiesLoader.getInstance().extendTransportMappings()) {
    TransportsPropertiesManager.getInstance().extendTransportMappings();
  }

  SNMP4JSettings.setVariableTextFormat(
    ColonSeparatedOidTypeValueVariableTextFormat.getInstance()
  );

  Map<?, ?> params = parseArgs(args);

  final HttpJmxAgent agent
    = new HttpJmxAgent(
        ((Integer)ArgumentParser.getValue(params, "jmxPort", 0)).intValue(),
        ((Integer)ArgumentParser.getValue(params, "rmiPort", 0)).intValue()
      );
  agent.setConfigFilePath((String)ArgumentParser.getValue(params, "f", 0));
  agent.start();

  if (params.get("d") == null) {
    ConsoleBlocker.block("** Hit Enter key to stop simulation **");
    agent.stop();
    try {
      Thread.sleep(2000);
    } catch (InterruptedException e1) {}
  }
  else {
    agent.registerPojo(
      new SimStopper(
        new StopProcedure() {
          public void stop() {
            agent.stop(3000L);
          }
        }
      ),
      "Tools:name=SimStopper"
    );
  }
}
 
开发者ID:kaitoy,项目名称:sneo,代码行数:47,代码来源:HttpJmxAgent.java



注:本文中的org.snmp4j.SNMP4JSettings类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java FileBasedKeyStoresFactory类代码示例发布时间:2022-05-22
下一篇:
Java Template类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap