本文整理汇总了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;
}
示例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;
}
示例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>();
}
示例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;
}
示例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>();
}
示例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;
}
示例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;
}
示例8: getSession
import org.eclipse.emf.cdo.net4j.CDONet4jSession; //导入依赖的package包/类
protected CDONet4jSession getSession() {
return session;
}
示例9: CDOResourceProviderImpl
import org.eclipse.emf.cdo.net4j.CDONet4jSession; //导入依赖的package包/类
public CDOResourceProviderImpl() {
this.sessions = new HashMap<QContextID, CDONet4jSession>();
}
示例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);
}
示例11: getCDOSession
import org.eclipse.emf.cdo.net4j.CDONet4jSession; //导入依赖的package包/类
protected CDONet4jSession getCDOSession() {
return session;
}