src/jdk.jfr/share/classes/jdk/jfr/internal/consumer/Dispatcher.java
branchJEP-349-branch
changeset 58200 2d147d680311
parent 58197 0ef79bd7fb5c
child 58369 d55d1bd947c2
equal deleted inserted replaced
58197:0ef79bd7fb5c 58200:2d147d680311
       
     1 /*
       
     2  * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
       
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       
     4  *
       
     5  * This code is free software; you can redistribute it and/or modify it
       
     6  * under the terms of the GNU General Public License version 2 only, as
       
     7  * published by the Free Software Foundation.  Oracle designates this
       
     8  * particular file as subject to the "Classpath" exception as provided
       
     9  * by Oracle in the LICENSE file that accompanied this code.
       
    10  *
       
    11  * This code is distributed in the hope that it will be useful, but WITHOUT
       
    12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
       
    13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
       
    14  * version 2 for more details (a copy is included in the LICENSE file that
       
    15  * accompanied this code).
       
    16  *
       
    17  * You should have received a copy of the GNU General Public License version
       
    18  * 2 along with this work; if not, write to the Free Software Foundation,
       
    19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
       
    20  *
       
    21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
       
    22  * or visit www.oracle.com if you need additional information or have any
       
    23  * questions.
       
    24  */
       
    25 
     1 package jdk.jfr.internal.consumer;
    26 package jdk.jfr.internal.consumer;
     2 
    27 
     3 import java.time.Instant;
    28 import java.time.Instant;
     4 import java.util.ArrayList;
    29 import java.util.ArrayList;
     5 import java.util.List;
    30 import java.util.List;
    49 
    74 
    50     // Cache
    75     // Cache
    51     private EventType cacheEventType;
    76     private EventType cacheEventType;
    52     private EventDispatcher[] cacheDispatchers;
    77     private EventDispatcher[] cacheDispatchers;
    53 
    78 
    54     @SuppressWarnings({"unchecked","rawtypes"})
    79     @SuppressWarnings({"rawtypes", "unchecked"})
    55     public Dispatcher(StreamConfiguration c) {
    80     public Dispatcher(StreamConfiguration c) {
    56         this.flushActions = c.flushActions.toArray(new Runnable[0]);
    81         this.flushActions = c.flushActions.toArray(new Runnable[0]);
    57         this.closeActions = c.closeActions.toArray(new Runnable[0]);
    82         this.closeActions = c.closeActions.toArray(new Runnable[0]);
    58         this.errorActions = c.errorActions.toArray(new Consumer[0]);
    83         this.errorActions = c.errorActions.toArray(new Consumer[0]);
    59         this.dispatchers = c.eventActions.toArray(new EventDispatcher[0]);
    84         this.dispatchers = c.eventActions.toArray(new EventDispatcher[0]);