* @return
*/
private AsyncMethodsMetaData getAsyncMethods(final JBossEnterpriseBeanMetaData md)
{
// Declare async methods
AsyncMethodsMetaData asyncMethods = new AsyncMethodsMetaData();
// If not a Session Bean, no async methods
if (!md.isSession())
{
return asyncMethods;
}
// Get the SessionBean metadata
JBossSessionBeanMetaData session = (JBossSessionBeanMetaData) md;
if (md instanceof JBossSessionPolicyDecorator)
{
// We obtain these as wrapped in a JNDI Policy decorator, so unwrap 'em
// HACK, but this is going to be throwaway code anyway when we rework EJB3 Core.
@SuppressWarnings("unchecked")
final JBossSessionPolicyDecorator<JBossSessionBeanMetaData> policy = (JBossSessionPolicyDecorator<JBossSessionBeanMetaData>) md;
// Get the real Session Bean Metadata
session = policy.getDelegate();
}
// If EJB 3.1
if (session instanceof JBossSessionBean31MetaData)
{
final JBossSessionBean31MetaData session31 = (JBossSessionBean31MetaData) session;
asyncMethods = session31.getAsyncMethods();
if (asyncMethods == null)
{
asyncMethods = new AsyncMethodsMetaData();
}
}
// Return
return asyncMethods;