org.glassfish.tyrus.spi
Class ComponentProvider

java.lang.Object
  extended by org.glassfish.tyrus.spi.ComponentProvider

public abstract class ComponentProvider
extends Object

Provides an instance.

Author:
Stepan Kopriva (stepan.kopriva at oracle.com), Martin Matula (martin.matula at oracle.com)

Constructor Summary
ComponentProvider()
           
 
Method Summary
abstract  boolean isApplicable(Class<?> c)
          Checks whether this component provider is able to provide an instance of given Class.
abstract
<T> T
provideInstance(Class<T> c)
          Create new instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentProvider

public ComponentProvider()
Method Detail

isApplicable

public abstract boolean isApplicable(Class<?> c)
Checks whether this component provider is able to provide an instance of given Class.

Parameters:
c - Class to be checked.
Returns:
true iff this ComponentProvider is able to create an instance of the given Class.

provideInstance

public abstract <T> T provideInstance(Class<T> c)
                           throws Exception
Create new instance.

Parameters:
c - Class to be created.
Returns:
instance, iff found, null otherwise.
Throws:
Exception


Copyright © 2012. All Rights Reserved.