src/share/vm/services/attachListener.hpp

Print this page
rev 4897 : 7162400: Intermittent java.io.IOException: Bad file number during HotSpotVirtualMachine.executeCommand
Reviewed-by: duke


  33 // The AttachListener thread services a queue of operations that are enqueued
  34 // by client tools. Each operation is identified by a name and has up to 3
  35 // arguments. The operation name is mapped to a function which performs the
  36 // operation. The function is called with an outputStream which is can use to
  37 // write any result data (for examples the properties command serializes
  38 // properties names and values to the output stream). When the function
  39 // complets the result value and any result data is returned to the client
  40 // tool.
  41 
  42 class AttachOperation;
  43 
  44 typedef jint (*AttachOperationFunction)(AttachOperation* op, outputStream* out);
  45 
  46 struct AttachOperationFunctionInfo {
  47   const char* name;
  48   AttachOperationFunction func;
  49 };
  50 
  51 class AttachListener: AllStatic {
  52  public:

  53   static void init()  NOT_SERVICES_RETURN;
  54   static void abort() NOT_SERVICES_RETURN;
  55 
  56   // invoke to perform clean-up tasks when all clients detach
  57   static void detachall() NOT_SERVICES_RETURN;
  58 
  59   // indicates if the Attach Listener needs to be created at startup
  60   static bool init_at_startup() NOT_SERVICES_RETURN_(false);
  61 
  62   // indicates if we have a trigger to start the Attach Listener
  63   static bool is_init_trigger() NOT_SERVICES_RETURN_(false);
  64 
  65 #if !INCLUDE_SERVICES
  66   static bool is_attach_supported()             { return false; }
  67 #else
  68  private:
  69   static volatile bool _initialized;
  70 
  71  public:
  72   static bool is_initialized()                  { return _initialized; }




  33 // The AttachListener thread services a queue of operations that are enqueued
  34 // by client tools. Each operation is identified by a name and has up to 3
  35 // arguments. The operation name is mapped to a function which performs the
  36 // operation. The function is called with an outputStream which is can use to
  37 // write any result data (for examples the properties command serializes
  38 // properties names and values to the output stream). When the function
  39 // complets the result value and any result data is returned to the client
  40 // tool.
  41 
  42 class AttachOperation;
  43 
  44 typedef jint (*AttachOperationFunction)(AttachOperation* op, outputStream* out);
  45 
  46 struct AttachOperationFunctionInfo {
  47   const char* name;
  48   AttachOperationFunction func;
  49 };
  50 
  51 class AttachListener: AllStatic {
  52  public:
  53   static void vm_start() NOT_SERVICES_RETURN;
  54   static void init()  NOT_SERVICES_RETURN;
  55   static void abort() NOT_SERVICES_RETURN;
  56 
  57   // invoke to perform clean-up tasks when all clients detach
  58   static void detachall() NOT_SERVICES_RETURN;
  59 
  60   // indicates if the Attach Listener needs to be created at startup
  61   static bool init_at_startup() NOT_SERVICES_RETURN_(false);
  62 
  63   // indicates if we have a trigger to start the Attach Listener
  64   static bool is_init_trigger() NOT_SERVICES_RETURN_(false);
  65 
  66 #if !INCLUDE_SERVICES
  67   static bool is_attach_supported()             { return false; }
  68 #else
  69  private:
  70   static volatile bool _initialized;
  71 
  72  public:
  73   static bool is_initialized()                  { return _initialized; }