This is what I had in mind for an RP constructor: Incidentally, EJB
annotations show up in the cri. under
ClassResourceInfo.elementData[i].resourceClass.declaredAnnotations.table[j].
h.type.name and
ClassResourceInfo.elementData[i].resourceClass.declaredAnnotations.table[j].h.memberValues.table[k].key
and
ClassResourceInfo.elementData[i].resourceClass.declaredAnnotations.table[j].h.memberValues.table[k].value
as an example, I annotated Customer.java with @EJB and find:
interface javax.ejb.EJB
@javax.ejb.EJB(beanName=, mappedName=, beanInterface=class java.lang.Object,
description=, name=)
within the cri associated with serverF.serviceF.classResourceInfos...
----------------------------------------------------------------------------------------------------------------------------------------------------
public class JAXRS_EJBResourceProvider implements ResourceProvider
{
enum EjbLifecycle
{
STATELESS,
STATEFUL,
SINGLETON
}
private Object resourceInstance;
public JAXRS_EJBResourceProvider(Object o, JAXRSServerFactoryBean sfb)
{
if( isEJB(o, sfb) )
{
EjbLifecycle ejbLifecycle = getLifecycleFromAnnotation( o, sfb
);
if( ejbLifecycle == EjbLifecycle.STATELESS )
{
resourceInstance = delegateTo( STATELESS_delegatee );
}
else if( ejbLifecycle == EjbLifecycle.STATEFUL )
{
resourceInstance = delegateTo( STATEFUL_delegatee );
}
else if( ejbLifecycle == EjbLifecycle.SINGLETON )
{
resourceInstance = delegateTo( SINGLETON_delegatee );
}
else
{
throw new impossibleThingHappenedException();
}
}
else
{
return;
}
return;
}
}
----------------------------------------------------------------------------------------------------------------------------------------------------