fparain@2888: /* fparain@3549: * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. fparain@2888: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. fparain@2888: * fparain@2888: * This code is free software; you can redistribute it and/or modify it fparain@2888: * under the terms of the GNU General Public License version 2 only, as fparain@2888: * published by the Free Software Foundation. fparain@2888: * fparain@2888: * This code is distributed in the hope that it will be useful, but WITHOUT fparain@2888: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or fparain@2888: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License fparain@2888: * version 2 for more details (a copy is included in the LICENSE file that fparain@2888: * accompanied this code). fparain@2888: * fparain@2888: * You should have received a copy of the GNU General Public License version fparain@2888: * 2 along with this work; if not, write to the Free Software Foundation, fparain@2888: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. fparain@2888: * fparain@2888: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA fparain@2888: * or visit www.oracle.com if you need additional information or have any fparain@2888: * questions. fparain@2888: * fparain@2888: */ fparain@2888: fparain@2888: #ifndef SHARE_VM_SERVICES_GCNOTIFIER_HPP fparain@2888: #define SHARE_VM_SERVICES_GCNOTIFIER_HPP fparain@2888: fparain@2888: #include "memory/allocation.hpp" fparain@2888: #include "services/memoryPool.hpp" fparain@2888: #include "services/memoryService.hpp" fparain@2888: #include "services/memoryManager.hpp" fparain@2888: zgu@3900: class GCNotificationRequest : public CHeapObj { fparain@2888: friend class GCNotifier; fparain@2888: GCNotificationRequest *next; fparain@2888: jlong timestamp; fparain@2888: GCMemoryManager *gcManager; fparain@2888: const char *gcAction; fparain@2888: const char *gcCause; fparain@2888: GCStatInfo *gcStatInfo; fparain@2888: public: fparain@2888: GCNotificationRequest(jlong ts, GCMemoryManager *manager, const char*action, const char *cause,GCStatInfo *info) { fparain@2888: next = NULL; fparain@2888: timestamp = ts; fparain@2888: gcManager = manager; fparain@2888: gcAction = action; fparain@2888: gcCause = cause; fparain@2888: gcStatInfo = info; fparain@2888: } fparain@2888: fparain@2888: ~GCNotificationRequest() { fparain@2888: delete gcStatInfo; fparain@2888: } fparain@2888: }; fparain@2888: fparain@2888: class GCNotifier : public AllStatic { fparain@2888: friend class ServiceThread; fparain@2888: private: fparain@2888: static GCNotificationRequest *first_request; fparain@2888: static GCNotificationRequest *last_request; fparain@2888: static void addRequest(GCNotificationRequest *request); fparain@2888: static GCNotificationRequest *getRequest(); fparain@3549: static void sendNotificationInternal(TRAPS); fparain@2888: public: fparain@2888: static void pushNotification(GCMemoryManager *manager, const char *action, const char *cause); fparain@2888: static bool has_event(); fparain@2888: static void sendNotification(TRAPS); fparain@2888: }; fparain@2888: fparain@2888: #endif // SHARE_VM_SERVICES_GCNOTIFIER_HPP