當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。