cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Zoerner <ryanzoer...@gmail.com>
Subject Re: some thoughts that I wanted to post, in regards to RP, CRI, Exceptions, and a class scanner
Date Wed, 25 May 2011 02:04:53 GMT
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;
    }
}
----------------------------------------------------------------------------------------------------------------------------------------------------

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message