本文整理汇总了Java中org.eclipse.jetty.io.RuntimeIOException类的典型用法代码示例。如果您正苦于以下问题:Java RuntimeIOException类的具体用法?Java RuntimeIOException怎么用?Java RuntimeIOException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RuntimeIOException类属于org.eclipse.jetty.io包,在下文中一共展示了RuntimeIOException类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processRow
import org.eclipse.jetty.io.RuntimeIOException; //导入依赖的package包/类
@Override
public void processRow(ResultSet rs) throws SQLException {
try {
String metric = rs.getString("metric");
int ts = rs.getInt("ts");
double value = rs.getDouble("value");
checkNewMetric(metric);
fillNulls(ts);
if (Double.isFinite(value)) {
jsonWriter.value(value);
nextTs = ts + step;
}
} catch (IOException e) {
log.error("Failed to read data from CH", e);
throw new RuntimeIOException(e);
}
}
示例2: FirmataProtocolHandler
import org.eclipse.jetty.io.RuntimeIOException; //导入依赖的package包/类
public FirmataProtocolHandler(RemoteDeviceFactory deviceFactory) {
this.deviceFactory = deviceFactory;
String hostname = PropertyUtil.getProperty(TCP_HOST_PROP, null);
if (hostname != null) {
int port = PropertyUtil.getIntProperty(TCP_PORT_PROP, DEFAULT_TCP_PORT);
try {
adapter = new SocketFirmataAdapter(this, hostname, port);
} catch (IOException e) {
throw new RuntimeIOException(e);
}
// } else {
// String serial_port = PropertyUtil.getProperty(SERIAL_PORT_PROP, null);
// if (serial_port != null) {
// adapter = new SerialFirmataAdapter(serial_port)
// }
}
if (adapter == null) {
Logger.error("Please set either {} or {} property", TCP_HOST_PROP, SERIAL_PORT_PROP);
throw new IllegalArgumentException("Either " + TCP_HOST_PROP + " or " + SERIAL_PORT_PROP + " must be set");
}
}
示例3: loginAndAddBrandAndSwitchToGoods
import org.eclipse.jetty.io.RuntimeIOException; //导入依赖的package包/类
/**
* 步骤:登录系统-添加品牌-切到商品档案界面
*
* @param brand 品牌对象
*/
public static void loginAndAddBrandAndSwitchToGoods(Brand brand) {
// 登录系统
if (LoginKeyword.loginSystem()) {
LogUtils.info("登陆系统成功,当前登录用户为: [" + Constants.TEST_USERNAME + "].");
} else {
throw new RuntimeIOException("登录系统失败.");
}
// 先添加品牌,让商品类别绑定品牌
MenuKeyword.selectMenu("档案", "品牌档案");
BrandKeyword.addBrand(brand);
BrowserKeyword.switchToDefaultFrameOrWindow();
ElementKeyword.clickElement(By.xpath(".//span[text()='品牌档案']/parent::a/following-sibling::a"));
// 选择档案-商品相关-商品档案菜单
MenuKeyword.selectMenu("档案", "商品档案");
}
示例4: render
import org.eclipse.jetty.io.RuntimeIOException; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public String render(ModelAndView modelAndView) {
ClasspathJtwigResource templateResource = new ClasspathJtwigResource(this.templateRoot + modelAndView.getViewName());
JtwigTemplate template = new JtwigTemplate(templateResource, jtwigConfiguration);
String result;
try {
// TODO: will break if the model is not a HashMap<String, Object>
result = template.output(new JtwigModelMap().add((java.util.Map<String, Object>) modelAndView.getModel()));
} catch (ParseException | CompileException | RenderException e) {
throw new RuntimeIOException(e);
}
return result;
}
示例5: finish
import org.eclipse.jetty.io.RuntimeIOException; //导入依赖的package包/类
public void finish() {
try {
endMetric();
} catch (IOException e) {
log.error("Failed to read data from CH", e);
throw new RuntimeIOException(e);
}
}
示例6: render
import org.eclipse.jetty.io.RuntimeIOException; //导入依赖的package包/类
@Override
public String render(ModelAndView modelAndView) {
String viewName = modelAndView.getViewName();
try {
Template template = handlebars.compile(viewName);
return template.apply(modelAndView.getModel());
} catch (IOException e) {
throw new RuntimeIOException(e);
}
}
示例7: loginAndGoodsAndSwitchToBill
import org.eclipse.jetty.io.RuntimeIOException; //导入依赖的package包/类
/**
* 步骤:登录系统-添加品牌-添加商品
*
* @param brand 品牌对象
* @param goodsType 商品类别对象
* @param goodsList 商品档案对象列表
*/
public static void loginAndGoodsAndSwitchToBill(Brand brand, GoodsType goodsType, List<Goods> goodsList) {
String byGoodsFrame = ".//iframe[@id='erp/doc/goods/list']";
String byBrandFrame = ".//iframe[@id='erp/doc/brand/list']";
// 登录系统
if (LoginKeyword.loginSystem()) {
LogUtils.info("登陆系统成功,当前登录用户为: [" + Constants.TEST_USERNAME + "].");
} else {
throw new RuntimeIOException("登录系统失败.");
}
// 先添加品牌,让商品类别绑定品牌
MenuKeyword.selectMenu("档案", "品牌档案");
BrowserKeyword.switchToFrame(By.xpath(byBrandFrame));
BrandKeyword.addBrand(brand);
PageKeyword.closeTag("品牌档案");
// 选择档案-商品相关-商品档案菜单
MenuKeyword.selectMenu("档案", "商品档案");
// 切换到添加商品档案Frame
BrowserKeyword.switchToFrame(By.xpath(byGoodsFrame));
for (Goods goods : goodsList) {
// 添加商品类别
GoodsTypeKeyword.addFirstGoodsType(goodsType);
// 添加商品档案
GoodsKeyword.addGoods(goodsType.getName(), goods);
}
// 切回原来的Frame
PageKeyword.closeTag("商品档案");
}
示例8: setUp
import org.eclipse.jetty.io.RuntimeIOException; //导入依赖的package包/类
@Before
public void setUp() {
LogUtils.info("--------------------测试预处理:登录系统--------------------");
// 登录系统
if (LoginKeyword.loginSystem()) {
LogUtils.info("登陆系统成功,当前登录用户为: [" + Constants.TEST_USERNAME + "].");
} else {
throw new RuntimeIOException("登录系统失败.");
}
// 选择档案-商品相关-商品档案菜单
MenuKeyword.selectMenu("档案", "品牌档案");
}
示例9: render
import org.eclipse.jetty.io.RuntimeIOException; //导入依赖的package包/类
@Override
public String render(ModelAndView modelAndView) {
String viewName = modelAndView.getViewName();
Mustache mustache = mustacheFactory.compile(viewName);
StringWriter stringWriter = new StringWriter();
try {
mustache.execute(stringWriter, modelAndView.getModel()).close();
} catch (IOException e) {
throw new RuntimeIOException(e);
}
return stringWriter.toString();
}
示例10: processQueue
import org.eclipse.jetty.io.RuntimeIOException; //导入依赖的package包/类
void processQueue() {
EngineOutput o;
while(true) {
o = engine.getOutput();
if(o == null) continue;
HashMap<ServletResponse,AsyncContext> listeners;
synchronized(outputs) {
listeners = outputs.get(o.uuid);
}
if(listeners == null) continue;
Set<Map.Entry<ServletResponse,AsyncContext>> lo;
synchronized(listeners) {
lo = listeners.entrySet();
}
for (Map.Entry<ServletResponse,AsyncContext> me : lo) {
AsyncContext ac = me.getValue();
ServletResponse response = ac.getResponse();
try {
ServletOutputStream out = response.getOutputStream();
out.print("<script type=\"text/javascript\">__cb(");
out.print("[");
for(int i=0; i<o.object.length; i++) {
if(i>0) out.print(",");
out.print(o.object[i]);
}
out.print("]);</script>\n");
response.flushBuffer();
}
catch(IOException ioe) { ac.complete(); }
catch(RuntimeIOException eof) { cleanupResponse(response); }
}
}
}
示例11: ProjectFile
import org.eclipse.jetty.io.RuntimeIOException; //导入依赖的package包/类
ProjectFile(final File configFile) {
this.configFile=configFile;
this.id=configFile.getName();
IOUtil.assertFileIsReadable(configFile);
BufferedReader r=null;
try {
r=IOUtils.openFileForBufferedReading(this.configFile);
String line;
while((line=r.readLine())!=null)
{
if(line.trim().isEmpty()) continue;
if(line.startsWith("#"))
{
line=line.substring(1);
int colon = line.indexOf(":");
if(colon>0 )
{
final String key = line.substring(0,colon).trim().toLowerCase();
final String value = line.substring(colon+1).trim();
if(key.equals("id")) this.id=value;
else if(key.equals("name") || key.equals("label")) this.label=value;
else if(key.equals("desc") || key.equals("description")) this.description=value;
}
continue;
}
final Path file= Paths.get(line.trim());
ngsFiles.add(file);
}
} catch (IOException err) {
throw new RuntimeIOException(err);
}
}
示例12: ProjectHandler
import org.eclipse.jetty.io.RuntimeIOException; //导入依赖的package包/类
ProjectHandler(final File configFile) {
BufferedReader in= null;
try {
in= new BufferedReader(new FileReader(configFile));
} catch (IOException e) {
throw new RuntimeIOException(e);
}
finally
{
CloserUtil.close(in);
}
//TODO
projects= new ArrayList<>();
}