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


Java CDONet4jSession类代码示例

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


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

示例1: createSession

import org.eclipse.emf.cdo.net4j.CDONet4jSession; //导入依赖的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.CDONet4jSession; //导入依赖的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: CDOResourceReaderImpl

import org.eclipse.emf.cdo.net4j.CDONet4jSession; //导入依赖的package包/类
protected CDOResourceReaderImpl(QJob job, Class<T> klass, CDONet4jSession session) {
	setJob(job);
	this.session = session;		
	this.klass = klass;
	this.klassName = CDOResourceUtil.getModelName(klass);
	EPackage ePackage = CDOResourceUtil.getEPackage(session, klass);
	this.eClass = CDOResourceUtil.getEClass(ePackage, klass);
	this.resourceEvent = QOperatingSystemResourcesFactory.eINSTANCE.createResourceEvent();
	this.resourceEvent.setResource(this);		
	this.objectLocker = new CDOObjectLockerImpl<T>();
}
 
开发者ID:asupdev,项目名称:asup,代码行数:12,代码来源:CDOResourceReaderImpl.java

示例4: getSession

import org.eclipse.emf.cdo.net4j.CDONet4jSession; //导入依赖的package包/类
private CDONet4jSession getSession(QJob job) {
			
	CDONet4jSession session = sessions.get(job);
	if(session == null) {
		session = CDOSessionUtil.openSession("asup-db1:2036", job.getSystem().getName());
		session.options().getNet4jProtocol().setTimeout(60000);
		sessions.put(job, session);
	}
	return session;
}
 
开发者ID:asupdev,项目名称:asup,代码行数:11,代码来源:CDOResourceProviderImpl.java

示例5: CDOResourceSetReaderImpl

import org.eclipse.emf.cdo.net4j.CDONet4jSession; //导入依赖的package包/类
protected CDOResourceSetReaderImpl(QJob job, Class<T> klass, CDONet4jSession session) {
	setJob(job);
	this.session = session;
	this.klass = klass;
	this.klassName = CDOResourceUtil.getModelName(klass);
	EPackage ePackage = CDOResourceUtil.getEPackage(session, klass);
	this.eClass = CDOResourceUtil.getEClass(ePackage, klass);

	this.resourceEvent = QOperatingSystemResourcesFactory.eINSTANCE.createResourceEvent();
	this.resourceEvent.setResource(this);
	this.objectLocker = new CDOObjectLockerImpl<T>();
}
 
开发者ID:asupdev,项目名称:asup,代码行数:13,代码来源:CDOResourceSetReaderImpl.java

示例6: getSession

import org.eclipse.emf.cdo.net4j.CDONet4jSession; //导入依赖的package包/类
private CDOSession getSession() {
	CDONet4jSession session = openSession("asup-db1:2036", "AS400A");
	session.options().getNet4jProtocol().setTimeout(60000);
	return session;
}
 
开发者ID:asupdev,项目名称:asup,代码行数:6,代码来源:TestCommands.java

示例7: openSession

import org.eclipse.emf.cdo.net4j.CDONet4jSession; //导入依赖的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

示例8: getSession

import org.eclipse.emf.cdo.net4j.CDONet4jSession; //导入依赖的package包/类
protected CDONet4jSession getSession() {
	return session;
}
 
开发者ID:asupdev,项目名称:asup,代码行数:4,代码来源:CDOResourceReaderImpl.java

示例9: CDOResourceProviderImpl

import org.eclipse.emf.cdo.net4j.CDONet4jSession; //导入依赖的package包/类
public CDOResourceProviderImpl() {
	this.sessions  = new HashMap<QContextID, CDONet4jSession>();
}
 
开发者ID:asupdev,项目名称:asup,代码行数:4,代码来源:CDOResourceProviderImpl.java

示例10: CDOResourceWriterImpl

import org.eclipse.emf.cdo.net4j.CDONet4jSession; //导入依赖的package包/类
protected CDOResourceWriterImpl(QJob job, Class<T> klass, CDONet4jSession session) {
	super(job, klass, session);
	this.klass = klass;
	resourceEvent.setResource(this);
}
 
开发者ID:asupdev,项目名称:asup,代码行数:6,代码来源:CDOResourceWriterImpl.java

示例11: getCDOSession

import org.eclipse.emf.cdo.net4j.CDONet4jSession; //导入依赖的package包/类
protected CDONet4jSession getCDOSession() {
	return session;
}
 
开发者ID:asupdev,项目名称:asup,代码行数:4,代码来源:CDOSystemManagerImpl.java


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