org.tritonus.core
Class TInit

java.lang.Object
  extended by org.tritonus.core.TInit

public class TInit
extends java.lang.Object

Helper methods for provider registration.


Nested Class Summary
static interface TInit.ProviderRegistrationAction
          Action to be taken on registration of a provider.
 
Method Summary
static void registerClasses(java.lang.Class providerClass, TInit.ProviderRegistrationAction action)
          Register all service providers of a certain type.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

registerClasses

public static void registerClasses(java.lang.Class providerClass,
                                   TInit.ProviderRegistrationAction action)
Register all service providers of a certain type. This method retrieves instances of all service providers of the type given as providerClass. It registers them by calling action with the provider instance as actual parameter.

Parameters:
providerClass - Type of the service providers that should be registered. For instance, this could be the class object for javax.sound.sampled.spi.MixerProvider. However, the mechanism is not restricted to the Java Sound types of service providers.
action - A ProviderRegistrationAction that should to be called to register the service providers. Typically, this is something like adding the provider to a collection, but in theorie, could be anything.