/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#include "memory/allocation.hpp"
#include "utilities/ostream.hpp"
// The AttachListener thread services a queue of operations that are enqueued
// by client tools. Each operation is identified by a name and has up to 3
// arguments. The operation name is mapped to a function which performs the
// operation. The function is called with an outputStream which is can use to
// write any result data (for examples the properties command serializes
// properties names and values to the output stream). When the function
// complets the result value and any result data is returned to the client
// tool.
class AttachOperation;
struct AttachOperationFunctionInfo {
const char* name;
};
public:
static void init();
static void abort();
// invoke to perform clean-up tasks when all clients detach
static void detachall();
// indicates if the Attach Listener needs to be created at startup
static bool init_at_startup();
// indicates if we have a trigger to start the Attach Listener
static bool is_init_trigger();
private:
static volatile bool _initialized;
public:
// indicates if this VM supports attach-on-demand
// platform specific initialization
static int pd_init();
// platform specific operation
// platform specific flag change
// platform specific detachall
static void pd_detachall();
// platform specific data dump
static void pd_data_dump();
// dequeue the next operation
static AttachOperation* dequeue();
};
public:
enum {
};
// name of special operation that can be enqueued when all
// clients detach
private:
public:
// set the operation name
}
// get an argument value
const char* arg(int i) const {
return _arg[i];
}
// set an argument value
_arg[i][0] = '\0';
} else {
}
}
// create an operation of a given name
for (int i=0; i<arg_count_max; i++) {
}
}
// complete operation by sending result code and any result data to the client
};
#endif // SHARE_VM_SERVICES_ATTACHLISTENER_HPP