本文整理匯總了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;
}