Java 类com.sun.jmx.snmp.daemon.SnmpAdaptorServer 实例源码

项目:OpenJSharp    文件:SnmpSubNextRequestHandler.java   
private void init(SnmpPdu req, SnmpAdaptorServer server) {
    this.server = server;

    // The translation table is easy in this case ...
    //
    final int max= translation.length;
    final SnmpVarBind[] list= req.varBindList;
    final NonSyncVector<SnmpVarBind> nonSyncVarBind =
            ((NonSyncVector<SnmpVarBind>)varBind);
    for(int i=0; i < max; i++) {
        translation[i]= i;
        // we need to allocate a new SnmpVarBind. Otherwise the first
        // sub request will modify the list...
        //
        final SnmpVarBind newVarBind =
            new SnmpVarBind(list[i].oid, list[i].value);
        nonSyncVarBind.addNonSyncElement(newVarBind);
    }
}
项目:jdk8u-jdk    文件:SnmpSubNextRequestHandler.java   
private void init(SnmpPdu req, SnmpAdaptorServer server) {
    this.server = server;

    // The translation table is easy in this case ...
    //
    final int max= translation.length;
    final SnmpVarBind[] list= req.varBindList;
    final NonSyncVector<SnmpVarBind> nonSyncVarBind =
            ((NonSyncVector<SnmpVarBind>)varBind);
    for(int i=0; i < max; i++) {
        translation[i]= i;
        // we need to allocate a new SnmpVarBind. Otherwise the first
        // sub request will modify the list...
        //
        final SnmpVarBind newVarBind =
            new SnmpVarBind(list[i].oid, list[i].value);
        nonSyncVarBind.addNonSyncElement(newVarBind);
    }
}
项目:jdk8u_jdk    文件:SnmpSubNextRequestHandler.java   
private void init(SnmpPdu req, SnmpAdaptorServer server) {
    this.server = server;

    // The translation table is easy in this case ...
    //
    final int max= translation.length;
    final SnmpVarBind[] list= req.varBindList;
    final NonSyncVector<SnmpVarBind> nonSyncVarBind =
            ((NonSyncVector<SnmpVarBind>)varBind);
    for(int i=0; i < max; i++) {
        translation[i]= i;
        // we need to allocate a new SnmpVarBind. Otherwise the first
        // sub request will modify the list...
        //
        final SnmpVarBind newVarBind =
            new SnmpVarBind(list[i].oid, list[i].value);
        nonSyncVarBind.addNonSyncElement(newVarBind);
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:SnmpSubNextRequestHandler.java   
private void init(SnmpPdu req, SnmpAdaptorServer server) {
    this.server = server;

    // The translation table is easy in this case ...
    //
    final int max= translation.length;
    final SnmpVarBind[] list= req.varBindList;
    final NonSyncVector<SnmpVarBind> nonSyncVarBind =
            ((NonSyncVector<SnmpVarBind>)varBind);
    for(int i=0; i < max; i++) {
        translation[i]= i;
        // we need to allocate a new SnmpVarBind. Otherwise the first
        // sub request will modify the list...
        //
        final SnmpVarBind newVarBind =
            new SnmpVarBind(list[i].oid, list[i].value);
        nonSyncVarBind.addNonSyncElement(newVarBind);
    }
}
项目:infobip-open-jdk-8    文件:SnmpSubNextRequestHandler.java   
private void init(SnmpPdu req, SnmpAdaptorServer server) {
    this.server = server;

    // The translation table is easy in this case ...
    //
    final int max= translation.length;
    final SnmpVarBind[] list= req.varBindList;
    final NonSyncVector<SnmpVarBind> nonSyncVarBind =
            ((NonSyncVector<SnmpVarBind>)varBind);
    for(int i=0; i < max; i++) {
        translation[i]= i;
        // we need to allocate a new SnmpVarBind. Otherwise the first
        // sub request will modify the list...
        //
        final SnmpVarBind newVarBind =
            new SnmpVarBind(list[i].oid, list[i].value);
        nonSyncVarBind.addNonSyncElement(newVarBind);
    }
}
项目:jdk8u-dev-jdk    文件:SnmpSubNextRequestHandler.java   
private void init(SnmpPdu req, SnmpAdaptorServer server) {
    this.server = server;

    // The translation table is easy in this case ...
    //
    final int max= translation.length;
    final SnmpVarBind[] list= req.varBindList;
    final NonSyncVector<SnmpVarBind> nonSyncVarBind =
            ((NonSyncVector<SnmpVarBind>)varBind);
    for(int i=0; i < max; i++) {
        translation[i]= i;
        // we need to allocate a new SnmpVarBind. Otherwise the first
        // sub request will modify the list...
        //
        final SnmpVarBind newVarBind =
            new SnmpVarBind(list[i].oid, list[i].value);
        nonSyncVarBind.addNonSyncElement(newVarBind);
    }
}
项目:jdk7-jdk    文件:SnmpSubNextRequestHandler.java   
private void init(SnmpPdu req, SnmpAdaptorServer server) {
    this.server = server;

    // The translation table is easy in this case ...
    //
    final int max= translation.length;
    final SnmpVarBind[] list= req.varBindList;
    final NonSyncVector<SnmpVarBind> nonSyncVarBind =
            ((NonSyncVector<SnmpVarBind>)varBind);
    for(int i=0; i < max; i++) {
        translation[i]= i;
        // we need to allocate a new SnmpVarBind. Otherwise the first
        // sub request will modify the list...
        //
        final SnmpVarBind newVarBind =
            new SnmpVarBind(list[i].oid, list[i].value);
        nonSyncVarBind.addNonSyncElement(newVarBind);
    }
}
项目:jdk7-jdk    文件:SnmpSubBulkRequestHandler.java   
private void init(SnmpAdaptorServer server,
                  SnmpPdu req,
                  int nonRepeat,
                  int maxRepeat,
                  int R) {
    this.server = server;
    this.nonRepeat= nonRepeat;
    this.maxRepeat= maxRepeat;
    this.globalR= R;

    final int max= translation.length;
    final SnmpVarBind[] list= req.varBindList;
    final NonSyncVector<SnmpVarBind> nonSyncVarBind =
            ((NonSyncVector<SnmpVarBind>)varBind);
    for(int i=0; i < max; i++) {
        translation[i]= i;
        // we need to allocate a new SnmpVarBind. Otherwise the first
        // sub request will modify the list...
        //
        final SnmpVarBind newVarBind =
            new SnmpVarBind(list[i].oid, list[i].value);
        nonSyncVarBind.addNonSyncElement(newVarBind);
    }
}
项目:openjdk-source-code-learn    文件:SnmpSubNextRequestHandler.java   
private void init(SnmpPdu req, SnmpAdaptorServer server) {
    this.server = server;

    // The translation table is easy in this case ...
    //
    final int max= translation.length;
    final SnmpVarBind[] list= req.varBindList;
    final NonSyncVector<SnmpVarBind> nonSyncVarBind =
            ((NonSyncVector<SnmpVarBind>)varBind);
    for(int i=0; i < max; i++) {
        translation[i]= i;
        // we need to allocate a new SnmpVarBind. Otherwise the first
        // sub request will modify the list...
        //
        final SnmpVarBind newVarBind =
            new SnmpVarBind(list[i].oid, list[i].value);
        nonSyncVarBind.addNonSyncElement(newVarBind);
    }
}
项目:openjdk-source-code-learn    文件:SnmpSubBulkRequestHandler.java   
private void init(SnmpAdaptorServer server,
                  SnmpPdu req,
                  int nonRepeat,
                  int maxRepeat,
                  int R) {
    this.server = server;
    this.nonRepeat= nonRepeat;
    this.maxRepeat= maxRepeat;
    this.globalR= R;

    final int max= translation.length;
    final SnmpVarBind[] list= req.varBindList;
    final NonSyncVector<SnmpVarBind> nonSyncVarBind =
            ((NonSyncVector<SnmpVarBind>)varBind);
    for(int i=0; i < max; i++) {
        translation[i]= i;
        // we need to allocate a new SnmpVarBind. Otherwise the first
        // sub request will modify the list...
        //
        final SnmpVarBind newVarBind =
            new SnmpVarBind(list[i].oid, list[i].value);
        nonSyncVarBind.addNonSyncElement(newVarBind);
    }
}
项目:OLD-OpenJDK8    文件:SnmpSubNextRequestHandler.java   
private void init(SnmpPdu req, SnmpAdaptorServer server) {
    this.server = server;

    // The translation table is easy in this case ...
    //
    final int max= translation.length;
    final SnmpVarBind[] list= req.varBindList;
    final NonSyncVector<SnmpVarBind> nonSyncVarBind =
            ((NonSyncVector<SnmpVarBind>)varBind);
    for(int i=0; i < max; i++) {
        translation[i]= i;
        // we need to allocate a new SnmpVarBind. Otherwise the first
        // sub request will modify the list...
        //
        final SnmpVarBind newVarBind =
            new SnmpVarBind(list[i].oid, list[i].value);
        nonSyncVarBind.addNonSyncElement(newVarBind);
    }
}
项目:openjdk-jdk7u-jdk    文件:SnmpSubNextRequestHandler.java   
private void init(SnmpPdu req, SnmpAdaptorServer server) {
    this.server = server;

    // The translation table is easy in this case ...
    //
    final int max= translation.length;
    final SnmpVarBind[] list= req.varBindList;
    final NonSyncVector<SnmpVarBind> nonSyncVarBind =
            ((NonSyncVector<SnmpVarBind>)varBind);
    for(int i=0; i < max; i++) {
        translation[i]= i;
        // we need to allocate a new SnmpVarBind. Otherwise the first
        // sub request will modify the list...
        //
        final SnmpVarBind newVarBind =
            new SnmpVarBind(list[i].oid, list[i].value);
        nonSyncVarBind.addNonSyncElement(newVarBind);
    }
}
项目:openjdk-jdk7u-jdk    文件:SnmpSubBulkRequestHandler.java   
private void init(SnmpAdaptorServer server,
                  SnmpPdu req,
                  int nonRepeat,
                  int maxRepeat,
                  int R) {
    this.server = server;
    this.nonRepeat= nonRepeat;
    this.maxRepeat= maxRepeat;
    this.globalR= R;

    final int max= translation.length;
    final SnmpVarBind[] list= req.varBindList;
    final NonSyncVector<SnmpVarBind> nonSyncVarBind =
            ((NonSyncVector<SnmpVarBind>)varBind);
    for(int i=0; i < max; i++) {
        translation[i]= i;
        // we need to allocate a new SnmpVarBind. Otherwise the first
        // sub request will modify the list...
        //
        final SnmpVarBind newVarBind =
            new SnmpVarBind(list[i].oid, list[i].value);
        nonSyncVarBind.addNonSyncElement(newVarBind);
    }
}
项目:OpenJSharp    文件:JVM_MANAGEMENT_MIB_IMPL.java   
private synchronized void sendTrap(SnmpOid trap, SnmpVarBindList list) {
    final Iterator<NotificationTarget> iterator = notificationTargets.iterator();
    final SnmpAdaptorServer adaptor =
        (SnmpAdaptorServer) getSnmpAdaptor();

    if (adaptor == null) {
        log.error("sendTrap", "Cannot send trap: adaptor is null.");
        return;
    }

    if (!adaptor.isActive()) {
        log.config("sendTrap", "Adaptor is not active: trap not sent.");
        return;
    }

    while(iterator.hasNext()) {
        NotificationTarget target = null;
        try {
            target = iterator.next();
            SnmpPeer peer =
                new SnmpPeer(target.getAddress(), target.getPort());
            SnmpParameters p = new SnmpParameters();
            p.setRdCommunity(target.getCommunity());
            peer.setParams(p);
            log.debug("handleNotification", "Sending trap to " +
                      target.getAddress() + ":" + target.getPort());
            adaptor.snmpV2Trap(peer, trap, list, null);
        }catch(Exception e) {
            log.error("sendTrap",
                      "Exception occurred while sending trap to [" +
                      target + "]. Exception : " + e);
            log.debug("sendTrap",e);
        }
    }
}
项目:OpenJSharp    文件:SnmpSubNextRequestHandler.java   
/**
 * The constructor initialize the subrequest with the whole varbind
 * list contained in the original request.
 */
protected SnmpSubNextRequestHandler(SnmpAdaptorServer server,
                                    SnmpMibAgent agent,
                                    SnmpPdu req) {
    super(agent,req);
    init(req, server);
}
项目:OpenJSharp    文件:SnmpSubNextRequestHandler.java   
protected SnmpSubNextRequestHandler(SnmpEngine engine,
                                    SnmpAdaptorServer server,
                                    SnmpIncomingRequest incRequest,
                                    SnmpMibAgent agent,
                                    SnmpPdu req) {
    super(engine, incRequest, agent, req);
    init(req, server);
    if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
        SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, SnmpSubNextRequestHandler.class.getName(),
            "SnmpSubNextRequestHandler", "Constructor : " + this);
    }
}
项目:jdk8u-jdk    文件:JVM_MANAGEMENT_MIB_IMPL.java   
private synchronized void sendTrap(SnmpOid trap, SnmpVarBindList list) {
    final Iterator<NotificationTarget> iterator = notificationTargets.iterator();
    final SnmpAdaptorServer adaptor =
        (SnmpAdaptorServer) getSnmpAdaptor();

    if (adaptor == null) {
        log.error("sendTrap", "Cannot send trap: adaptor is null.");
        return;
    }

    if (!adaptor.isActive()) {
        log.config("sendTrap", "Adaptor is not active: trap not sent.");
        return;
    }

    while(iterator.hasNext()) {
        NotificationTarget target = null;
        try {
            target = iterator.next();
            SnmpPeer peer =
                new SnmpPeer(target.getAddress(), target.getPort());
            SnmpParameters p = new SnmpParameters();
            p.setRdCommunity(target.getCommunity());
            peer.setParams(p);
            log.debug("handleNotification", "Sending trap to " +
                      target.getAddress() + ":" + target.getPort());
            adaptor.snmpV2Trap(peer, trap, list, null);
        }catch(Exception e) {
            log.error("sendTrap",
                      "Exception occurred while sending trap to [" +
                      target + "]. Exception : " + e);
            log.debug("sendTrap",e);
        }
    }
}
项目:jdk8u-jdk    文件:SnmpSubNextRequestHandler.java   
/**
 * The constructor initialize the subrequest with the whole varbind
 * list contained in the original request.
 */
protected SnmpSubNextRequestHandler(SnmpAdaptorServer server,
                                    SnmpMibAgent agent,
                                    SnmpPdu req) {
    super(agent,req);
    init(req, server);
}
项目:jdk8u-jdk    文件:SnmpSubNextRequestHandler.java   
protected SnmpSubNextRequestHandler(SnmpEngine engine,
                                    SnmpAdaptorServer server,
                                    SnmpIncomingRequest incRequest,
                                    SnmpMibAgent agent,
                                    SnmpPdu req) {
    super(engine, incRequest, agent, req);
    init(req, server);
    if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
        SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, SnmpSubNextRequestHandler.class.getName(),
            "SnmpSubNextRequestHandler", "Constructor : " + this);
    }
}
项目:jdk8u_jdk    文件:JVM_MANAGEMENT_MIB_IMPL.java   
private synchronized void sendTrap(SnmpOid trap, SnmpVarBindList list) {
    final Iterator<NotificationTarget> iterator = notificationTargets.iterator();
    final SnmpAdaptorServer adaptor =
        (SnmpAdaptorServer) getSnmpAdaptor();

    if (adaptor == null) {
        log.error("sendTrap", "Cannot send trap: adaptor is null.");
        return;
    }

    if (!adaptor.isActive()) {
        log.config("sendTrap", "Adaptor is not active: trap not sent.");
        return;
    }

    while(iterator.hasNext()) {
        NotificationTarget target = null;
        try {
            target = iterator.next();
            SnmpPeer peer =
                new SnmpPeer(target.getAddress(), target.getPort());
            SnmpParameters p = new SnmpParameters();
            p.setRdCommunity(target.getCommunity());
            peer.setParams(p);
            log.debug("handleNotification", "Sending trap to " +
                      target.getAddress() + ":" + target.getPort());
            adaptor.snmpV2Trap(peer, trap, list, null);
        }catch(Exception e) {
            log.error("sendTrap",
                      "Exception occurred while sending trap to [" +
                      target + "]. Exception : " + e);
            log.debug("sendTrap",e);
        }
    }
}
项目:jdk8u_jdk    文件:SnmpSubNextRequestHandler.java   
/**
 * The constructor initialize the subrequest with the whole varbind
 * list contained in the original request.
 */
protected SnmpSubNextRequestHandler(SnmpAdaptorServer server,
                                    SnmpMibAgent agent,
                                    SnmpPdu req) {
    super(agent,req);
    init(req, server);
}
项目:jdk8u_jdk    文件:SnmpSubNextRequestHandler.java   
protected SnmpSubNextRequestHandler(SnmpEngine engine,
                                    SnmpAdaptorServer server,
                                    SnmpIncomingRequest incRequest,
                                    SnmpMibAgent agent,
                                    SnmpPdu req) {
    super(engine, incRequest, agent, req);
    init(req, server);
    if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
        SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, SnmpSubNextRequestHandler.class.getName(),
            "SnmpSubNextRequestHandler", "Constructor : " + this);
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:JVM_MANAGEMENT_MIB_IMPL.java   
private synchronized void sendTrap(SnmpOid trap, SnmpVarBindList list) {
    final Iterator<NotificationTarget> iterator = notificationTargets.iterator();
    final SnmpAdaptorServer adaptor =
        (SnmpAdaptorServer) getSnmpAdaptor();

    if (adaptor == null) {
        log.error("sendTrap", "Cannot send trap: adaptor is null.");
        return;
    }

    if (!adaptor.isActive()) {
        log.config("sendTrap", "Adaptor is not active: trap not sent.");
        return;
    }

    while(iterator.hasNext()) {
        NotificationTarget target = null;
        try {
            target = iterator.next();
            SnmpPeer peer =
                new SnmpPeer(target.getAddress(), target.getPort());
            SnmpParameters p = new SnmpParameters();
            p.setRdCommunity(target.getCommunity());
            peer.setParams(p);
            log.debug("handleNotification", "Sending trap to " +
                      target.getAddress() + ":" + target.getPort());
            adaptor.snmpV2Trap(peer, trap, list, null);
        }catch(Exception e) {
            log.error("sendTrap",
                      "Exception occurred while sending trap to [" +
                      target + "]. Exception : " + e);
            log.debug("sendTrap",e);
        }
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:SnmpSubNextRequestHandler.java   
/**
 * The constructor initialize the subrequest with the whole varbind
 * list contained in the original request.
 */
protected SnmpSubNextRequestHandler(SnmpAdaptorServer server,
                                    SnmpMibAgent agent,
                                    SnmpPdu req) {
    super(agent,req);
    init(req, server);
}
项目:lookaside_java-1.8.0-openjdk    文件:SnmpSubNextRequestHandler.java   
protected SnmpSubNextRequestHandler(SnmpEngine engine,
                                    SnmpAdaptorServer server,
                                    SnmpIncomingRequest incRequest,
                                    SnmpMibAgent agent,
                                    SnmpPdu req) {
    super(engine, incRequest, agent, req);
    init(req, server);
    if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
        SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, SnmpSubNextRequestHandler.class.getName(),
            "SnmpSubNextRequestHandler", "Constructor : " + this);
    }
}
项目:infobip-open-jdk-8    文件:JVM_MANAGEMENT_MIB_IMPL.java   
private synchronized void sendTrap(SnmpOid trap, SnmpVarBindList list) {
    final Iterator<NotificationTarget> iterator = notificationTargets.iterator();
    final SnmpAdaptorServer adaptor =
        (SnmpAdaptorServer) getSnmpAdaptor();

    if (adaptor == null) {
        log.error("sendTrap", "Cannot send trap: adaptor is null.");
        return;
    }

    if (!adaptor.isActive()) {
        log.config("sendTrap", "Adaptor is not active: trap not sent.");
        return;
    }

    while(iterator.hasNext()) {
        NotificationTarget target = null;
        try {
            target = iterator.next();
            SnmpPeer peer =
                new SnmpPeer(target.getAddress(), target.getPort());
            SnmpParameters p = new SnmpParameters();
            p.setRdCommunity(target.getCommunity());
            peer.setParams(p);
            log.debug("handleNotification", "Sending trap to " +
                      target.getAddress() + ":" + target.getPort());
            adaptor.snmpV2Trap(peer, trap, list, null);
        }catch(Exception e) {
            log.error("sendTrap",
                      "Exception occurred while sending trap to [" +
                      target + "]. Exception : " + e);
            log.debug("sendTrap",e);
        }
    }
}
项目:infobip-open-jdk-8    文件:SnmpSubNextRequestHandler.java   
/**
 * The constructor initialize the subrequest with the whole varbind
 * list contained in the original request.
 */
protected SnmpSubNextRequestHandler(SnmpAdaptorServer server,
                                    SnmpMibAgent agent,
                                    SnmpPdu req) {
    super(agent,req);
    init(req, server);
}
项目:infobip-open-jdk-8    文件:SnmpSubNextRequestHandler.java   
protected SnmpSubNextRequestHandler(SnmpEngine engine,
                                    SnmpAdaptorServer server,
                                    SnmpIncomingRequest incRequest,
                                    SnmpMibAgent agent,
                                    SnmpPdu req) {
    super(engine, incRequest, agent, req);
    init(req, server);
    if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
        SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, SnmpSubNextRequestHandler.class.getName(),
            "SnmpSubNextRequestHandler", "Constructor : " + this);
    }
}
项目:jdk8u-dev-jdk    文件:JVM_MANAGEMENT_MIB_IMPL.java   
private synchronized void sendTrap(SnmpOid trap, SnmpVarBindList list) {
    final Iterator<NotificationTarget> iterator = notificationTargets.iterator();
    final SnmpAdaptorServer adaptor =
        (SnmpAdaptorServer) getSnmpAdaptor();

    if (adaptor == null) {
        log.error("sendTrap", "Cannot send trap: adaptor is null.");
        return;
    }

    if (!adaptor.isActive()) {
        log.config("sendTrap", "Adaptor is not active: trap not sent.");
        return;
    }

    while(iterator.hasNext()) {
        NotificationTarget target = null;
        try {
            target = iterator.next();
            SnmpPeer peer =
                new SnmpPeer(target.getAddress(), target.getPort());
            SnmpParameters p = new SnmpParameters();
            p.setRdCommunity(target.getCommunity());
            peer.setParams(p);
            log.debug("handleNotification", "Sending trap to " +
                      target.getAddress() + ":" + target.getPort());
            adaptor.snmpV2Trap(peer, trap, list, null);
        }catch(Exception e) {
            log.error("sendTrap",
                      "Exception occurred while sending trap to [" +
                      target + "]. Exception : " + e);
            log.debug("sendTrap",e);
        }
    }
}
项目:jdk8u-dev-jdk    文件:SnmpSubNextRequestHandler.java   
/**
 * The constructor initialize the subrequest with the whole varbind
 * list contained in the original request.
 */
protected SnmpSubNextRequestHandler(SnmpAdaptorServer server,
                                    SnmpMibAgent agent,
                                    SnmpPdu req) {
    super(agent,req);
    init(req, server);
}
项目:jdk8u-dev-jdk    文件:SnmpSubNextRequestHandler.java   
protected SnmpSubNextRequestHandler(SnmpEngine engine,
                                    SnmpAdaptorServer server,
                                    SnmpIncomingRequest incRequest,
                                    SnmpMibAgent agent,
                                    SnmpPdu req) {
    super(engine, incRequest, agent, req);
    init(req, server);
    if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
        SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, SnmpSubNextRequestHandler.class.getName(),
            "SnmpSubNextRequestHandler", "Constructor : " + this);
    }
}
项目:jdk7-jdk    文件:JVM_MANAGEMENT_MIB_IMPL.java   
private synchronized void sendTrap(SnmpOid trap, SnmpVarBindList list) {
    final Iterator iterator = notificationTargets.iterator();
    final SnmpAdaptorServer adaptor =
        (SnmpAdaptorServer) getSnmpAdaptor();

    if (adaptor == null) {
        log.error("sendTrap", "Cannot send trap: adaptor is null.");
        return;
    }

    if (!adaptor.isActive()) {
        log.config("sendTrap", "Adaptor is not active: trap not sent.");
        return;
    }

    while(iterator.hasNext()) {
        NotificationTarget target = null;
        try {
            target = (NotificationTarget) iterator.next();
            SnmpPeer peer =
                new SnmpPeer(target.getAddress(), target.getPort());
            SnmpParameters p = new SnmpParameters();
            p.setRdCommunity(target.getCommunity());
            peer.setParams(p);
            log.debug("handleNotification", "Sending trap to " +
                      target.getAddress() + ":" + target.getPort());
            adaptor.snmpV2Trap(peer, trap, list, null);
        }catch(Exception e) {
            log.error("sendTrap",
                      "Exception occured while sending trap to [" +
                      target + "]. Exception : " + e);
            log.debug("sendTrap",e);
        }
    }
}
项目:jdk7-jdk    文件:SnmpSubNextRequestHandler.java   
/**
 * The constuctor initialize the subrequest with the whole varbind
 * list contained in the original request.
 */
protected SnmpSubNextRequestHandler(SnmpAdaptorServer server,
                                    SnmpMibAgent agent,
                                    SnmpPdu req) {
    super(agent,req);
    init(req, server);
}
项目:jdk7-jdk    文件:SnmpSubNextRequestHandler.java   
protected SnmpSubNextRequestHandler(SnmpEngine engine,
                                    SnmpAdaptorServer server,
                                    SnmpIncomingRequest incRequest,
                                    SnmpMibAgent agent,
                                    SnmpPdu req) {
    super(engine, incRequest, agent, req);
    init(req, server);
    if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
        SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, SnmpSubNextRequestHandler.class.getName(),
            "SnmpSubNextRequestHandler", "Constructor : " + this);
    }
}
项目:jdk7-jdk    文件:SnmpSubBulkRequestHandler.java   
/**
 * The constuctor initialize the subrequest with the whole varbind list contained
 * in the original request.
 */
protected SnmpSubBulkRequestHandler(SnmpEngine engine,
                                    SnmpAdaptorServer server,
                                    SnmpIncomingRequest incRequest,
                                    SnmpMibAgent agent,
                                    SnmpPdu req,
                                    int nonRepeat,
                                    int maxRepeat,
                                    int R) {
    super(engine, incRequest, agent, req);
    init(server, req, nonRepeat, maxRepeat, R);
}
项目:jdk7-jdk    文件:SnmpSubBulkRequestHandler.java   
/**
 * The constuctor initialize the subrequest with the whole varbind list contained
 * in the original request.
 */
protected SnmpSubBulkRequestHandler(SnmpAdaptorServer server,
                                    SnmpMibAgent agent,
                                    SnmpPdu req,
                                    int nonRepeat,
                                    int maxRepeat,
                                    int R) {
    super(agent, req);
    init(server, req, nonRepeat, maxRepeat, R);
}
项目:openjdk-source-code-learn    文件:JVM_MANAGEMENT_MIB_IMPL.java   
private synchronized void sendTrap(SnmpOid trap, SnmpVarBindList list) {
    final Iterator iterator = notificationTargets.iterator();
    final SnmpAdaptorServer adaptor =
        (SnmpAdaptorServer) getSnmpAdaptor();

    if (adaptor == null) {
        log.error("sendTrap", "Cannot send trap: adaptor is null.");
        return;
    }

    if (!adaptor.isActive()) {
        log.config("sendTrap", "Adaptor is not active: trap not sent.");
        return;
    }

    while(iterator.hasNext()) {
        NotificationTarget target = null;
        try {
            target = (NotificationTarget) iterator.next();
            SnmpPeer peer =
                new SnmpPeer(target.getAddress(), target.getPort());
            SnmpParameters p = new SnmpParameters();
            p.setRdCommunity(target.getCommunity());
            peer.setParams(p);
            log.debug("handleNotification", "Sending trap to " +
                      target.getAddress() + ":" + target.getPort());
            adaptor.snmpV2Trap(peer, trap, list, null);
        }catch(Exception e) {
            log.error("sendTrap",
                      "Exception occured while sending trap to [" +
                      target + "]. Exception : " + e);
            log.debug("sendTrap",e);
        }
    }
}
项目:openjdk-source-code-learn    文件:SnmpSubNextRequestHandler.java   
/**
 * The constuctor initialize the subrequest with the whole varbind
 * list contained in the original request.
 */
protected SnmpSubNextRequestHandler(SnmpAdaptorServer server,
                                    SnmpMibAgent agent,
                                    SnmpPdu req) {
    super(agent,req);
    init(req, server);
}
项目:openjdk-source-code-learn    文件:SnmpSubNextRequestHandler.java   
protected SnmpSubNextRequestHandler(SnmpEngine engine,
                                    SnmpAdaptorServer server,
                                    SnmpIncomingRequest incRequest,
                                    SnmpMibAgent agent,
                                    SnmpPdu req) {
    super(engine, incRequest, agent, req);
    init(req, server);
    if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
        SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, SnmpSubNextRequestHandler.class.getName(),
            "SnmpSubNextRequestHandler", "Constructor : " + this);
    }
}
项目:openjdk-source-code-learn    文件:SnmpSubBulkRequestHandler.java   
/**
 * The constuctor initialize the subrequest with the whole varbind list contained
 * in the original request.
 */
protected SnmpSubBulkRequestHandler(SnmpEngine engine,
                                    SnmpAdaptorServer server,
                                    SnmpIncomingRequest incRequest,
                                    SnmpMibAgent agent,
                                    SnmpPdu req,
                                    int nonRepeat,
                                    int maxRepeat,
                                    int R) {
    super(engine, incRequest, agent, req);
    init(server, req, nonRepeat, maxRepeat, R);
}