Top Description Fields Constructors Methods
org.glassfish.tyrus.gf.ejb

public Class EjbComponentProvider

extends ComponentProvider
Class Inheritance
Imports
java.lang.reflect.Method, java.util.Arrays, .LinkedList, .List, java.util.logging.Level, .Logger, jakarta.ejb.Local, .Remote, .Singleton, .Stateful, .Stateless, javax.naming.InitialContext, .NamingException, org.glassfish.tyrus.core.ComponentProvider

Provides the instance for the supported EJB classes.
Authors
Stepan Kopriva, Pavel Bucek

Field Summary

Modifier and TypeField and Description
private static final Logger

Constructor Summary

AccessConstructor and Description
public

Method Summary

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

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.

private String
getName(Class<?> c)

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.

private Object
private Object
private Object

Field Detail

LOGGERback to summary
private static final Logger LOGGER

Constructor Detail

EjbComponentProviderback to summary
public EjbComponentProvider()

Method Detail

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

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.
c:Class<T>

Class to be created.

Returns:Object

instance, iff found, null otherwise.

Annotations
@SuppressWarnings:unchecked
@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
getNameback to summary
private String getName(Class<?> c)
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
lookupback to summary
private Object lookup(InitialContext ic, Class<?> c, String name) throws NamingException
lookupFullyQualfiedFormback to summary
private Object lookupFullyQualfiedForm(InitialContext ic, Class<?> c, String name) throws NamingException
lookupSimpleFormback to summary
private Object lookupSimpleForm(InitialContext ic, String name) throws NamingException