com.jrockit.mc.rjmx.flr.internal
Class R28FlightRecorderService

java.lang.Object
  extended by com.jrockit.mc.rjmx.flr.internal.R28FlightRecorderService
All Implemented Interfaces:
IFlightRecorderService

public final class R28FlightRecorderService
extends java.lang.Object
implements IFlightRecorderService

This is the default implementation for the IFlightRecorderService for JRockit R28 JVMs.

Author:
Marcus Hirt

Constructor Summary
R28FlightRecorderService(IConnectionHandle handle)
           
 
Method Summary
 void close(IRecordingDescriptor descriptor)
          Closes the recording represented by the IRecordingDescriptor.
 EventTypeMetadata[] getAvailableEventTypes()
           
 OptionMetadata[] getAvailableRecordingOptions()
          Returns the metadata for the available recording options.
 IRecordingDescriptor[] getAvailableRecordings()
          Returns the available JRockit Flight Recorder recordings.
 EventTypeSetting[] getCurrentEventTypeSettings()
          Returns the current settings for the event types.
 EventTypeSetting[] getEventSettings(IRecordingDescriptor recording)
          Returns the event settings for the specified recording.
 Option[] getRecordingOptions(IRecordingDescriptor recording)
          Returns the recording options for the specified recording.
 EventTemplate[] getServerTemplates()
           
 IRecordingDescriptor getUpdatedRecordingDescripton(IRecordingDescriptor descriptor)
          Returns the updated recording descriptor for the specified recording.
 java.io.InputStream openStream(IRecordingDescriptor descriptor, boolean removeOnClose)
          Opens a stream from the specified recording.
 java.io.InputStream openStream(IRecordingDescriptor descriptor, java.util.Date startTime, java.util.Date endTime, boolean removeOnClose)
          Opens a stream from the specified recording between the specified times.
 java.io.InputStream openStream(IRecordingDescriptor descriptor, long time, boolean removeOnClose)
          Opens a stream from the specified recording for the past "time" milliseconds.
 IRecordingDescriptor start(java.util.Map recordingOptions, EventTypeSetting[] eventSettings)
          Starts a new JRockit Flight Recorder recording.
 void stop(IRecordingDescriptor descriptor)
          Stops the recording represented by the IRecordingDescriptor.
 java.lang.String toString()
           
 void updateEventSettings(IRecordingDescriptor descriptor, EventTypeSetting[] settings)
          Updates the event settings for the specified descriptor.
 void updateRecordingOptions(IRecordingDescriptor descriptor, java.util.Map options)
          Updates the recording options for the specified recording.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

R28FlightRecorderService

public R28FlightRecorderService(IConnectionHandle handle)
Method Detail

stop

public void stop(IRecordingDescriptor descriptor)
          throws FlightRecorderException
Description copied from interface: IFlightRecorderService
Stops the recording represented by the IRecordingDescriptor.

Specified by:
stop in interface IFlightRecorderService
Parameters:
descriptor - the recording to stop.
Throws:
FlightRecorderException - if there was a problem stopping the recording.

close

public void close(IRecordingDescriptor descriptor)
           throws FlightRecorderException
Description copied from interface: IFlightRecorderService
Closes the recording represented by the IRecordingDescriptor. A closed recording will no longer be listed among the available recordings. It's corresponding MBean will be removed.

Specified by:
close in interface IFlightRecorderService
Parameters:
descriptor - the recording to close.
Throws:
FlightRecorderException - if there was a problem closing the recording.

start

public IRecordingDescriptor start(java.util.Map recordingOptions,
                                  EventTypeSetting[] eventSettings)
                           throws FlightRecorderException
Description copied from interface: IFlightRecorderService
Starts a new JRockit Flight Recorder recording.

Specified by:
start in interface IFlightRecorderService
Parameters:
recordingOptions - the recording options. Use RecordingOptionsBuilder to create.
eventSettings - the event settings.
Returns:
the IRecordingDescriptor representing the started recording.
Throws:
FlightRecorderException - if there was a problem starting the recording.

getRecordingOptions

public Option[] getRecordingOptions(IRecordingDescriptor recording)
                             throws FlightRecorderException
Description copied from interface: IFlightRecorderService
Returns the recording options for the specified recording. Note that options can be changed over time. The Option is immutable - call again to get the updated settings for a particular recording.

Specified by:
getRecordingOptions in interface IFlightRecorderService
Parameters:
recording - the recording for which to retrieve the Options.
Returns:
the Options for the specified recording.
Throws:
FlightRecorderException - if there was a problem retrieving the options.

getEventSettings

public EventTypeSetting[] getEventSettings(IRecordingDescriptor recording)
                                    throws FlightRecorderException
Description copied from interface: IFlightRecorderService
Returns the event settings for the specified recording.

Specified by:
getEventSettings in interface IFlightRecorderService
Parameters:
recording - the recording for which to return the settings.
Returns:
the event settings for the specified recording.
Throws:
FlightRecorderException

getAvailableRecordingOptions

public OptionMetadata[] getAvailableRecordingOptions()
                                              throws FlightRecorderException
Description copied from interface: IFlightRecorderService
Returns the metadata for the available recording options.

Specified by:
getAvailableRecordingOptions in interface IFlightRecorderService
Returns:
the available recording options.
Throws:
FlightRecorderException - if there was a problem retrieving the recording options.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

openStream

public java.io.InputStream openStream(IRecordingDescriptor descriptor,
                                      boolean removeOnClose)
                               throws FlightRecorderException
Description copied from interface: IFlightRecorderService
Opens a stream from the specified recording. Will read all available data. The content of the stream is gzipped. You would normally want to wrap it in a GZIPInputStream.

Specified by:
openStream in interface IFlightRecorderService
Parameters:
descriptor - the recording from which to retrieve the data.
removeOnClose - whether the recording should be removed when the stream is closed or not
Returns:
an input stream from which to read the recording data.
Throws:
FlightRecorderException

openStream

public java.io.InputStream openStream(IRecordingDescriptor descriptor,
                                      java.util.Date startTime,
                                      java.util.Date endTime,
                                      boolean removeOnClose)
                               throws FlightRecorderException
Description copied from interface: IFlightRecorderService
Opens a stream from the specified recording between the specified times. The content of the stream is gzipped. You would normally want to wrap it in a GZIPInputStream. Note that the dates should be in server side time. Special care should be taken to make sure that server side time stamps are used.

Specified by:
openStream in interface IFlightRecorderService
Parameters:
descriptor - the recording from which to retrieve the data.
startTime - the start time.
endTime - the end time.
removeOnClose - whether the recording should be removed when the stream is closed or not
Returns:
an input stream from which to read the recording data.
Throws:
FlightRecorderException

getAvailableEventTypes

public EventTypeMetadata[] getAvailableEventTypes()
                                           throws FlightRecorderException
Specified by:
getAvailableEventTypes in interface IFlightRecorderService
Returns:
the metadata for all known event types.
Throws:
FlightRecorderException - if there was a problem retrieving the metadata.

getAvailableRecordings

public IRecordingDescriptor[] getAvailableRecordings()
                                              throws FlightRecorderException
Description copied from interface: IFlightRecorderService
Returns the available JRockit Flight Recorder recordings. The immutable descriptor represents the state at the time the method was called. To get an updated representation the method must be called again.

Specified by:
getAvailableRecordings in interface IFlightRecorderService
Returns:
the available Flight Recording recordings.
Throws:
FlightRecorderException

getCurrentEventTypeSettings

public EventTypeSetting[] getCurrentEventTypeSettings()
                                               throws FlightRecorderException
Description copied from interface: IFlightRecorderService
Returns the current settings for the event types.

Specified by:
getCurrentEventTypeSettings in interface IFlightRecorderService
Returns:
the current settings for the event types.
Throws:
FlightRecorderException - if there was a problem retrieving the settings.

getUpdatedRecordingDescripton

public IRecordingDescriptor getUpdatedRecordingDescripton(IRecordingDescriptor descriptor)
                                                   throws FlightRecorderException
Description copied from interface: IFlightRecorderService
Returns the updated recording descriptor for the specified recording.

Specified by:
getUpdatedRecordingDescripton in interface IFlightRecorderService
Parameters:
descriptor - the recording for which to get the recording descriptor.
Returns:
the recording descriptor for the specified recording id.
Throws:
FlightRecorderException

getServerTemplates

public EventTemplate[] getServerTemplates()
                                   throws FlightRecorderException
Specified by:
getServerTemplates in interface IFlightRecorderService
Returns:
the server templates for event settings found on the server.
Throws:
FlightRecorderException

updateEventSettings

public void updateEventSettings(IRecordingDescriptor descriptor,
                                EventTypeSetting[] settings)
                         throws FlightRecorderException
Description copied from interface: IFlightRecorderService
Updates the event settings for the specified descriptor.

Specified by:
updateEventSettings in interface IFlightRecorderService
Parameters:
descriptor - the recording to update the event settings for.
settings - the new, overriding, event settings. If null, the current settings will be used.
Throws:
FlightRecorderException

updateRecordingOptions

public void updateRecordingOptions(IRecordingDescriptor descriptor,
                                   java.util.Map options)
                            throws FlightRecorderException
Description copied from interface: IFlightRecorderService
Updates the recording options for the specified recording.

Specified by:
updateRecordingOptions in interface IFlightRecorderService
Parameters:
descriptor - the recording to update the event settings for.
options - the new options to set.
Throws:
FlightRecorderException

openStream

public java.io.InputStream openStream(IRecordingDescriptor descriptor,
                                      long time,
                                      boolean removeOnClose)
                               throws FlightRecorderException
Description copied from interface: IFlightRecorderService
Opens a stream from the specified recording for the past "time" milliseconds. The content of the stream is gzipped. You would normally want to wrap it in a GZIPInputStream.

Specified by:
openStream in interface IFlightRecorderService
Parameters:
descriptor - the recording from which to retrieve the data.
time - the number of milliseconds of data to retrieve.
removeOnClose - whether the recording should be removed when the stream is closed or not
Returns:
an input stream from which to read the recording data.
Throws:
FlightRecorderException - if there was a problem reading the recording data.


Copyright © 1999, 2011, Oracle and/or its affiliates. All rights reserved.