本文整理汇总了Java中org.rosuda.REngine.Rserve.RConnection.shutdown方法的典型用法代码示例。如果您正苦于以下问题:Java RConnection.shutdown方法的具体用法?Java RConnection.shutdown怎么用?Java RConnection.shutdown使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.rosuda.REngine.Rserve.RConnection
的用法示例。
在下文中一共展示了RConnection.shutdown方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: tearDown
import org.rosuda.REngine.Rserve.RConnection; //导入方法依赖的package包/类
@PreDestroy
public void tearDown() {
try {
if(LOGGER.isInfoEnabled()) {
LOGGER.info("Shuting down Rserve daemon....");
}
RConnection rConnection = rConnectionFactory.getConnection();
rConnection.shutdown();
rConnectionFactory.releaseConnection(rConnection);
if(LOGGER.isInfoEnabled()) {
LOGGER.info("Shutdown signal sent to Rserve daemon");
}
} catch(Exception e) {
LOGGER.error("Unexpected error shuting down RServe", e);
}
}
示例2: stop
import org.rosuda.REngine.Rserve.RConnection; //导入方法依赖的package包/类
public void stop() {
println("stopping R daemon... " + conf, Level.INFO);
if (!conf.isLocal()) {
throw new UnsupportedOperationException(
"Not authorized to stop a remote R daemon: "
+ conf.toString());
}
try {
RConnection s = conf.connect();
if (s == null || !s.isConnected()) {
println("R daemon already stoped.", Level.INFO);
return;
}
s.shutdown();
} catch (Exception ex) {
// ex.printStackTrace();
println(ex.getMessage(), Level.ERROR);
}
/*
* if (br != null) { try { br.close(); } catch (IOException ex) {
* ex.printStackTrace(); println(ex.getMessage()); } }
*/
// if (pw != null) {
// pw.close();
// }
// process.destroy();
println("R daemon stoped.", Level.INFO);
log = null;
}
示例3: main
import org.rosuda.REngine.Rserve.RConnection; //导入方法依赖的package包/类
/** just a demo main method which starts Rserve and shuts it down again */
public static void main(String[] args) {
System.err.println("result=" + checkLocalRserve());
try {
RConnection c = new RConnection();
c.shutdown();
} catch (Exception x) {
}
}
示例4: main
import org.rosuda.REngine.Rserve.RConnection; //导入方法依赖的package包/类
/** just a demo main method which starts Rserve and shuts it down again */
public static void main(String[] args) {
System.out.println("result="+checkLocalRserve());
try {
RConnection c=new RConnection();
c.shutdown();
} catch (Exception x) {};
}