• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java BaseXServer类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中org.basex.BaseXServer的典型用法代码示例。如果您正苦于以下问题:Java BaseXServer类的具体用法?Java BaseXServer怎么用?Java BaseXServer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

BaseXServer类属于org.basex包,在下文中一共展示了BaseXServer类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: startServer

点赞 3

import org.basex.BaseXServer; //导入依赖的package包/类
public void startServer() {
	try {
		int serverPort = 1984;
	    final String path = System.getenv("HOME") + "/BaseXData";
	    final StringList sl = new StringList("-z", "-p " + Integer.toString(serverPort), "-q");
		context = new Context();
	    server = new BaseXServer(sl.finish());
	   
	    Prop.put(StaticOptions.DBPATH, path + "/");
	    Prop.put(StaticOptions.WEBPATH, path + "/webapp");
	    Prop.put(StaticOptions.RESTXQPATH, path + "/webapp");
	    Prop.put(StaticOptions.REPOPATH, path + "/repo");
	    Prop.put(StaticOptions.SERVERPORT, Integer.toString(serverPort));
	    //Prop.put(StaticOptions.PARALLEL, Integer.toString(20));
	} catch (Exception e) {
		e.printStackTrace();
	}
}
 

开发者ID:wsdookadr,
项目名称:mdetect,
代码行数:19,
代码来源:XmlStore.java

示例2: startup

点赞 3

import org.basex.BaseXServer; //导入依赖的package包/类
/**
 * Shuts down the server if it is already running, and starts it with the specified the data file.
 * Schedules the monitor task as well.
 *
 * @param input The data file or directory to use.
 * @throws IOException Thrown if it fails to read input
 */
public void startup(@NotNull File input) throws IOException {
	shutdown();
	
	/* [CG] If a client is used (as I initially) proposed, the database will get lost
    * once the client connection is closed. So we’ll have (at least) 2 options here:
    *
    * - Create a client, set MAINMEM to true and create database only close it if server is closed
    * - Create main-memory database at startup (it will then be bound to the server process).
	 *
	 * I went for the second option... */

	// "-d" for debug
	baseXServer = new BaseXServer( "-p" + PORT, "-n" + SERVER_NAME,
	    "-c " + "set mainmem on;set intparse on;create db " + DATABASE_NAME + " " + input.getAbsolutePath());

	/* [CG] I dropped all health checks. If something should be going wrong here, please give me a note;
	 * it should definitely be fixed! */

	log.info("Import completed.");
}
 

开发者ID:ag-gipp,
项目名称:mathosphere,
代码行数:28,
代码来源:Server.java

示例3: start

点赞 2

import org.basex.BaseXServer; //导入依赖的package包/类
/**
 * Starts the server; called after all properties have been set
 * 
 * @throws IOException
 */
@PostConstruct
private void start() throws IOException
{
	Validate.notNull(host);
	Validate.notNull(serverPort);

	context.mprop.set(MainProp.SERVERPORT, serverPort.intValue());
	context.mprop.set(MainProp.SERVERHOST, host);

	Validate.notNull(defaultUsername);
	Validate.notNull(defaultPassword);

	sanitize();

	// Commands to run on startup
	final StringBuilder sbCmd = new StringBuilder();

	sbCmd.append("-c");
	sbCmd.append(dropUser());
	sbCmd.append(createUser());
	sbCmd.append(changeAdminPassword());

	// Watch for trailing semicolons in the command list. It's not a command
	// terminator, it's a command separator.

	final List<String> args = new ArrayList<>();
	args.add(sbCmd.toString());

	if (suppressLogging)
	{
		final StringBuilder sbLog = new StringBuilder();
		sbLog.append("-z");
		args.add(sbLog.toString());
	}

	// Server starts by default
	server = new BaseXServer(context, args.toArray(new String[args.size()]));
}
 

开发者ID:openfurther,
项目名称:further-open-core,
代码行数:44,
代码来源:BaseXServerBean.java

示例4: startServer

点赞 2

import org.basex.BaseXServer; //导入依赖的package包/类
@BeforeClass
public static void startServer() throws Exception {
    server = new BaseXServer();
}
 

开发者ID:ligasgr,
项目名称:intellij-xquery,
代码行数:5,
代码来源:BaseXRunnerAppTest.java

示例5: getServer

点赞 1

import org.basex.BaseXServer; //导入依赖的package包/类
/**
 * Return the server property.
 * 
 * @return the server
 */
public BaseXServer getServer()
{
	return server;
}
 

开发者ID:openfurther,
项目名称:further-open-core,
代码行数:10,
代码来源:BaseXServerBean.java

示例6: setServer

点赞 1

import org.basex.BaseXServer; //导入依赖的package包/类
/**
 * Set a new value for the server property.
 * 
 * @param server
 *            the server to set
 */
public void setServer(final BaseXServer server)
{
	this.server = server;
}
 

开发者ID:openfurther,
项目名称:further-open-core,
代码行数:11,
代码来源:BaseXServerBean.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)