Top Description Constructors Methods
org.glassfish.tyrus.core

public abstract Class ComponentProvider

extends Object
Class Inheritance
Known Direct Subclasses
org.glassfish.tyrus.core.DefaultComponentProvider
Imports
java.lang.reflect.Method

Provides an instance.

Method isApplicable(Class) is called first to check whether the provider is able to provide the given Class. Method create(Class) is called to get the instance.

Authors
Stepan Kopriva, Martin Matula, Pavel Bucek

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public abstract <
type of the created object.
T
>
Object

Returns:

instance, iff found, null otherwise.
create
(Class<T>
Class to be created.
c
)

Create new instance.

public abstract boolean

Returns:

true iff the instance was coupled to this ComponentProvider, false otherwise.
destroy
(Object
instance to be destroyed.
o
)

Destroys the given managed instance.

public Method

Returns:

method which should be invoked.
getInvocableMethod
(Method
method from endpoint class.
method
)

Get the method which should be invoked instead provided one.

public abstract boolean

Returns:

true iff this ComponentProvider is able to create an instance of the given Class.
isApplicable
(Class<?>
Class to be checked.
c
)

Checks whether this component provider is able to provide an instance of given Class.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ComponentProviderback to summary
public ComponentProvider()

Method Detail

createback to summary
public abstract <T> Object create(Class<T> c)

Create new instance.

Parameters
<T>
type of the created object.
c:Class<T>

Class to be created.

Returns:Object

instance, iff found, null otherwise.

destroyback to summary
public abstract boolean destroy(Object o)

Destroys the given managed instance.

Parameters
o:Object

instance to be destroyed.

Returns:boolean

true iff the instance was coupled to this ComponentProvider, false otherwise.

getInvocableMethodback to summary
public Method getInvocableMethod(Method method)

Get the method which should be invoked instead provided one.

Useful mainly for EJB container support, where methods from endpoint class cannot be invoked directly - Tyrus needs to use method declared on remote interface.

Default implementation returns method provided as parameter.

Parameters
method:Method

method from endpoint class.

Returns:Method

method which should be invoked.

isApplicableback to summary
public abstract boolean isApplicable(Class<?> c)

Checks whether this component provider is able to provide an instance of given Class.

Parameters
c:Class<?>

Class to be checked.

Returns:boolean

true iff this ComponentProvider is able to create an instance of the given Class.