public class

JDK13Services

extends Object
java.lang.Object
   ↳ com.sun.media.sound.JDK13Services

Class Overview

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.

Summary

Public Methods
synchronized static String getDefaultInstanceName(Class typeClass)
Obtain the instance name part of a default provider property.
synchronized static String getDefaultProviderClassName(Class typeClass)
Obtain the provider class name part of a default provider property.
synchronized static List getProviders(Class serviceClass)
Obtains a List containing installed instances of the providers for the requested service.
static void setCachingPeriod(int seconds)
Set the period provider lists are cached.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static synchronized String getDefaultInstanceName (Class typeClass)

Obtain the instance name part of a default provider property.

Parameters
typeClass 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
  • 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.

public static synchronized String getDefaultProviderClassName (Class typeClass)

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

Parameters
typeClass 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
  • 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.

public static synchronized List getProviders (Class serviceClass)

Obtains a List containing installed instances of the providers for the requested service. The List of providers is cached for the period of time given by #cachingPeriod cachingPeriod. During this period, the same List instance is returned for the same type of provider. After this period, a new instance is constructed and returned. The returned List is immutable.

Parameters
serviceClass 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
  • A List of providers of the requested type. This List is immutable.

public static void setCachingPeriod (int seconds)

Set the period provider lists are cached. This method is only intended for testing.