本文整理汇总了Java中org.eclipse.emf.cdo.server.net4j.CDONet4jServerUtil类的典型用法代码示例。如果您正苦于以下问题:Java CDONet4jServerUtil类的具体用法?Java CDONet4jServerUtil怎么用?Java CDONet4jServerUtil使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CDONet4jServerUtil类属于org.eclipse.emf.cdo.server.net4j包,在下文中一共展示了CDONet4jServerUtil类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getManagedContainer
import org.eclipse.emf.cdo.server.net4j.CDONet4jServerUtil; //导入依赖的package包/类
protected IManagedContainer getManagedContainer() {
// IPluginContainer.INSTANCE;
// Manually prepare a container each time
if (container == null) {
logger.trace("Initialising CDO Managed Container");
container = ContainerUtil.createContainer();
Net4jUtil.prepareContainer(container); // Register Net4j factories
TCPUtil.prepareContainer(container); // Register TCP factories
JVMUtil.prepareContainer(container); // Register JVM factories
CDONet4jUtil.prepareContainer(container); // Register CDO factories
CDONet4jServerUtil.prepareContainer(container); // Register CDO Server Net4j Factories
ContainerUtil.prepareContainer(container);
LifecycleUtil.activate(container);
logger.trace("Finished initialising CDO Managed Container");
}
return container;
}
开发者ID:opencanarias,项目名称:model-repository-benchmark,代码行数:18,代码来源:AbstractCDOModelRepository.java
示例2: start
import org.eclipse.emf.cdo.server.net4j.CDONet4jServerUtil; //导入依赖的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: getContainer
import org.eclipse.emf.cdo.server.net4j.CDONet4jServerUtil; //导入依赖的package包/类
protected IManagedContainer getContainer() {
final IManagedContainer container = ContainerUtil.createContainer();
Net4jUtil.prepareContainer(container);
JVMUtil.prepareContainer(container);
CDONet4jUtil.prepareContainer(container);
CDONet4jServerUtil.prepareContainer(container);
return container;
}
开发者ID:emfjson,项目名称:emfjson-samples,代码行数:10,代码来源:CDOServer.java
示例4: start
import org.eclipse.emf.cdo.server.net4j.CDONet4jServerUtil; //导入依赖的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
示例5: createContainer
import org.eclipse.emf.cdo.server.net4j.CDONet4jServerUtil; //导入依赖的package包/类
private IManagedContainer createContainer() {
IManagedContainer container = ContainerUtil.createContainer();
Net4jUtil.prepareContainer(container);
JVMUtil.prepareContainer(container);
CDONet4jUtil.prepareContainer(container);
CDONet4jServerUtil.prepareContainer(container);
container.activate();
return container;
}
开发者ID:atlanmod,项目名称:NeoEMF,代码行数:10,代码来源:CdoBackend.java
示例6: start
import org.eclipse.emf.cdo.server.net4j.CDONet4jServerUtil; //导入依赖的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.net4j.CDONet4jServerUtil类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论