Skip to content

Commit

Permalink
spotless:apply
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewazores committed Oct 1, 2024
1 parent 13995f3 commit a1114cc
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ public static class EventOptionException extends Exception {

public static class Factory {
public EventOptionsBuilder create(JFRConnection connection)
throws IOException, ServiceNotAvailableException,
throws IOException,
ServiceNotAvailableException,
org.openjdk.jmc.flightrecorder.configuration.FlightRecorderException {
if (!FlightRecorderServiceV2.isAvailable(connection.getHandle())) {
throw new UnsupportedOperationException("Only FlightRecorder V2 is supported");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ public EventOptionsCustomizer(JFRConnection connection) {
}

public EventOptionsCustomizer set(String typeId, String option, String value)
throws FlightRecorderException, EventTypeException, EventOptionException,
throws FlightRecorderException,
EventTypeException,
EventOptionException,
OptionValueException {
if (!isInitialized()) {
initialize();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,27 @@
public interface CryostatFlightRecorderService extends IFlightRecorderService {

IRecordingDescriptor start(IConstrainedMap<String> recordingOptions, Template eventTemplate)
throws io.cryostat.core.FlightRecorderException, FlightRecorderException,
ConnectionException, ParseException, IOException, FlightRecorderException,
ServiceNotAvailableException, QuantityConversionException, EventOptionException,
throws io.cryostat.core.FlightRecorderException,
FlightRecorderException,
ConnectionException,
ParseException,
IOException,
FlightRecorderException,
ServiceNotAvailableException,
QuantityConversionException,
EventOptionException,
EventTypeException;

default IRecordingDescriptor start(IConstrainedMap<String> recordingOptions, String template)
throws io.cryostat.core.FlightRecorderException, FlightRecorderException,
ConnectionException, ParseException, IOException, ServiceNotAvailableException,
QuantityConversionException, EventOptionException, EventTypeException {
throws io.cryostat.core.FlightRecorderException,
FlightRecorderException,
ConnectionException,
ParseException,
IOException,
ServiceNotAvailableException,
QuantityConversionException,
EventOptionException,
EventTypeException {
XMLModel model = EventConfiguration.createModel(template);
IConstrainedMap<EventOptionID> eventOptions =
new EventConfiguration(model)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,21 @@ public default <T> T invokeMBeanOperation(
Object[] params,
String[] signature,
Class<T> returnType)
throws MalformedObjectNameException, InstanceNotFoundException, MBeanException,
ReflectionException, IOException, ConnectionException {
throws MalformedObjectNameException,
InstanceNotFoundException,
MBeanException,
ReflectionException,
IOException,
ConnectionException {
throw new ConnectionException("Unimplemented");
}

public MBeanMetrics getMBeanMetrics()
throws ConnectionException, IOException, InstanceNotFoundException,
IntrospectionException, ReflectionException;
throws ConnectionException,
IOException,
InstanceNotFoundException,
IntrospectionException,
ReflectionException;

public boolean isConnected();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,12 @@ public <T> T invokeMBeanOperation(
Object[] params,
String[] signature,
Class<T> returnType)
throws MalformedObjectNameException, InstanceNotFoundException, MBeanException,
ReflectionException, IOException, ConnectionException {
throws MalformedObjectNameException,
InstanceNotFoundException,
MBeanException,
ReflectionException,
IOException,
ConnectionException {
if (!isConnected()) {
connect();
}
Expand Down Expand Up @@ -275,14 +279,18 @@ private Object parseObject(Object obj) {
}

private Map<String, Object> getAttributeMap(ObjectName beanName)
throws InstanceNotFoundException, IntrospectionException, ReflectionException,
throws InstanceNotFoundException,
IntrospectionException,
ReflectionException,
IOException {
return getAttributeMap(beanName, m -> true);
}

private Map<String, Object> getAttributeMap(
ObjectName beanName, Predicate<MBeanAttributeInfo> attrPredicate)
throws InstanceNotFoundException, IntrospectionException, ReflectionException,
throws InstanceNotFoundException,
IntrospectionException,
ReflectionException,
IOException {
Map<String, Object> attrMap = new HashMap<>();

Expand Down Expand Up @@ -313,7 +321,9 @@ private Map<String, Object> getAttributeMap(
}

public synchronized MBeanMetrics getMBeanMetrics()
throws IOException, InstanceNotFoundException, IntrospectionException,
throws IOException,
InstanceNotFoundException,
IntrospectionException,
ReflectionException {
if (!isConnected()) {
connect();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,19 +230,29 @@ public IDescribedMap<EventOptionID> getDefaultEventOptions() {

@Override
public IRecordingDescriptor start(IConstrainedMap<String> recordingOptions, Template template)
throws io.cryostat.core.FlightRecorderException, FlightRecorderException,
ConnectionException, IOException, FlightRecorderException,
ServiceNotAvailableException, QuantityConversionException, EventOptionException,
throws io.cryostat.core.FlightRecorderException,
FlightRecorderException,
ConnectionException,
IOException,
FlightRecorderException,
ServiceNotAvailableException,
QuantityConversionException,
EventOptionException,
EventTypeException {
return tryConnect()
.start(recordingOptions, enableEvents(template.getName(), template.getType()));
}

private IConstrainedMap<EventOptionID> enableEvents(
String templateName, TemplateType templateType)
throws ConnectionException, IOException, io.cryostat.core.FlightRecorderException,
FlightRecorderException, ServiceNotAvailableException,
QuantityConversionException, EventOptionException, EventTypeException {
throws ConnectionException,
IOException,
io.cryostat.core.FlightRecorderException,
FlightRecorderException,
ServiceNotAvailableException,
QuantityConversionException,
EventOptionException,
EventTypeException {
if (templateName.equals("ALL")) {
return enableAllEvents();
}
Expand All @@ -254,8 +264,12 @@ private IConstrainedMap<EventOptionID> enableEvents(
}

private IConstrainedMap<EventOptionID> enableAllEvents()
throws ConnectionException, IOException, FlightRecorderException,
ServiceNotAvailableException, QuantityConversionException, EventOptionException,
throws ConnectionException,
IOException,
FlightRecorderException,
ServiceNotAvailableException,
QuantityConversionException,
EventOptionException,
EventTypeException {
EventOptionsBuilder builder = new EventOptionsBuilder.Factory().create(conn);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ public Future<Map<String, AnalysisResult>> generateEvalMapInterruptibly(

private Pair<Collection<IResult>, Long> generateResultHelper(
InputStream recording, Predicate<IRule> predicate)
throws InterruptedException, IOException, ExecutionException,
throws InterruptedException,
IOException,
ExecutionException,
CouldNotLoadRecordingException {
Collection<IRule> rules =
RuleRegistry.getRules().stream().filter(predicate).collect(Collectors.toList());
Expand Down

0 comments on commit a1114cc

Please sign in to comment.