@Override public void deployEJB(String fullContext, BeanContext beanContext) {
deploy(beanContext.getBeanClass(), fullContext, null, null, null, new OpenEJBEJBInvoker(beanContext));
}
private void deploy(Class<?> clazz, String address, ResourceProvider rp, Object serviceBean, Application app, Invoker invoker) {
JAXRSServerFactoryBean factory = new JAXRSServerFactoryBean();
factory.setResourceClasses(clazz);
factory.setDestinationFactory(transportFactory);
factory.setBus(transportFactory.getBus());
factory.setAddress(address);
factory.setProviders(createProviderList(nameForProviders(clazz), clazz.getClassLoader()));
if (rp != null) {
factory.setResourceProvider(rp);
}
if (app != null) {
factory.setApplication(app);
}
if (invoker != null) {
factory.setInvoker(invoker);
}
if (serviceBean != null) {
factory.setServiceBean(serviceBean);
} else {
factory.setServiceClass(clazz);
}
server = factory.create();
destination = (AbstractHTTPDestination) server.getDestination();
}