Пример #1
0
  public void run() {
    try {
      ObjectOutputStream outputStream = new ObjectOutputStream(_clientSocket.getOutputStream());
      outputStream.flush();

      DataInputStream inputStream = new DataInputStream(_clientSocket.getInputStream());

      while (true) {
        String request = inputStream.readUTF();

        Trace.info("Received request: " + request);

        RMResult response = processIfComposite(request);
        if (response == null) {
          response = processIfCIDRequired(request);
          if (response == null) {
            response = processAtomicRequest(request);
          }
        }

        outputStream.writeObject(response);
        outputStream.flush();
      }
    } catch (EOFException eof) {
      Trace.info("A client closed a connection.");
    } catch (IOException e) {
      e.printStackTrace();
    }
  }
Пример #2
0
  public MbeanGenerator(ResourceManager mgr, MibNode aGroup, Context ctxt) throws IOException {
    super(mgr, aGroup, ctxt);

    gentype = ctxt.gentype;

    // Specify oid of the current bean ...
    //
    oid = node.getComputedOid();

    // Try to find a symbol to associate to the group
    //
    varName = node.getSymbolName();
    if (varName == null) varName = getClassName(node.getComputedOid());
    symboleName = getNodeSymbolName(node);

    Trace.info(MessageHandler.getMessage("generate.info.var", varName));

    // Open the file which will represent the M-bean.
    //
    out = openFile(symboleName + Def.JAVA);

    // Write generic header ...
    //
    writeHeader();

    // write our own header ...
    //
    writeClassDeclaration();

    // write the beginning of the constructor
    //
    buildConstructorHeader();
  }