• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java CDONet4jSessionConfiguration类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: createSession

import org.eclipse.emf.cdo.net4j.CDONet4jSessionConfiguration; //导入依赖的package包/类
protected CDOSession createSession() {
	// Create connector
	IConnector connector = createConnector(getManagedContainer());

	// Create configuration
	CDONet4jSessionConfiguration configuration = CDONet4jUtil.createNet4jSessionConfiguration();
	configuration.setRepositoryName(getRepositoryName());
	configuration.setConnector(connector);

	// Open session
	CDONet4jSession session = configuration.openNet4jSession();
	session.options().setPassiveUpdateEnabled(true);
	session.options().setGeneratedPackageEmulationEnabled(true);

	// load persisted EPackages in the session (EPackage emulation must be enabled)
	for (CDOPackageInfo info : session.getPackageRegistry() .getPackageInfos()) {
		session.getPackageRegistry().put(info.getPackageURI(), info.getEPackage());
	}

	session.options().getNet4jProtocol().setTimeout(-1L);
	session.options().setCommitTimeout(Integer.MAX_VALUE);

	session.options().setCollectionLoadingPolicy(CDOUtil.createCollectionLoadingPolicy(0, 300));
	return session;
}
 
开发者ID:opencanarias,项目名称:model-repository-benchmark,代码行数:26,代码来源:AbstractCDOModelRepository.java


示例2: openSession

import org.eclipse.emf.cdo.net4j.CDONet4jSessionConfiguration; //导入依赖的package包/类
public CDONet4jSession openSession(String description, String repository) {
		// Create connector
	    IConnector connector = TCPUtil.getConnector(createClientContainer(), description);

	    // Create configuration
	    CDONet4jSessionConfiguration configuration = CDONet4jUtil.createNet4jSessionConfiguration();
//	    configuration.setSignalTimeout(60000);
	    configuration.setConnector(connector);
	    configuration.setRepositoryName(repository);
	    
	    // Open session    
	    CDONet4jSession session = configuration.openNet4jSession();
	    	    
	    for(Entry<String, Object> key: EPackage.Registry.INSTANCE.entrySet()) {
	    	session.getPackageRegistry().put(key.getKey(), key.getValue());
	    }

	    return session;
	}
 
开发者ID:asupdev,项目名称:asup,代码行数:20,代码来源:TestCommands.java


示例3: openSession

import org.eclipse.emf.cdo.net4j.CDONet4jSessionConfiguration; //导入依赖的package包/类
/**
 * Open a new {@link CDOSession}. Caller is responsible of {@link CDOSession#close() closing} the
 * resulting session.
 * 
 * @param connector
 *            the {@link IConnector} to use to open the {@link CDOSession}
 * @param repository
 *            the repository name
 * @param login
 *            the user login if any, if <code>null</code> otherwise no authentication will by used
 * @param password
 *            the user password if an, if <code>null</code> empty {@link String} will be used
 * @return a new {@link CDOSession}
 */
public static CDOSession openSession(IConnector connector, String repository, String login, String password) {
    final CDONet4jSessionConfiguration sessionConfiguration = CDONet4jUtil.createNet4jSessionConfiguration();
    sessionConfiguration.setConnector(connector);
    sessionConfiguration.setRepositoryName(repository);
    if (login != null) {
        final String pass;
        if (password != null) {
            pass = password;
        } else {
            pass = "";
        }
        sessionConfiguration.setCredentialsProvider(new PasswordCredentialsProvider(login, pass.toCharArray()));
    } else {
        final IPasswordCredentialsProvider credentialsProvider;
        if (SWT.isLoadable()) {
            credentialsProvider = new InteractiveCredentialsProvider();
        } else {
            credentialsProvider = new ShellCredentialsProvider();
        }
        sessionConfiguration.setCredentialsProvider(credentialsProvider);
    }

    CDOSession res = sessionConfiguration.openNet4jSession();

    return res;
}
 
开发者ID:ObeoNetwork,项目名称:M2Doc,代码行数:41,代码来源:M2DocCDOUtils.java


示例4: getSessionConfiguration

import org.eclipse.emf.cdo.net4j.CDONet4jSessionConfiguration; //导入依赖的package包/类
public CDOSessionConfiguration getSessionConfiguration() {
	CDONet4jSessionConfiguration configuration = CDONet4jUtil.createNet4jSessionConfiguration();
	configuration.setConnector(getConnector());
	configuration.setRepositoryName(getName());

	return configuration;
}
 
开发者ID:emfjson,项目名称:emfjson-samples,代码行数:8,代码来源:CDOServer.java


示例5: openSession

import org.eclipse.emf.cdo.net4j.CDONet4jSessionConfiguration; //导入依赖的package包/类
public CDOSession openSession() {
    CDONet4jSessionConfiguration config = CDONet4jUtil.createNet4jSessionConfiguration();
    config.setConnector(connector);
    config.setRepositoryName(repositoryName);
    return config.openNet4jSession();
}
 
开发者ID:atlanmod,项目名称:NeoEMF,代码行数:7,代码来源:CdoBackend.java


示例6: openSession

import org.eclipse.emf.cdo.net4j.CDONet4jSessionConfiguration; //导入依赖的package包/类
public static CDONet4jSession openSession(String description, String repository) {

//		org.eclipse.emf.cdo.util.CDOUtil.setLegacyModeDefault(true);
		
		// Create connector
	    IConnector connector = TCPUtil.getConnector(createClientContainer(), description);

	    // Create configuration
	    CDONet4jSessionConfiguration configuration = CDONet4jUtil.createNet4jSessionConfiguration();
//	    configuration.setSignalTimeout(60000);
	    configuration.setConnector(connector);
	    configuration.setRepositoryName(repository);
/*		configuration.setIDGenerator(new CDOIDGenerator() {
			
			@Override
			public void reset() {
				// TODO Auto-generated method stub
			}
			
			@Override
			public CDOID generateCDOID(EObject object) {

				// QTypedObject
				if(object instanceof QTypedObject) {
					QTypedObject typedObject = (QTypedObject)object;
					String id = typedObject.eClass().getClassifierID()+"/"+typedObject.getLibrary()+"/"+typedObject.getName();
					return CDOIDUtil.createString(id);
				}
				//QSystem
				else if(object instanceof QSystem) {
					QSystem qSystem = (QSystem)object;
					String id = qSystem.eClass().getClassifierID()+"/"+qSystem.getName();
					return CDOIDUtil.createString(id);
				}
				else
					return UUID.generateCDOID(object);
			}
		});*/
	    
	    // Open session    
	    CDONet4jSession session = configuration.openNet4jSession();
	    	    
	    for(Entry<String, Object> key: EPackage.Registry.INSTANCE.entrySet()) {
	    	session.getPackageRegistry().put(key.getKey(), key.getValue());
	    }

//	    System.out.println(session.options().isPassiveUpdateEnabled());
	    
//	    CDOCollectionLoadingPolicy policy = CDOUtil.createCollectionLoadingPolicy(10000, 10000);
//        session.options().setCollectionLoadingPolicy(policy);
	    return session;
	}
 
开发者ID:asupdev,项目名称:asup,代码行数:53,代码来源:CDOSessionUtil.java


示例7: createCDOSession

import org.eclipse.emf.cdo.net4j.CDONet4jSessionConfiguration; //导入依赖的package包/类
/**
 * Opens a CDOSession with the given connection information.
 * 
 * @param cdoHost
 *            URL of the CDO repository.
 * @param cdoPort
 *            Port of the CDO repository.
 * @param cdoRepo
 *            Name of the CDO repository.
 * @return CdoSession for given connection info.
 */
public static CDOSession createCDOSession(String cdoHost, Integer cdoPort, String cdoRepo) {
    String cdoServerURI = "tcp://" + cdoHost + ":" + cdoPort;
    IConnector connector = Net4jUtil.getConnector(IPluginContainer.INSTANCE, cdoServerURI);
    CDONet4jSessionConfiguration sessionConfiguration = CDONet4jUtil.createNet4jSessionConfiguration();
    sessionConfiguration.setConnector(connector);
    sessionConfiguration.setRepositoryName(cdoRepo);
    return sessionConfiguration.openNet4jSession();
}
 
开发者ID:Cooperate-Project,项目名称:CooperateModelingEnvironment,代码行数:20,代码来源:CDOHelper.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SecurityWebFilterChain类代码示例发布时间:2022-05-22
下一篇:
Java IVirtualComponent类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap