当前位置: 首页>>代码示例>>Java>>正文


Java OServerMain.create方法代码示例

本文整理汇总了Java中com.orientechnologies.orient.server.OServerMain.create方法的典型用法代码示例。如果您正苦于以下问题:Java OServerMain.create方法的具体用法?Java OServerMain.create怎么用?Java OServerMain.create使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.orientechnologies.orient.server.OServerMain的用法示例。


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

示例1: doPreSetup

import com.orientechnologies.orient.server.OServerMain; //导入方法依赖的package包/类
@Override
protected void doPreSetup() throws Exception {
       server = OServerMain.create();
       server.startup(getClass().getResourceAsStream("db.config.xml"));
       server.activate();

       ODatabaseDocumentTx db = new ODatabaseDocumentTx(DB_URL,false);
	db = db.create();
	db.command(new OCommandSQL("CREATE CLASS "+TEST_CLASS)).execute();
	db.command(new OCommandSQL("CREATE PROPERTY "+TEST_CLASS+"."+TEST_PROPERTY+" STRING")).execute();
	db.command(new OCommandSQL("CREATE PROPERTY "+TEST_CLASS+"."+TEST_LINK_PROPERTY+" LINK")).execute();
	db.command(new OCommandSQL("CREATE CLASS "+TEST_LINKED_CLASS)).execute();
	db.command(new OCommandSQL("CREATE PROPERTY "+TEST_LINKED_CLASS+"."+TEST_PROPERTY+" STRING")).execute();
	
	db.close();
       Thread.sleep(1000);
	super.doPreSetup();
}
 
开发者ID:OrienteerBAP,项目名称:camel-orientdb,代码行数:19,代码来源:OrientDBComponentTest.java

示例2: startUp

import com.orientechnologies.orient.server.OServerMain; //导入方法依赖的package包/类
@Override
protected void startUp() throws Exception {
    registerLifecycleListeners();
    server = OServerMain.create(true);
    server.setServerRootDirectory(config.getOrientDBRootDir().toAbsolutePath().toString());

    final OServerConfiguration serverConfig = new OServerConfiguration();
    registerHandlers(serverConfig);
    serverConfig.network = config.getNetworkConfig();
    serverConfig.users = config.getUsers().stream().toArray(OServerUserConfiguration[]::new);

    final ImmutableList.Builder<OServerEntryConfiguration> propertiesBuilder = ImmutableList.builder();
    config.getProperties().entrySet().stream()
            .map(entry -> new OServerEntryConfiguration(entry.getKey().getKey(), entry.getValue()))
            .forEach(propertiesBuilder::add);
    serverConfig.properties = propertiesBuilder.build().stream().toArray(OServerEntryConfiguration[]::new);

    server.startup(serverConfig);
    server.activate();
    registerDatabaseLifeCycleListeners();
    createDatabasePools();
}
 
开发者ID:runrightfast,项目名称:runrightfast-vertx,代码行数:23,代码来源:EmbeddedOrientDBService.java

示例3: initDB

import com.orientechnologies.orient.server.OServerMain; //导入方法依赖的package包/类
@Test(enabled = false)
public void initDB() {

  try {
    server = OServerMain.create();
    server.startup(ClassLoader.getSystemResourceAsStream("orientdb-server-config.xml"));
    server.activate();
  } catch (Exception e) {
    e.printStackTrace();
  }
  databaseDocumentTx = new ODatabaseDocumentTx(url);
  if (!databaseDocumentTx.exists()) {
    databaseDocumentTx = Orient.instance().getDatabaseFactory().createDatabase("graph", url);
    databaseDocumentTx.create();
  } else {
    databaseDocumentTx.open("admin", "admin");
  }
}
 
开发者ID:orientechnologies,项目名称:orientdb-lucene,代码行数:19,代码来源:BaseRemoteLuceneTest.java

示例4: start

import com.orientechnologies.orient.server.OServerMain; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void start() throws Exception {
    System.setProperty("ORIENTDB_HOME", conf.getFilesPath());
    System.setProperty("orientdb.www.path", "");
    prepareSecurityConfig();
    if (conf.isAutoSsl()) {
        new AutoSslConfigurator(dwServer, conf.getConfig()).configure();
    }
    OrientConfigUtils.checkLocalFilesInSslSockets(conf.getConfig());

    final OServer server = OServerMain.create();
    server.startup(conf.getConfig()).activate();

    installStudio(analyzeServerConfig(server));
    logger.info("Orient server started");
}
 
开发者ID:xvik,项目名称:dropwizard-orient-server,代码行数:20,代码来源:EmbeddedOrientServer.java

示例5: init

import com.orientechnologies.orient.server.OServerMain; //导入方法依赖的package包/类
public void init()
{
    setOrientDbHome();

    try
    {
        server = OServerMain.create();
    }
    catch (Exception exception)
    {
        logger.info(exception);
    }
}
 
开发者ID:geekflow,项目名称:light,代码行数:14,代码来源:OrientDBEmbedServer.java

示例6: start

import com.orientechnologies.orient.server.OServerMain; //导入方法依赖的package包/类
/**
 * for the web studio to work you'll need:
 * 1) set databaseBaseDir to point to the orientdb dir or to where the databases and www dirs are
 * 2) unpack the ${databaseBaseDir}/plugins/studio-x.x.zip/www as ${databaseBaseDir}/www/studio
 */
public void start() throws Exception {
    server = OServerMain.create();
    FileTemplate template = new FileTemplate(new FileDocument(config.getConfigAsString(ConfigKey.databaseConfigFileName)));
    server.startup(template.transform(config.asMap()));
    server.activate();
}
 
开发者ID:imotSpot,项目名称:imotSpot,代码行数:12,代码来源:OrientDBServer.java

示例7: contextInitialized

import com.orientechnologies.orient.server.OServerMain; //导入方法依赖的package包/类
@Override
public void contextInitialized(ServletContextEvent servletContextEvent)
{
    try
    {
        server = OServerMain.create();
        server = server.startup(OrientDBServletContextListener.class.getClassLoader().getResourceAsStream("db.config.xml"));
        server.activate();
    } catch (Exception e)
    {
        throw new RuntimeException(e);
    }
}
 
开发者ID:jesty,项目名称:orientdb-javaee,代码行数:14,代码来源:OrientDBServletContextListener.java

示例8: startServer

import com.orientechnologies.orient.server.OServerMain; //导入方法依赖的package包/类
/**
 * Start the OrientDB studio server by extracting the studio plugin zipfile.
 * 
 * @throws Exception
 */
@Override
public void startServer() throws Exception {
	ClusterOptions clusterOptions = options.getClusterOptions();
	boolean isClusteringEnabled = clusterOptions != null && clusterOptions.isEnabled();
	String orientdbHome = new File("").getAbsolutePath();
	System.setProperty("ORIENTDB_HOME", orientdbHome);
	if (server == null) {
		server = OServerMain.create();
		updateOrientDBPlugin();
	}

	if (clusterOptions != null && clusterOptions.isEnabled()) {
		// This setting will be referenced by the hazelcast configuration
		System.setProperty("mesh.clusterName", clusterOptions.getClusterName() + "@" + Mesh.getPlainVersion());
	}

	log.info("Starting OrientDB Server");
	server.startup(getOrientServerConfig());
	OServerPluginManager manager = new OServerPluginManager();
	manager.config(server);
	server.activate();
	if (isClusteringEnabled) {
		ODistributedServerManager distributedManager = server.getDistributedManager();
		topologyEventBridge = new TopologyEventBridge(this);
		distributedManager.registerLifecycleListener(topologyEventBridge);
		if (server.getDistributedManager() instanceof OHazelcastPlugin) {
			hazelcastPlugin = (OHazelcastPlugin) distributedManager;
		}
	}
	manager.startup();
	if (isClusteringEnabled) {
		// The registerLifecycleListener may not have been invoked. We need to redirect the online event manually.
		postStartupDBEventHandling();
	}
}
 
开发者ID:gentics,项目名称:mesh,代码行数:41,代码来源:OrientDBDatabase.java

示例9: startOrientdb

import com.orientechnologies.orient.server.OServerMain; //导入方法依赖的package包/类
public void startOrientdb() throws java.lang.Exception
{
    System.setProperty("ORIENTDB_HOME",octopusHome + "/orientdb");
    System.setProperty("orientdb.www.path",octopusHome +"/orientdb/www");
    System.setProperty("orientdb.config.file", octopusHome + "/conf/orientdb-server-config.xml");

    server = OServerMain.create();
    server.startup();
    server.activate();
}
 
开发者ID:octopus-platform,项目名称:bjoern,代码行数:11,代码来源:OctopusMain.java

示例10: StorageEngine

import com.orientechnologies.orient.server.OServerMain; //导入方法依赖的package包/类
public StorageEngine() throws Exception {
  server = OServerMain.create();
  server.startup(Thread.currentThread().getContextClassLoader().getResourceAsStream("orientconf.xml"));
  server.activate();
  attachmentStorage = new AttachmentStorage();
  url = "plocal:./databases/rtc2jira";
}
 
开发者ID:rtcTo,项目名称:rtc2jira,代码行数:8,代码来源:StorageEngine.java

示例11: createOServer

import com.orientechnologies.orient.server.OServerMain; //导入方法依赖的package包/类
private static OServer createOServer() throws Exception {
    registerLifeCycleListener();
    server = OServerMain.create(true);
    server.setServerRootDirectory(orientdbHome.getAbsolutePath());
    final OServerConfiguration config = new OServerConfiguration();

    config.handlers = ImmutableList.<OServerHandlerConfiguration>builder()
            .add(oGraphServerHandler())
            .add(oHazelcastPlugin())
            .add(oServerSideScriptInterpreter())
            .build();

    config.network = new OServerNetworkConfiguration();
    config.network.protocols = ImmutableList.<OServerNetworkProtocolConfiguration>builder()
            .add(new OServerNetworkProtocolConfiguration("binary", ONetworkProtocolBinary.class.getName()))
            .build();
    final OServerNetworkListenerConfiguration binaryListener = new OServerNetworkListenerConfiguration();
    binaryListener.ipAddress = "0.0.0.0";
    binaryListener.protocol = "binary";
    binaryListener.portRange = "2424-2430";
    binaryListener.socket = "default";
    config.network.listeners = ImmutableList.<OServerNetworkListenerConfiguration>builder()
            .add(binaryListener)
            .build();

    config.users = new OServerUserConfiguration[]{
        new OServerUserConfiguration(ROOT_USER, "root", "*")
    };

    config.properties = new OServerEntryConfiguration[]{
        new OServerEntryConfiguration("db.pool.min", "1"),
        new OServerEntryConfiguration("db.pool.max", "50")
    };

    server.startup(config);
    return server;
}
 
开发者ID:runrightfast,项目名称:runrightfast-vertx,代码行数:38,代码来源:RunRightFastOrientDBLifeCycleListenerTest.java

示例12: onAfterInitialized

import com.orientechnologies.orient.server.OServerMain; //导入方法依赖的package包/类
@Override
public void onAfterInitialized(Application application) {
	try {
		OrientDbWebApplication app = (OrientDbWebApplication)application;
		OServer server = OServerMain.create(false);
		if(url!=null)
		{
			server.startup(url.openStream());
		}
		else if(configFile!=null)
		{
			server.startup(configFile);
		}
		else if(config!=null)
		{
			server.startup(config);
		}
		else if(serverConfiguration!=null)
		{
			server.startup(serverConfiguration);
		}
		else
		{
			server.startup();
		}
		server.activate();
		server.removeShutdownHook();
		app.setServer(server);
		app.getOrientDbSettings().setDatabasePoolFactory(server.getDatabasePoolFactory());
		onAfterServerStartupAndActivation(app);
	} catch (Exception e) {
		throw new WicketRuntimeException("Can't start OrientDB Embedded Server", e);
	}
}
 
开发者ID:OrienteerBAP,项目名称:wicket-orientdb,代码行数:35,代码来源:EmbeddOrientDbApplicationListener.java

示例13: startServer

import com.orientechnologies.orient.server.OServerMain; //导入方法依赖的package包/类
private OServer startServer() throws Exception
	{
		OServer server = OServerMain.create();
//		server.startup();
		server.startup(OrientDbTestWebApplication.class.getResource("db.config.xml").openStream());
		server.activate();
		return server;
	}
 
开发者ID:OrienteerBAP,项目名称:wicket-orientdb,代码行数:9,代码来源:TestStandaloneOrientDBCompatibility.java

示例14: testOrientDbLifeCycle

import com.orientechnologies.orient.server.OServerMain; //导入方法依赖的package包/类
public void testOrientDbLifeCycle(String dbURL, boolean createDb, boolean dropDb) throws Exception
	{
		Orient.instance().startup();
		assertNotNull(ODatabaseRecordThreadLocal.INSTANCE);
		Orient.instance().removeShutdownHook();
		OServer server = OServerMain.create();
		server.startup(OrientDbTestWebApplication.class.getResource("db.config.xml").openStream());
		server.activate();
		if(createDb)
		{
			ODatabaseDocument dbToCreate = new ODatabaseDocumentTx(dbURL);
			if(!dbToCreate.exists()) dbToCreate.create();
			dbToCreate.close();
		}
		assertNotNull(ODatabaseRecordThreadLocal.INSTANCE);
		ODatabaseDocument db = new OPartitionedDatabasePoolFactory().get(dbURL, "admin", "admin").acquire();
		db.close();
		assertNotNull(ODatabaseRecordThreadLocal.INSTANCE);
		if(dropDb)
		{
			ODatabaseDocument dbToDrop = new ODatabaseDocumentTx(dbURL);
			dbToDrop.open("admin", "admin");
			dbToDrop.drop();
		}
		server.shutdown();
		Orient.instance().shutdown();
//		Thread.sleep(50);
	}
 
开发者ID:OrienteerBAP,项目名称:wicket-orientdb,代码行数:29,代码来源:TestStandaloneOrientDBCompatibility.java

示例15: getObject

import com.orientechnologies.orient.server.OServerMain; //导入方法依赖的package包/类
/**
 * Instantiates and starts up the OrientDB server.
 *
 * @return The server instance. Typically you will not have to interact with it.
 * @throws Exception Indicates failure during creation.
 */
@Override
public final OServer getObject() throws Exception {
  if (server == null) {
    server = OServerMain.create();
    logger.info("Creating OrientDB server with configuration '{}'.", configuration.getURI());
    server.startup(configuration.getInputStream());
    server.activate();
    server.getNetworkListeners().forEach(it -> logger.info("OrientDB server listening on '{}'.", it
      .getListeningAddress(false)));
  }
  return server;
}
 
开发者ID:lfridael,项目名称:resourceful-java-prototype,代码行数:19,代码来源:OrientDbServerFactoryBean.java


注:本文中的com.orientechnologies.orient.server.OServerMain.create方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。