APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.media.sound

public final Class JDK13Services

extends Object
Class Inheritance
Imports
java.util.ArrayList, .Collections, .List, .Properties, javax.sound.midi.Receiver, .Sequencer, .Synthesizer, .Transmitter, javax.sound.midi.spi.MidiDeviceProvider, .MidiFileReader, .MidiFileWriter, .SoundbankReader, javax.sound.sampled.Clip, .Port, .SourceDataLine, .TargetDataLine, javax.sound.sampled.spi.AudioFileReader, .AudioFileWriter, .FormatConversionProvider, .MixerProvider

JDK13Services uses the Service class in JDK 1.3 to discover a list of service providers installed in the system.

This class is public because it is called from javax.sound.midi.MidiSystem and javax.sound.sampled.AudioSystem. The alternative would be to make JSSecurityManager public, which is considered worse.

Author
Matthias Pfisterer

Field Summary

Modifier and TypeField and Description
private static Properties
properties

Properties loaded from the properties file for default provider properties.

Constructor Summary

AccessConstructor and Description
private
JDK13Services()

Private, no-args constructor to ensure against instantiation.

Method Summary

Modifier and TypeMethod and Description
public static synchronized String

Returns:

The value of the instance name part of the property (the part after the hash sign), if available. If the property is not set or the value has no instance name part, null is returned.
getDefaultInstanceName
(Class<?>
The type of the default provider property. This should be one of Receiver.class, Transmitter.class, Sequencer.class, Synthesizer.class, SourceDataLine.class, TargetDataLine.class, Clip.class or Port.class.
typeClass
)

Obtain the instance name part of a default provider property.

private static synchronized String

Returns:

The complete value of the property, if available. If the property is not set, null is returned.
getDefaultProvider
(Class<?>
The type of the default provider property. This should be one of Receiver.class, Transmitter.class, Sequencer.class, Synthesizer.class, SourceDataLine.class, TargetDataLine.class, Clip.class or Port.class.
typeClass
)

Obtain the value of a default provider property.

public static synchronized String

Returns:

The value of the provider class name part of the property (the part before the hash sign), if available. If the property is not set or the value has no provider class name part, null is returned.
getDefaultProviderClassName
(Class<?>
The type of the default provider property. This should be one of Receiver.class, Transmitter.class, Sequencer.class, Synthesizer.class, SourceDataLine.class, TargetDataLine.class, Clip.class or Port.class.
typeClass
)

Obtain the provider class name part of a default provider property.

private static synchronized Properties
getProperties()

Obtain a properties bundle containing property values from the properties file.

public static List<?>

Returns:

A List of providers of the requested type. This List is immutable.
getProviders
(final Class<?>
The type of providers requested. This should be one of AudioFileReader.class, AudioFileWriter.class, FormatConversionProvider.class, MixerProvider.class, MidiDeviceProvider.class, MidiFileReader.class, MidiFileWriter.class or SoundbankReader.class.
serviceClass
)

Obtains a List containing installed instances of the providers for the requested service.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

propertiesback to summary
private static Properties properties

Properties loaded from the properties file for default provider properties.

Constructor Detail

JDK13Servicesback to summary
private JDK13Services()

Private, no-args constructor to ensure against instantiation.

Method Detail

getDefaultInstanceNameback to summary
public static synchronized String getDefaultInstanceName(Class<?> typeClass)

Obtain the instance name part of a default provider property.

Parameters
typeClass:Class<?>

The type of the default provider property. This should be one of Receiver.class, Transmitter.class, Sequencer.class, Synthesizer.class, SourceDataLine.class, TargetDataLine.class, Clip.class or Port.class.

Returns:String

The value of the instance name part of the property (the part after the hash sign), if available. If the property is not set or the value has no instance name part, null is returned.

getDefaultProviderback to summary
private static synchronized String getDefaultProvider(Class<?> typeClass)

Obtain the value of a default provider property.

Parameters
typeClass:Class<?>

The type of the default provider property. This should be one of Receiver.class, Transmitter.class, Sequencer.class, Synthesizer.class, SourceDataLine.class, TargetDataLine.class, Clip.class or Port.class.

Returns:String

The complete value of the property, if available. If the property is not set, null is returned.

getDefaultProviderClassNameback to summary
public static synchronized String getDefaultProviderClassName(Class<?> typeClass)

Obtain the provider class name part of a default provider property.

Parameters
typeClass:Class<?>

The type of the default provider property. This should be one of Receiver.class, Transmitter.class, Sequencer.class, Synthesizer.class, SourceDataLine.class, TargetDataLine.class, Clip.class or Port.class.

Returns:String

The value of the provider class name part of the property (the part before the hash sign), if available. If the property is not set or the value has no provider class name part, null is returned.

getPropertiesback to summary
private static synchronized Properties getProperties()

Obtain a properties bundle containing property values from the properties file. If the properties file could not be loaded, the properties bundle is empty.

getProvidersback to summary
public static List<?> getProviders(final Class<?> serviceClass)

Obtains a List containing installed instances of the providers for the requested service. The returned List is immutable.

Parameters
serviceClass:Class<?>

The type of providers requested. This should be one of AudioFileReader.class, AudioFileWriter.class, FormatConversionProvider.class, MixerProvider.class, MidiDeviceProvider.class, MidiFileReader.class, MidiFileWriter.class or SoundbankReader.class.

Returns:List<?>

A List of providers of the requested type. This List is immutable.