equal
deleted
inserted
replaced
22 * or visit www.oracle.com if you need additional information or have any |
22 * or visit www.oracle.com if you need additional information or have any |
23 * questions. |
23 * questions. |
24 */ |
24 */ |
25 package jdk.management.jfr; |
25 package jdk.management.jfr; |
26 |
26 |
|
27 import java.io.IOException; |
27 import java.lang.management.ManagementPermission; |
28 import java.lang.management.ManagementPermission; |
28 import java.security.Permission; |
29 import java.security.Permission; |
29 import java.time.DateTimeException; |
30 import java.time.DateTimeException; |
30 import java.time.Duration; |
31 import java.time.Duration; |
31 import java.time.Instant; |
32 import java.time.Instant; |
35 import java.util.stream.Collectors; |
36 import java.util.stream.Collectors; |
36 |
37 |
37 import javax.management.MalformedObjectNameException; |
38 import javax.management.MalformedObjectNameException; |
38 import javax.management.ObjectName; |
39 import javax.management.ObjectName; |
39 |
40 |
|
41 import jdk.jfr.Recording; |
40 import jdk.jfr.internal.management.ManagementSupport; |
42 import jdk.jfr.internal.management.ManagementSupport; |
41 |
43 |
42 final class MBeanUtils { |
44 final class MBeanUtils { |
43 |
45 |
44 private static final Permission monitor = new ManagementPermission("monitor"); |
46 private static final Permission monitor = new ManagementPermission("monitor"); |
124 if (size <1) { |
126 if (size <1) { |
125 throw new IllegalArgumentException("Block size must be at least 1 byte"); |
127 throw new IllegalArgumentException("Block size must be at least 1 byte"); |
126 } |
128 } |
127 return size; |
129 return size; |
128 } |
130 } |
|
131 |
|
132 public static String destination(Recording recording, String destination) throws IllegalArgumentException{ |
|
133 try { |
|
134 ManagementSupport.checkSetDestination(recording, destination); |
|
135 return destination; |
|
136 }catch(IOException e){ |
|
137 IllegalArgumentException iae = new IllegalArgumentException("Not a valid destination " + destination); |
|
138 iae.addSuppressed(e); |
|
139 throw iae; |
|
140 } |
|
141 } |
129 } |
142 } |
130 |
143 |