本文整理汇总了Java中org.eclipse.emf.cdo.server.CDOServerUtil类的典型用法代码示例。如果您正苦于以下问题:Java CDOServerUtil类的具体用法?Java CDOServerUtil怎么用?Java CDOServerUtil使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CDOServerUtil类属于org.eclipse.emf.cdo.server包,在下文中一共展示了CDOServerUtil类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: start
import org.eclipse.emf.cdo.server.CDOServerUtil; //导入依赖的package包/类
public void start() {
if (getStatus() == RepositoryStatus.RUNNING) {
return;
}
setStatus(RepositoryStatus.STARTING);
try {
logger.trace("Starting Server {}", getName());
container = getManagedContainer();
logger.trace("Starting IAcceptor");
if (acceptor == null)
acceptor = createAcceptor(container);
logger.trace("Starting IRepository");
if (repository == null) {
repository = createRepository();
CDOServerUtil.addRepository(container, repository);
}
} catch (Exception e) {
logger.error("Error while starting CDO Model Repository", e);
setStatus(RepositoryStatus.ERROR);
return;
}
setStatus(RepositoryStatus.RUNNING);
}
开发者ID:opencanarias,项目名称:model-repository-benchmark,代码行数:26,代码来源:AbstractCDOModelRepository.java
示例2: start
import org.eclipse.emf.cdo.server.CDOServerUtil; //导入依赖的package包/类
/**
* Starts the CDO server.
*/
public void start() {
if (repository == null) {
container = ContainerUtil.createContainer();
Net4jUtil.prepareContainer(container);
CDONet4jUtil.prepareContainer(container);
TCPUtil.prepareContainer(container);
container.activate();
OMPlatform.INSTANCE.setDebugging(false);
OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE);
OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE);
Net4jUtil.prepareContainer(container); // Prepare the Net4j kernel
TCPUtil.prepareContainer(container); // Prepare the TCP support
CDONet4jServerUtil.prepareContainer(container); // Prepare the CDO server
// OCLQueryHandler.prepareContainer(container); // Prepare OCL queries
repository = createRepository();
if (withAuth) {
InternalSessionManager sessionManager = (InternalSessionManager) CDOServerUtil.createSessionManager();
final UserManager userManager = new UserManager();
userManager.addUser(USER_NAME, PASSWORD.toCharArray());
sessionManager.setAuthenticator(userManager);
((Repository) repository).setSessionManager(sessionManager);
}
CDOServerUtil.addRepository(container, repository);
acceptor = Net4jUtil.getAcceptor(container, PROTOCOL, IP + ":" + PORT);
}
}
开发者ID:ObeoNetwork,项目名称:M2Doc,代码行数:35,代码来源:CDOServer.java
示例3: start
import org.eclipse.emf.cdo.server.CDOServerUtil; //导入依赖的package包/类
public void start() {
container.activate();
CDOServerUtil.addRepository(container, repository);
JVMUtil.getAcceptor(container, getName());
connector = JVMUtil.getConnector(container, getName());
}
开发者ID:emfjson,项目名称:emfjson-samples,代码行数:9,代码来源:CDOServer.java
示例4: createRepository
import org.eclipse.emf.cdo.server.CDOServerUtil; //导入依赖的package包/类
/**
* Creates the repository.
*
* @return the repository
*/
protected IRepository createRepository() {
Map<String, String> props = new HashMap<String, String>();
props.put(Props.SUPPORTING_AUDITS, Boolean.TRUE.toString());
props.put(Props.SUPPORTING_BRANCHES, Boolean.TRUE.toString());
return CDOServerUtil.createRepository(REPOSITORY_NAME, createStore(), props);
}
开发者ID:ModelWriter,项目名称:Source,代码行数:13,代码来源:CDOServer.java
示例5: start
import org.eclipse.emf.cdo.server.CDOServerUtil; //导入依赖的package包/类
/**
* Starts the CDO server.
*/
public void start() {
if (repository == null) {
OMPlatform.INSTANCE.setDebugging(false);
OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE);
OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE);
Net4jUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the Net4j kernel
TCPUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the TCP support
CDONet4jServerUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the CDO server
// OCLQueryHandler.prepareContainer(IPluginContainer.INSTANCE); // Prepare OCL queries
repository = createRepository();
if (withAuth) {
InternalSessionManager sessionManager = (InternalSessionManager)CDOServerUtil
.createSessionManager();
IUserManager userManager = new UserManager();
userManager.addUser(USER_NAME, PASSWORD.toCharArray());
sessionManager.setUserManager(userManager);
((Repository)repository).setSessionManager(sessionManager);
}
CDOServerUtil.addRepository(IPluginContainer.INSTANCE, repository);
Net4jUtil.getAcceptor(IPluginContainer.INSTANCE, PROTOCOL, IP + ":" + PORT);
}
}
开发者ID:ModelWriter,项目名称:Source,代码行数:30,代码来源:CDOServer.java
示例6: createRepository
import org.eclipse.emf.cdo.server.CDOServerUtil; //导入依赖的package包/类
private IRepository createRepository(IStore store) {
Map<String, String> props = new HashMap<>();
props.put(IRepository.Props.OVERRIDE_UUID, repositoryName);
props.put(IRepository.Props.SUPPORTING_AUDITS, "false");
props.put(IRepository.Props.SUPPORTING_BRANCHES, "false");
return CDOServerUtil.createRepository(repositoryName, store, props);
}
开发者ID:atlanmod,项目名称:NeoEMF,代码行数:8,代码来源:CdoBackend.java
示例7: createRepository
import org.eclipse.emf.cdo.server.CDOServerUtil; //导入依赖的package包/类
protected IRepository createRepository() {
return CDOServerUtil.createRepository(getRepositoryName(), createStore(), createRepositoryProperties());
}
开发者ID:opencanarias,项目名称:model-repository-benchmark,代码行数:4,代码来源:AbstractCDOModelRepository.java
示例8: start
import org.eclipse.emf.cdo.server.CDOServerUtil; //导入依赖的package包/类
@LevelStarted
public void start(DataSourceFactory dataSourceFactory) throws SQLException {
try {
OMPlatform.INSTANCE.setDebugging(true);
OMPlatform.INSTANCE.addLogHandler(org.eclipse.net4j.util.om.log.PrintLogHandler.CONSOLE);
OMPlatform.INSTANCE.addTraceHandler(org.eclipse.net4j.util.om.trace.PrintTraceHandler.CONSOLE);
Net4jUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the Net4j kernel
TCPUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the TCP support
CDONet4jServerUtil.prepareContainer(IPluginContainer.INSTANCE); // Prepare the CDO server
CDOStoreConfig storeConfig = (CDOStoreConfig) getConfig();
// adapter -> Adapter definito in db-core-cdo.xmi (per es. MySQLAdapter)
IDBAdapter adapter = DBUtil.getDBAdapter(storeConfig.getAdapter());
// provider
Properties dataSourceProps = new Properties();
dataSourceProps.put("class", storeConfig.getDriver());
dataSourceProps.put("url", storeConfig.getUrl());
dataSourceProps.put("user", storeConfig.getCredentials().getUser());
dataSourceProps.put("password", storeConfig.getCredentials().getPassword());
// TODO retrieve dataFactory by adapter
DataSource dataSource = dataSourceFactory.createDataSource(dataSourceProps);
IDBConnectionProvider provider = DBUtil.createConnectionProvider(dataSource);
// store
Map<String, String> databaseProps = new HashMap<String, String>();
databaseProps.put("readerPoolCapacity", "10");
databaseProps.put("writerPoolCapacity", "10");
// strategy
IMappingStrategy strategy = createMappingStrategy();
Map<String, String> mappingProps = new HashMap<String, String>();
mappingProps.put("toManyReferences", "ONE_TABLE_PER_CLASS");
mappingProps.put("qualifiedNames", "false");
strategy.setProperties(mappingProps);
IDBStore store = CDODBUtil.createStore(strategy, adapter, provider, databaseProps);
strategy.setStore(store);
// repository
Map<String, String> repositoryProps = new HashMap<String, String>();
repositoryProps.put("overrideUUID", "");
repositoryProps.put("supportingAudits", "false");
repositoryProps.put("supportingBranches", "false");
IRepository repository = CDOServerUtil.createRepository(storeConfig.getRepository(), store, repositoryProps);
CDOServerUtil.addRepository(IPluginContainer.INSTANCE, repository);
QServerSocketConfig socketConfig = storeConfig.getSocketConfig();
Net4jUtil.getAcceptor(IPluginContainer.INSTANCE, "tcp", socketConfig.getAddress()+":"+socketConfig.getPort());
System.out.println("CDO activated");
}
catch(Exception e) {
e.printStackTrace();
}
}
开发者ID:asupdev,项目名称:asup,代码行数:67,代码来源:CDOStoreActivatorHook.java
注:本文中的org.eclipse.emf.cdo.server.CDOServerUtil类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论