com.sun.tracing
Class ProviderFactory

java.lang.Object
  extended by com.sun.tracing.ProviderFactory
Direct Known Subclasses:
DTraceProviderFactory, MultiplexProviderFactory, NullProviderFactory, PrintStreamProviderFactory

public abstract class ProviderFactory
extends java.lang.Object

ProviderFactory is a factory class used to create instances of providers. To enable tracing in an application, this class must be used to create instances of the provider interfaces defined by users. The system-defined factory is obtained by using the getDefaultFactory() static method. The resulting instance can be used to create any number of providers.

Since:
1.7

Constructor Summary
protected ProviderFactory()
           
 
Method Summary
abstract
<T extends Provider>
T
createProvider(java.lang.Class<T> cls)
          Creates an implementation of a Provider interface.
static ProviderFactory getDefaultFactory()
          Returns an implementation of a ProviderFactory which creates instances of Providers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProviderFactory

protected ProviderFactory()
Method Detail

createProvider

public abstract <T extends Provider> T createProvider(java.lang.Class<T> cls)
Creates an implementation of a Provider interface.

Parameters:
cls - the provider interface to be defined.
Returns:
an implementation of cls, whose methods, when called, will trigger tracepoints in the application.
Throws:
java.lang.NullPointerException - if cls is null

getDefaultFactory

public static ProviderFactory getDefaultFactory()
Returns an implementation of a ProviderFactory which creates instances of Providers. The created Provider instances will be linked to all appropriate and enabled system-defined tracing mechanisms in the JDK.

Returns:
a ProviderFactory that is used to create Providers.