use of com.netsteadfast.greenstep.po.hbm.TbSysWsConfig in project bamboobsc by billchen198318.
the class CxfServerBean method publishRest.
private static int publishRest(JAXRSServerFactoryBean sf, List<TbSysWsConfig> configs) {
int c = 0;
for (TbSysWsConfig config : configs) {
if (!WSConfig.TYPE_REST.equals(config.getType())) {
continue;
}
try {
sf.setServiceBean(AppContext.getBean(config.getBeanId()));
c++;
} catch (Exception e) {
e.printStackTrace();
}
}
sf.setProviders(getProvider());
sf.setAddress(WSConfig.getJAXRSServerFactoryBeanAddress());
return c;
}
use of com.netsteadfast.greenstep.po.hbm.TbSysWsConfig in project bamboobsc by billchen198318.
the class CxfServerBean method start.
public static void start(PublishingCXFServlet servlet, ServletConfig servletConfig, Bus bus, boolean loadBusManual) {
logger.info("start");
CxfServerBean.servlet = servlet;
CxfServerBean.servletConfig = servletConfig;
CxfServerBean.bus = bus;
if (server != null && serverFactoryBean != null) {
logger.warn("Server is found , not start");
return;
}
try {
if (loadBusManual) {
logger.info("load bus manual mode");
CxfServerBean.bus = servlet.loadBusManual(servletConfig);
restartNum = restartNum + 1;
}
BusFactory.setDefaultBus(CxfServerBean.bus);
serverFactoryBean = new JAXRSServerFactoryBean();
serverFactoryBean.setBus(CxfServerBean.bus);
List<TbSysWsConfig> configs = getSystemWsConfigs();
publishDefault(configs);
int r = publishRest(serverFactoryBean, configs);
BindingFactoryManager manager = serverFactoryBean.getBus().getExtension(BindingFactoryManager.class);
bindingFactory = new JAXRSBindingFactory();
bindingFactory.setBus(serverFactoryBean.getBus());
manager.registerBindingFactory(JAXRSBindingFactory.JAXRS_BINDING_ID, bindingFactory);
if (r > 0) {
server = serverFactoryBean.create();
}
} catch (Exception e) {
e.printStackTrace();
}
logger.info("end");
}
use of com.netsteadfast.greenstep.po.hbm.TbSysWsConfig in project bamboobsc by billchen198318.
the class CxfServerBean method publishDefault.
private static int publishDefault(List<TbSysWsConfig> configs) {
int c = 0;
for (TbSysWsConfig config : configs) {
if (!WSConfig.TYPE_SOAP.equals(config.getType()) || StringUtils.isBlank(config.getPublishAddress())) {
continue;
}
try {
Endpoint.publish(config.getPublishAddress(), AppContext.getBean(config.getBeanId()));
c++;
} catch (Exception e) {
e.printStackTrace();
}
}
return c;
}
Aggregations