src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/Monitor.java
author egahlin
Mon, 16 Sep 2019 15:10:34 +0200
branchJEP-349-branch
changeset 58151 7fd5766202ab
parent 58112 e7754025004b
permissions -rw-r--r--
Add removal reminder for Monitor and Health
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
58112
e7754025004b Copyright update - round 2
mseledtsov
parents: 57859
diff changeset
     1
/*
e7754025004b Copyright update - round 2
mseledtsov
parents: 57859
diff changeset
     2
 * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
e7754025004b Copyright update - round 2
mseledtsov
parents: 57859
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
e7754025004b Copyright update - round 2
mseledtsov
parents: 57859
diff changeset
     4
 *
e7754025004b Copyright update - round 2
mseledtsov
parents: 57859
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
e7754025004b Copyright update - round 2
mseledtsov
parents: 57859
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
e7754025004b Copyright update - round 2
mseledtsov
parents: 57859
diff changeset
     7
 * published by the Free Software Foundation.
e7754025004b Copyright update - round 2
mseledtsov
parents: 57859
diff changeset
     8
 *
e7754025004b Copyright update - round 2
mseledtsov
parents: 57859
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
e7754025004b Copyright update - round 2
mseledtsov
parents: 57859
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
e7754025004b Copyright update - round 2
mseledtsov
parents: 57859
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
e7754025004b Copyright update - round 2
mseledtsov
parents: 57859
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
e7754025004b Copyright update - round 2
mseledtsov
parents: 57859
diff changeset
    13
 * accompanied this code).
e7754025004b Copyright update - round 2
mseledtsov
parents: 57859
diff changeset
    14
 *
e7754025004b Copyright update - round 2
mseledtsov
parents: 57859
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
e7754025004b Copyright update - round 2
mseledtsov
parents: 57859
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
e7754025004b Copyright update - round 2
mseledtsov
parents: 57859
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
e7754025004b Copyright update - round 2
mseledtsov
parents: 57859
diff changeset
    18
 *
e7754025004b Copyright update - round 2
mseledtsov
parents: 57859
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
e7754025004b Copyright update - round 2
mseledtsov
parents: 57859
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
e7754025004b Copyright update - round 2
mseledtsov
parents: 57859
diff changeset
    21
 * questions.
e7754025004b Copyright update - round 2
mseledtsov
parents: 57859
diff changeset
    22
 */
e7754025004b Copyright update - round 2
mseledtsov
parents: 57859
diff changeset
    23
57859
f4230f4bdd6b Add example apps
egahlin
parents:
diff changeset
    24
package jdk.jfr.internal.dcmd;
f4230f4bdd6b Add example apps
egahlin
parents:
diff changeset
    25
f4230f4bdd6b Add example apps
egahlin
parents:
diff changeset
    26
import java.io.IOException;
f4230f4bdd6b Add example apps
egahlin
parents:
diff changeset
    27
f4230f4bdd6b Add example apps
egahlin
parents:
diff changeset
    28
import jdk.jfr.consumer.EventStream;
f4230f4bdd6b Add example apps
egahlin
parents:
diff changeset
    29
import jdk.jfr.consumer.RecordingStream;
f4230f4bdd6b Add example apps
egahlin
parents:
diff changeset
    30
58151
7fd5766202ab Add removal reminder for Monitor and Health
egahlin
parents: 58112
diff changeset
    31
// TODO: This file is to be deleted before integration
7fd5766202ab Add removal reminder for Monitor and Health
egahlin
parents: 58112
diff changeset
    32
57859
f4230f4bdd6b Add example apps
egahlin
parents:
diff changeset
    33
public class Monitor {
f4230f4bdd6b Add example apps
egahlin
parents:
diff changeset
    34
f4230f4bdd6b Add example apps
egahlin
parents:
diff changeset
    35
    private static EventStream stream;
f4230f4bdd6b Add example apps
egahlin
parents:
diff changeset
    36
f4230f4bdd6b Add example apps
egahlin
parents:
diff changeset
    37
    public static void start() throws IOException {
f4230f4bdd6b Add example apps
egahlin
parents:
diff changeset
    38
        stream = new RecordingStream();
f4230f4bdd6b Add example apps
egahlin
parents:
diff changeset
    39
        stream.startAsync();
f4230f4bdd6b Add example apps
egahlin
parents:
diff changeset
    40
        System.out.println("Monitor started");
f4230f4bdd6b Add example apps
egahlin
parents:
diff changeset
    41
    }
f4230f4bdd6b Add example apps
egahlin
parents:
diff changeset
    42
}