Top Description Constructors Methods
org.glassfish.tyrus.core

public Class DefaultComponentProvider

extends ComponentProvider
Class Inheritance
Imports
java.lang.reflect.Method

Provides instances using reflection.
Author
Stepan Kopriva

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public <T> Object
create(Class<T>
Class to be created.
toLoad
)

Implements abstract org.glassfish.tyrus.core.ComponentProvider.create.

Create new instance.

public boolean
destroy(Object
instance to be destroyed.
o
)

Implements abstract org.glassfish.tyrus.core.ComponentProvider.destroy.

Destroys the given managed instance.

public Method
getInvocableMethod(Method
method from endpoint class.
method
)

Overrides org.glassfish.tyrus.core.ComponentProvider.getInvocableMethod.

Get the method which should be invoked instead provided one.

public boolean
isApplicable(Class<?>
Class to be checked.
c
)

Implements abstract org.glassfish.tyrus.core.ComponentProvider.isApplicable.

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

Constructor Detail

DefaultComponentProviderback to summary
public DefaultComponentProvider()

Method Detail

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

Implements abstract org.glassfish.tyrus.core.ComponentProvider.create.

Doc from org.glassfish.tyrus.core.ComponentProvider.create.

Create new instance.

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

Class to be created.

Returns:Object

instance, iff found, null otherwise.

Annotations
@Override
destroyback to summary
public boolean destroy(Object o)

Implements abstract org.glassfish.tyrus.core.ComponentProvider.destroy.

Doc from org.glassfish.tyrus.core.ComponentProvider.destroy.

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.

Annotations
@Override
getInvocableMethodback to summary
public Method getInvocableMethod(Method method)

Overrides org.glassfish.tyrus.core.ComponentProvider.getInvocableMethod.

Doc from org.glassfish.tyrus.core.ComponentProvider.getInvocableMethod.

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.

Annotations
@Override
isApplicableback to summary
public boolean isApplicable(Class<?> c)

Implements abstract org.glassfish.tyrus.core.ComponentProvider.isApplicable.

Doc from org.glassfish.tyrus.core.ComponentProvider.isApplicable.

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.

Annotations
@Override