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


Java Orient类代码示例

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


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

示例1: setUp

import com.orientechnologies.orient.core.Orient; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
  entityHook = new EntityHook(eventManager);

  Orient.instance().addDbLifecycleListener(entityHook);

  CapabilityStorageItemEntityAdapter entityAdapter = new CapabilityStorageItemEntityAdapter();
  entityAdapter.enableObfuscation(new HexRecordIdObfuscator());
  entityAdapter.enableEntityHook(entityHook);

  this.underTest = new OrientCapabilityStorage(
      database.getInstanceProvider(),
      entityAdapter
  );

  underTest.start();
}
 
开发者ID:sonatype,项目名称:nexus-public,代码行数:18,代码来源:OrientCapabilityStorageTest.java

示例2: initDB

import com.orientechnologies.orient.core.Orient; //导入依赖的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

示例3: startupIfEnginesAreMissing

import com.orientechnologies.orient.core.Orient; //导入依赖的package包/类
private void startupIfEnginesAreMissing() {
    // If an instance of Orient was previously shutdown all engines are removed.
    // We need to startup Orient again.
    if ( Orient.instance().getEngines().size() == 0 ) {
        Orient.instance().startup();
    }
}
 
开发者ID:ghaseminya,项目名称:jbake-rtl-jalaali,代码行数:8,代码来源:ContentStore.java

示例4: setup

import com.orientechnologies.orient.core.Orient; //导入依赖的package包/类
protected void setup() throws MojoExecutionException {
    if (oven != null) {
        return;
    }
    
    try {
        Orient.instance().startup();
        this.oven = new Oven(inputDirectory, outputDirectory, createConfiguration(), clearCache);
        oven.setupPaths();
    } catch (Throwable ex) {
        destroy();
        throw new MojoExecutionException("Failure when running: ", ex);
    }
}
 
开发者ID:Blazebit,项目名称:jbake-maven-plugin,代码行数:15,代码来源:BuildMojo.java

示例5: destroy

import com.orientechnologies.orient.core.Orient; //导入依赖的package包/类
protected void destroy() {
    oven = null;
    
    try {
        Orient.instance().shutdown();
    } catch (Exception e) {
        getLog().warn("Error on shutdown", e);
    }
}
 
开发者ID:Blazebit,项目名称:jbake-maven-plugin,代码行数:10,代码来源:BuildMojo.java

示例6: setOrientDbHome

import com.orientechnologies.orient.core.Orient; //导入依赖的package包/类
private void setOrientDbHome()
{
    if (ORIENTDB_HOME.length() == 0)
    {
        System.setProperty(Orient.ORIENTDB_HOME, createOrientDbHome());

        logger.info("{} ORIENTDB_HOME : {}", Product.NAME.toUpperCase(), System.getProperty(Orient.ORIENTDB_HOME));
    }
}
 
开发者ID:geekflow,项目名称:light,代码行数:10,代码来源:OrientDBEmbedServer.java

示例7: startup

import com.orientechnologies.orient.core.Orient; //导入依赖的package包/类
@Override
public void startup() {
  if (!enabled)
    return;

  Orient.instance().addDbLifecycleListener(this);

  final OServerNetworkListener listener = server.getListenerByProtocol(ONetworkProtocolHttpAbstract.class);
  if (listener == null)
    throw new OConfigurationException("HTTP listener not found");

  listener.registerStatelessCommand(new OServerCommandESSync(this));
}
 
开发者ID:orientechnologies,项目名称:orientdb-elasticsearch,代码行数:14,代码来源:OElasticSearchPlugin.java

示例8: closeManager

import com.orientechnologies.orient.core.Orient; //导入依赖的package包/类
private void closeManager() {
  synchronized (databaseInfos) {
    databaseInfos.values().forEach(DatabaseInfo::close);
    databaseInfos.clear();
  }

  // global shutdown
  Orient.instance().shutdown();
}
 
开发者ID:cstamas,项目名称:vertx-orientdb,代码行数:10,代码来源:ManagerImpl.java

示例9: openManager

import com.orientechnologies.orient.core.Orient; //导入依赖的package包/类
private void openManager() throws IOException {
  if (orientServer != null) {
    // server is running, obey server managerOptions
    this.databasesDir = Paths.get(orientServer.getDatabaseDirectory());
  }
  else {
    // just embedded, obey our managerOptions
    Path orientHome = Paths.get(managerOptions.getOrientHome()).toAbsolutePath();
    this.databasesDir = orientHome.resolve("databases");
  }
  // global startup
  Orient.instance().startup();
  Orient.instance().removeShutdownHook();
}
 
开发者ID:cstamas,项目名称:vertx-orientdb,代码行数:15,代码来源:ManagerImpl.java

示例10: configureServer

import com.orientechnologies.orient.core.Orient; //导入依赖的package包/类
private void configureServer() throws IOException {
  this.orientHome = Paths.get(managerOptions.getOrientHome()).toAbsolutePath();
  log.info(Orient.ORIENTDB_HOME + "=" + orientHome);
  this.orientServerConfig = orientHome.resolve(OServerConfiguration.DEFAULT_CONFIG_FILE);
  log.info("OrientDB server configuration: " + orientServerConfig);
  mayDefaultServer();

  System.setProperty("orient.home", orientHome.toString());
  System.setProperty(Orient.ORIENTDB_HOME, orientHome.toString());
}
 
开发者ID:cstamas,项目名称:vertx-orientdb,代码行数:11,代码来源:ManagerImpl.java

示例11: stop

import com.orientechnologies.orient.core.Orient; //导入依赖的package包/类
@Override
public void stop() {
	factory.close();
	Orient.instance().shutdown();
	if (server != null) {
		server.shutdown();
	}
	Tx.setActive(null);
}
 
开发者ID:gentics,项目名称:mesh,代码行数:10,代码来源:OrientDBDatabase.java

示例12: doStart

import com.orientechnologies.orient.core.Orient; //导入依赖的package包/类
@Override
protected void doStart() throws Exception {
  // global startup
  Orient.instance().startup();

  // instance startup
  OServer server = new OServer();
  configureOrientMinimumLogLevel();
  server.setExtensionClassLoader(uberClassLoader);
  OServerConfiguration config = createConfiguration();
  server.startup(config);

  // remove Orient shutdown-hooks added during startup, we'll manage shutdown ourselves
  Orient.instance().removeShutdownHook();
  server.removeShutdownHook();

  // create default root user to avoid orientdb prompt on console
  server.addUser(OServerConfiguration.DEFAULT_ROOT_USER, null, "*");

  // Log global configuration
  if (log.isDebugEnabled()) {
    // dumpConfiguration() only accepts ancient stream api
    String encoding = StandardCharsets.UTF_8.name();
    ByteArrayOutputStream buff = new ByteArrayOutputStream();
    OGlobalConfiguration.dumpConfiguration(new PrintStream(buff, true, encoding));
    log.debug("Global configuration:\n{}", new String(buff.toByteArray(), encoding));
  }

  Orient.instance().addDbLifecycleListener(entityHook);

  server.activate();
  log.info("Activated");

  this.orientServer = server;
}
 
开发者ID:sonatype,项目名称:nexus-public,代码行数:36,代码来源:DatabaseServerImpl.java

示例13: doStop

import com.orientechnologies.orient.core.Orient; //导入依赖的package包/类
@Override
protected void doStop() throws Exception {
  // instance shutdown
  orientServer.shutdown();
  orientServer = null;

  // global shutdown
  Orient.instance().shutdown();

  log.info("Shutdown");
}
 
开发者ID:sonatype,项目名称:nexus-public,代码行数:12,代码来源:DatabaseServerImpl.java

示例14: testMemoryDBShouldDisapear

import com.orientechnologies.orient.core.Orient; //导入依赖的package包/类
@Test(expected=OStorageException.class)
@Ignore
public void testMemoryDBShouldDisapear() throws Exception
{
	try
	{
		testOrientDbLifeCycle(MEMORY_DB_NAME, true, false);
		testOrientDbLifeCycle(MEMORY_DB_NAME, false, true);
	} finally
	{
		OServer server = OServerMain.server();
		if(server!=null) server.shutdown();
		Orient.instance().shutdown();
	}
}
 
开发者ID:OrienteerBAP,项目名称:wicket-orientdb,代码行数:16,代码来源:TestStandaloneOrientDBCompatibility.java

示例15: testOrientDbLifeCycle

import com.orientechnologies.orient.core.Orient; //导入依赖的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


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