/** * INTERNAL: Return the EclipseLink session used to marshal. */ public List getSessions() { return getXMLContextState().getSessions(); }
/** * INTERNAL: Return the EclipseLink session used to marshal. */ public List getSessions() { return getXMLContextState().getSessions(); }
/** * Returns descriptors from all sessions. * * @return descriptors from all sessions */ public List<Descriptor> getDescriptors() { List<Descriptor> descriptors = new ArrayList<Descriptor>(); List<Session> sessions = getSessions(); for (Session session : sessions) { List<Descriptor> orderedDescriptors = (List<Descriptor>) (List) session.getProject().getOrderedDescriptors(); for (Descriptor xDesc : orderedDescriptors) { descriptors.add(xDesc); } } return descriptors; }
/** * Returns descriptors from all sessions. * * @return descriptors from all sessions */ public List<Descriptor> getDescriptors() { List<Descriptor> descriptors = new ArrayList<Descriptor>(); List<Session> sessions = getSessions(); for (Session session : sessions) { List<Descriptor> orderedDescriptors = (List<Descriptor>) (List) session.getProject().getOrderedDescriptors(); for (Descriptor xDesc : orderedDescriptors) { descriptors.add(xDesc); } } return descriptors; }
private void initializeSchemas() { if (!schemasAreInitialized) { HashSet schemas = new HashSet(); Iterator xmlDescriptors; XMLDescriptor xmlDescriptor; XMLSchemaReference xmlSchemaReference; int numberOfSessions = ((XMLContext) context).getSessions().size(); for (int x = 0; x < numberOfSessions; x++) { xmlDescriptors = ((CoreSession)context.getSessions().get(x)).getDescriptors().values().iterator(); URL schemaURL; while (xmlDescriptors.hasNext()) { xmlDescriptor = (XMLDescriptor)xmlDescriptors.next(); xmlSchemaReference = xmlDescriptor.getSchemaReference(); if (null != xmlSchemaReference) { schemaURL = xmlSchemaReference.getURL(); if (null != schemaURL) { schemas.add(schemaURL.toString()); } } } } schemas.remove(null); platformUnmarshaller.setSchemas(schemas.toArray()); schemasAreInitialized = true; } }
private void initializeSchemas() { if (!schemasAreInitialized) { HashSet schemas = new HashSet(); Iterator xmlDescriptors; XMLDescriptor xmlDescriptor; XMLSchemaReference xmlSchemaReference; int numberOfSessions = ((XMLContext) context).getSessions().size(); for (int x = 0; x < numberOfSessions; x++) { xmlDescriptors = ((CoreSession)context.getSessions().get(x)).getDescriptors().values().iterator(); URL schemaURL; while (xmlDescriptors.hasNext()) { xmlDescriptor = (XMLDescriptor)xmlDescriptors.next(); xmlSchemaReference = xmlDescriptor.getSchemaReference(); if (null != xmlSchemaReference) { schemaURL = xmlSchemaReference.getURL(); if (null != schemaURL) { schemas.add(schemaURL.toString()); } } } } schemas.remove(null); platformUnmarshaller.setSchemas(schemas.toArray()); schemasAreInitialized = true; } }
private void initializeSchemas() { if (!schemasAreInitialized) { HashSet schemas = new HashSet(); Iterator xmlDescriptors; XMLDescriptor xmlDescriptor; XMLSchemaReference xmlSchemaReference; int numberOfSessions = xmlContext.getSessions().size(); for (int x = 0; x < numberOfSessions; x++) { xmlDescriptors = ((DatabaseSession)xmlContext.getSessions().get(x)).getDescriptors().values().iterator(); URL schemaURL; while (xmlDescriptors.hasNext()) { xmlDescriptor = (XMLDescriptor)xmlDescriptors.next(); xmlSchemaReference = xmlDescriptor.getSchemaReference(); if (null != xmlSchemaReference) { schemaURL = xmlSchemaReference.getURL(); if (null != schemaURL) { schemas.add(schemaURL.toString()); } } } } schemas.remove(null); platformUnmarshaller.setSchemas(schemas.toArray()); schemasAreInitialized = true; } }
/** * Gets the jAXB descriptor for class. * * @param clazz the clazz * @return the jAXB descriptor for class */ @SuppressWarnings("rawtypes") public ClassDescriptor getJAXBDescriptorForClass(Class clazz) { ClassDescriptor descriptor = null; for (Object ajaxBSession : getJAXBContext().getXMLContext().getSessions()) { descriptor = ((Session) ajaxBSession).getClassDescriptor(clazz); if (descriptor != null) { break; } } return descriptor; }
/** * Gets the jAXB descriptor for class. * * @param clazz the clazz * @return the jAXB descriptor for class */ @SuppressWarnings("rawtypes") public ClassDescriptor getJAXBDescriptorForClass(Class clazz) { ClassDescriptor descriptor = null; for (Object ajaxBSession : getJAXBContext().getXMLContext().getSessions()) { descriptor = ((Session) ajaxBSession).getClassDescriptor(clazz); if (descriptor != null) { break; } } return descriptor; }
@Override protected JAXBContextState createContextState() throws JAXBException { DynamicJAXBContextState state = new DynamicJAXBContextState((DynamicClassLoader) classLoader); StringTokenizer st = new StringTokenizer(sessions, ":"); ArrayList<Project> dynamicProjects = new ArrayList<Project>(st.countTokens()); XMLSessionConfigLoader loader = new XMLSessionConfigLoader(); while (st.hasMoreTokens()) { DatabaseSession dbSession = (DatabaseSession) SessionManager.getManager().getSession(loader, st.nextToken(), classLoader, false, true); Project p = DynamicTypeBuilder.loadDynamicProject(dbSession.getProject(), null, (DynamicClassLoader) classLoader); dynamicProjects.add(p); } XMLContext xmlContext = new XMLContext(dynamicProjects); state.setXMLContext(xmlContext); List<Session> sessions = (List<Session>) xmlContext.getSessions(); for (Object session : sessions) { state.getHelpers().add(new DynamicHelper((DatabaseSession) session)); } return state; } }
@Override protected JAXBContextState createContextState() throws JAXBException { DynamicJAXBContextState state = new DynamicJAXBContextState((DynamicClassLoader) classLoader); StringTokenizer st = new StringTokenizer(sessions, ":"); ArrayList<Project> dynamicProjects = new ArrayList<Project>(st.countTokens()); XMLSessionConfigLoader loader = new XMLSessionConfigLoader(); while (st.hasMoreTokens()) { DatabaseSession dbSession = (DatabaseSession) SessionManager.getManager().getSession(loader, st.nextToken(), classLoader, false, true); Project p = DynamicTypeBuilder.loadDynamicProject(dbSession.getProject(), null, (DynamicClassLoader) classLoader); dynamicProjects.add(p); } XMLContext xmlContext = new XMLContext(dynamicProjects); state.setXMLContext(xmlContext); List<Session> sessions = (List<Session>) xmlContext.getSessions(); for (Object session : sessions) { state.getHelpers().add(new DynamicHelper((DatabaseSession) session)); } return state; } }
/** * Lookup the descriptor for the given entity name. * This method will look first in the EntityManagerFactory wrapped by this persistence context * and return that descriptor. If one does not exist, it search the JAXBContext and return * a descriptor from there. * @param entityName * @return */ public ClassDescriptor getDescriptor(String entityName) { DatabaseSession session = getServerSession(); ClassDescriptor descriptor = session.getDescriptorForAlias(entityName); if (descriptor == null) { for (Object ajaxBSession : getJAXBContext().getXMLContext().getSessions()) { descriptor = ((Session) ajaxBSession).getClassDescriptorForAlias(entityName); if (descriptor != null) { break; } } } return descriptor; }
/** * Lookup the descriptor for the given entity name. * This method will look first in the EntityManagerFactory wrapped by this persistence context * and return that descriptor. If one does not exist, it search the JAXBContext and return * a descriptor from there. * @param entityName * @return */ public ClassDescriptor getDescriptor(String entityName) { DatabaseSession session = getServerSession(); ClassDescriptor descriptor = session.getDescriptorForAlias(entityName); if (descriptor == null) { for (Object ajaxBSession : getJAXBContext().getXMLContext().getSessions()) { descriptor = ((Session) ajaxBSession).getClassDescriptorForAlias(entityName); if (descriptor != null) { break; } } } return descriptor; }
state.setXMLContext(ctx); List<Session> sessions = (List<Session>) ctx.getSessions(); for (Object session : sessions) { state.getHelpers().add(new DynamicHelper((DatabaseSession) session));
state.setXMLContext(ctx); List<Session> sessions = (List<Session>) ctx.getSessions(); for (Object session : sessions) { state.getHelpers().add(new DynamicHelper((DatabaseSession) session));
state.setXMLContext(ctx); List<Session> sessions = (List<Session>) ctx.getSessions(); for (Object session : sessions) { state.getHelpers().add(new DynamicHelper((DatabaseSession) session));
state.setXMLContext(ctx); List<Session> sessions = (List<Session>) ctx.getSessions(); for (Object session : sessions) { state.getHelpers().add(new DynamicHelper((DatabaseSession) session));