private InvocationHandler getInvocationHandler(final Endpoint ep) { final InvocationType invocationType = InvocationType.valueOf(ep.getType().toString()); return spiProvider.getSPI(InvocationHandlerFactory.class).newInvocationHandler(invocationType); }
private InvocationHandler getInvocationHandler(Endpoint ep) { Deployment dep = ep.getService().getDeployment(); DeploymentType depType = dep.getType(); String key = depType.toString(); // Use a special key for MDB endpoints EJBArchiveMetaData uapp = dep.getAttachment(EJBArchiveMetaData.class); if (uapp != null) { EJBMetaData bmd = uapp.getBeanByEjbName(ep.getShortName()); if (depType == DeploymentType.JAXRPC_EJB21 && bmd instanceof MDBMetaData) { key = InvocationType.JAXRPC_MDB21.toString(); } else if (depType == DeploymentType.JAXWS_EJB3 && bmd instanceof MDBMetaData) { key = InvocationType.JAXWS_MDB3.toString(); } } InvocationType type = InvocationType.valueOf(key); InvocationHandler invocationHandler = spiProvider.getSPI(InvocationHandlerFactory.class).newInvocationHandler(type); return invocationHandler; } }