gpt4 book ai didi

org.eclipse.persistence.oxm.XMLLogin.()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-18 17:34:40 27 4
gpt4 key购买 nike

本文整理了Java中org.eclipse.persistence.oxm.XMLLogin.<init>()方法的一些代码示例,展示了XMLLogin.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLLogin.<init>()方法的具体详情如下:
包路径:org.eclipse.persistence.oxm.XMLLogin
类名称:XMLLogin
方法名:<init>

XMLLogin.<init>介绍

[英]Default constructor. Sets the platform to be the default platform which is org.eclipse.persistence.oxm.platform.SAXPlatform.
[中]默认构造函数。将平台设置为默认平台,即组织。日食坚持不懈oxm。站台萨克斯平台。

代码示例

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * INTERNAL:
 * Wrapped by the getLogin() call, therefore, config can't be null at this
 * point.
 */
protected Login buildXMLLoginConfig(XMLLoginConfig xmlLoginConfig) {
  XMLLogin xmlLogin = new XMLLogin();
  // Process the common elements in LoginConfig
  processLoginConfig(xmlLoginConfig, xmlLogin);
  // Finally, return the newly created XMLLogin
  return xmlLogin;
}

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

/**
 * INTERNAL:
 * Wrapped by the getLogin() call, therefore, config can't be null at this
 * point.
 */
protected Login buildXMLLoginConfig(XMLLoginConfig xmlLoginConfig) {
  XMLLogin xmlLogin = new XMLLogin();
  // Process the common elements in LoginConfig
  processLoginConfig(xmlLoginConfig, xmlLogin);
  // Finally, return the newly created XMLLogin
  return xmlLogin;
}

代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * INTERNAL:
 * Wrapped by the getLogin() call, therefore, config can't be null at this
 * point.
 */
protected Login buildXMLLoginConfig(XMLLoginConfig xmlLoginConfig) {
  XMLLogin xmlLogin = new XMLLogin();
  // Process the common elements in LoginConfig
  processLoginConfig(xmlLoginConfig, xmlLogin);
  // Finally, return the newly created XMLLogin
  return xmlLogin;
}

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

public void applyLogin() {
  XMLLogin login = new XMLLogin();
  login.setPlatform(new DOMPlatform());
  setDatasourceLogin(login);
}

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.dbws

@Override
public void applyLogin() {
  XMLLogin login = new XMLLogin();
  login.setPlatform(new DOMPlatform());
  setDatasourceLogin(login);
}

代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

public XMLContext(Collection projects, ClassLoader classLoader) {
  Iterator iterator = projects.iterator();
  sessions = new ArrayList(projects.size());
  descriptorsByQName = new HashMap();
  descriptorsByGlobalType = new HashMap();
  while(iterator.hasNext()) {
    Project project = (Project)iterator.next();
    if ((project.getDatasourceLogin() == null) || !(project.getDatasourceLogin().getDatasourcePlatform() instanceof XMLPlatform)) {
      XMLPlatform platform = new SAXPlatform();
      platform.getConversionManager().setLoader(classLoader);
      project.setLogin(new XMLLogin(platform));
    }
    DatabaseSession session = project.createDatabaseSession();
    // turn logging for this session off and leave the global session up
    // Note: setting level to SEVERE or WARNING will printout stacktraces for expected exceptions
    session.setLogLevel(SessionLog.OFF);
    // dont turn off global static logging
    //AbstractSessionLog.getLog().log(AbstractSessionLog.INFO, "ox_turn_global_logging_off", getClass());        			
    //AbstractSessionLog.getLog().setLevel(AbstractSessionLog.OFF);
    setupDocumentPreservationPolicy(session);
    session.login();
    sessions.add(session);
    storeXMLDescriptorsByQName(session);
  }
}

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core

@Override
protected void preLogin(Project project, ClassLoader classLoader) {
  if ((project.getDatasourceLogin() == null) || !(project.getDatasourceLogin().getDatasourcePlatform() instanceof XMLPlatform)) {
    XMLPlatform platform = new SAXPlatform();
    platform.getConversionManager().setLoader(classLoader);
    project.setLogin(new XMLLogin(platform));
  }
}

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

@Override
protected void preLogin(Project project, ClassLoader classLoader) {
  if ((project.getDatasourceLogin() == null) || !(project.getDatasourceLogin().getDatasourcePlatform() instanceof XMLPlatform)) {
    XMLPlatform platform = new SAXPlatform();
    platform.getConversionManager().setLoader(classLoader);
    project.setLogin(new XMLLogin(platform));
  }
}

代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

XMLPlatform platform = new SAXPlatform();
platform.getConversionManager().setLoader(classLoader);
project.setLogin(new XMLLogin(platform));

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * INTERNAL: Add and initialize a new session to the list of sessions
 * associated with this XMLContext.
 */
private void addSession(DatabaseSession sessionToAdd) {
  if ((sessionToAdd.getDatasourceLogin() == null) || !(sessionToAdd.getDatasourceLogin().getDatasourcePlatform() instanceof XMLPlatform)) {
    XMLPlatform platform = new SAXPlatform();
    sessionToAdd.setLogin(new XMLLogin(platform));
  }
  DatabaseSession session = sessionToAdd.getProject().createDatabaseSession();
  if (sessionToAdd.getEventManager().hasListeners()) {
    List<SessionEventListener> listeners = sessionToAdd.getEventManager().getListeners();
    int listenersSize = listeners.size();
    for (int x = 0; x < listenersSize; x++) {
      session.getEventManager().addListener(listeners.get(x));
    }
  }
  session.setExceptionHandler(sessionToAdd.getExceptionHandler());
  session.setLogLevel(SessionLog.OFF);
  setupSession(session);
  if(null == sessions) {
    sessions = new ArrayList<DatabaseSession>();
  }
  if(null != this.session) {
    sessions.add(this.session);
  }
  sessions.add(session);
  storeDescriptorsByQName(session);
}

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

/**
 * INTERNAL: Add and initialize a new session to the list of sessions
 * associated with this XMLContext.
 */
private void addSession(DatabaseSession sessionToAdd) {
  if ((sessionToAdd.getDatasourceLogin() == null) || !(sessionToAdd.getDatasourceLogin().getDatasourcePlatform() instanceof XMLPlatform)) {
    XMLPlatform platform = new SAXPlatform();
    sessionToAdd.setLogin(new XMLLogin(platform));
  }
  DatabaseSession session = sessionToAdd.getProject().createDatabaseSession();
  if (sessionToAdd.getEventManager().hasListeners()) {
    List<SessionEventListener> listeners = sessionToAdd.getEventManager().getListeners();
    int listenersSize = listeners.size();
    for (int x = 0; x < listenersSize; x++) {
      session.getEventManager().addListener(listeners.get(x));
    }
  }
  session.setExceptionHandler(sessionToAdd.getExceptionHandler());
  session.setLogLevel(SessionLog.OFF);
  setupSession(session);
  if(null == sessions) {
    sessions = new ArrayList<DatabaseSession>();
  }
  if(null != this.session) {
    sessions.add(this.session);
  }
  sessions.add(session);
  storeDescriptorsByQName(session);
}

代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * INTERNAL: Add and initialize a new session to the list of sessions
 * associated with this XMLContext.
 */
public void addSession(DatabaseSession sessionToAdd) {
  if ((sessionToAdd.getDatasourceLogin() == null) || !(sessionToAdd.getDatasourceLogin().getDatasourcePlatform() instanceof XMLPlatform)) {
    XMLPlatform platform = new SAXPlatform();
    sessionToAdd.setLogin(new XMLLogin(platform));
  }
  DatabaseSession session = sessionToAdd.getProject().createDatabaseSession();
  if (sessionToAdd.getEventManager().hasListeners()) {
    List listeners = sessionToAdd.getEventManager().getListeners();
    int listenersSize = listeners.size();
    for (int x = 0; x < listenersSize; x++) {
      session.getEventManager().addListener((SessionEventListener) listeners.get(x));
    }
  }
  session.setExceptionHandler(sessionToAdd.getExceptionHandler());
  session.setLogLevel(SessionLog.OFF);
  this.setupDocumentPreservationPolicy(session);
  session.login();
  sessions.add(session);
  storeXMLDescriptorsByQName(session);
}

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core

private DatabaseSession buildSession(String sessionName, ClassLoader classLoader, XMLSessionConfigLoader sessionLoader) throws XMLMarshalException {
  DatabaseSession dbSession;
  if (classLoader != null) {
    dbSession = (DatabaseSession) SessionManager.getManager().getSession(sessionLoader, sessionName, classLoader, false, true);
  } else {
    dbSession = (DatabaseSession) SessionManager.getManager().getSession(sessionLoader, sessionName, PrivilegedAccessHelper.privilegedGetClassLoaderForClass(this.getClass()), false, false, false);
  }
  if ((dbSession.getDatasourceLogin() == null) || !(dbSession.getDatasourceLogin().getDatasourcePlatform() instanceof XMLPlatform)) {
    XMLPlatform platform = new SAXPlatform();
    dbSession.setLogin(new XMLLogin(platform));
  }
  DatabaseSession session = dbSession.getProject().createDatabaseSession();
  if (dbSession.getEventManager().hasListeners()) {
    List<SessionEventListener> listeners = dbSession.getEventManager().getListeners();
    int listenersSize = listeners.size();
    for (int x = 0; x < listenersSize; x++) {
      session.getEventManager().addListener(listeners.get(x));
    }
  }
  session.setExceptionHandler(dbSession.getExceptionHandler());
  session.setLogLevel(SessionLog.OFF);
  setupDocumentPreservationPolicy(session);
  session.login();
  return session;
}

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

private DatabaseSession buildSession(String sessionName, ClassLoader classLoader, XMLSessionConfigLoader sessionLoader) throws XMLMarshalException {
  DatabaseSession dbSession;
  if (classLoader != null) {
    dbSession = (DatabaseSession) SessionManager.getManager().getSession(sessionLoader, sessionName, classLoader, false, true);
  } else {
    dbSession = (DatabaseSession) SessionManager.getManager().getSession(sessionLoader, sessionName, PrivilegedAccessHelper.privilegedGetClassLoaderForClass(this.getClass()), false, false, false);
  }
  if ((dbSession.getDatasourceLogin() == null) || !(dbSession.getDatasourceLogin().getDatasourcePlatform() instanceof XMLPlatform)) {
    XMLPlatform platform = new SAXPlatform();
    dbSession.setLogin(new XMLLogin(platform));
  }
  DatabaseSession session = dbSession.getProject().createDatabaseSession();
  if (dbSession.getEventManager().hasListeners()) {
    List<SessionEventListener> listeners = dbSession.getEventManager().getListeners();
    int listenersSize = listeners.size();
    for (int x = 0; x < listenersSize; x++) {
      session.getEventManager().addListener(listeners.get(x));
    }
  }
  session.setExceptionHandler(dbSession.getExceptionHandler());
  session.setLogLevel(SessionLog.OFF);
  setupDocumentPreservationPolicy(session);
  session.login();
  return session;
}

代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

private DatabaseSession buildSession(String sessionName, ClassLoader classLoader, XMLSessionConfigLoader sessionLoader) throws XMLMarshalException {
  DatabaseSession dbSession;
  if (classLoader != null) {
    dbSession = (DatabaseSession) SessionManager.getManager().getSession(sessionLoader, sessionName, classLoader, false, true);
  } else {
    dbSession = (DatabaseSession) SessionManager.getManager().getSession(sessionLoader, sessionName, PrivilegedAccessHelper.privilegedGetClassLoaderForClass(this.getClass()), false, false, false);
  }
  if ((dbSession.getDatasourceLogin() == null) || !(dbSession.getDatasourceLogin().getDatasourcePlatform() instanceof XMLPlatform)) {
    XMLPlatform platform = new SAXPlatform();
    dbSession.setLogin(new XMLLogin(platform));
  }
  DatabaseSession session = dbSession.getProject().createDatabaseSession();
  if (dbSession.getEventManager().hasListeners()) {
    List listeners = dbSession.getEventManager().getListeners();
    int listenersSize = listeners.size();
    for (int x = 0; x < listenersSize; x++) {
      session.getEventManager().addListener((SessionEventListener) listeners.get(x));
    }
  }
  session.setExceptionHandler(dbSession.getExceptionHandler());
  session.setLogLevel(SessionLog.OFF);
  setupDocumentPreservationPolicy(session);
  session.login();
  return session;
}

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * Read a project in the format of an ObjectPersistenceRuntimeXMLProject.
 * This could include a TopLink 11.1.1 project or a TopLink 10.1.3 project
 * @param document
 * @param classLoader
 * @param opmProject
 * @return
 */
public static Project readObjectPersistenceRuntimeFormat(Document document, ClassLoader classLoader, Project opmProject){
  XMLLogin xmlLogin = new XMLLogin();
  xmlLogin.setDatasourcePlatform(new org.eclipse.persistence.oxm.platform.DOMPlatform());
  opmProject.setDatasourceLogin(xmlLogin);
  // Create the OPM project.
  if (classLoader != null) {
    xmlLogin.getDatasourcePlatform().getConversionManager().setLoader(classLoader);
  }
  // Marshal OPM format.
  XMLContext context = new XMLContext(opmProject);
  context.getSession(Project.class).getEventManager().addListener(new MissingDescriptorListener());
  XMLUnmarshaller unmarshaller = context.createUnmarshaller();
  Project project = (Project)unmarshaller.unmarshal(document);
  // Set the project's class loader.
  if ((classLoader != null) && (project.getDatasourceLogin() != null)) {
    project.getDatasourceLogin().getDatasourcePlatform().getConversionManager().setLoader(classLoader);
  }
  return project;
}

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

/**
 * Read a project in the format of an ObjectPersistenceRuntimeXMLProject.
 * This could include a TopLink 11.1.1 project or a TopLink 10.1.3 project
 * @param document
 * @param classLoader
 * @param opmProject
 * @return
 */
public static Project readObjectPersistenceRuntimeFormat(Document document, ClassLoader classLoader, Project opmProject){
  XMLLogin xmlLogin = new XMLLogin();
  xmlLogin.setDatasourcePlatform(new org.eclipse.persistence.oxm.platform.DOMPlatform());
  opmProject.setDatasourceLogin(xmlLogin);
  // Create the OPM project.
  if (classLoader != null) {
    xmlLogin.getDatasourcePlatform().getConversionManager().setLoader(classLoader);
  }
  // Marshal OPM format.
  XMLContext context = new XMLContext(opmProject);
  context.getSession(Project.class).getEventManager().addListener(new MissingDescriptorListener());
  XMLUnmarshaller unmarshaller = context.createUnmarshaller();
  Project project = (Project)unmarshaller.unmarshal(document);
  // Set the project's class loader.
  if ((classLoader != null) && (project.getDatasourceLogin() != null)) {
    project.getDatasourceLogin().getDatasourcePlatform().getConversionManager().setLoader(classLoader);
  }
  return project;
}

代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * Read a project in the format of an ObjectPersistenceRuntimeXMLProject.
 * This could include a TopLink 11.1.1 project or a TopLink 10.1.3 project
 * @param document
 * @param classLoader
 * @param opmProject
 * @return
 */
public static Project readObjectPersistenceRuntimeFormat(Document document, ClassLoader classLoader, Project opmProject){
  XMLLogin xmlLogin = new XMLLogin();
  xmlLogin.setDatasourcePlatform(new org.eclipse.persistence.oxm.platform.DOMPlatform());
  opmProject.setDatasourceLogin(xmlLogin);
  // Create the OPM project.
  if (classLoader != null) {
    xmlLogin.getDatasourcePlatform().getConversionManager().setLoader(classLoader);
  }
  // Marshal OPM format.
  XMLContext context = new XMLContext(opmProject);
  context.getSession(Project.class).getEventManager().addListener(new MissingDescriptorListener());
  XMLUnmarshaller unmarshaller = context.createUnmarshaller();
  Project project = (Project)unmarshaller.unmarshal(document);
  // Set the project's class loader.
  if ((classLoader != null) && (project.getDatasourceLogin() != null)) {
    project.getDatasourceLogin().getDatasourcePlatform().getConversionManager().setLoader(classLoader);
  }
  return project;
}

代码示例来源:origin: com.haulmont.thirdparty/eclipselink

public Project getTopLinkProject() {
  if (topLinkProject == null) {
    topLinkProject = new Project();
    XMLLogin xmlLogin = new XMLLogin();
    xmlLogin.setEqualNamespaceResolvers(false);
    topLinkProject.setDatasourceLogin(xmlLogin);

代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.sdo

public Project getTopLinkProject() {
  if (topLinkProject == null) {
    topLinkProject = new Project();
    XMLLogin xmlLogin = new XMLLogin();
    xmlLogin.setEqualNamespaceResolvers(false);
    topLinkProject.setDatasourceLogin(xmlLogin);

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com