Package org.apache.ws.jaxme

Examples of org.apache.ws.jaxme.PMException


   */
  public PM getJMPM(Class pElementInterface) throws PMException {
    JMManager manager = getManagerByInterface(pElementInterface);
    Class c = manager.getPmClass();
    if (c == null) {
      throw new PMException("No persistency class configured for " +
                             pElementInterface.getName());
    }
    try {
      PM pm = (PM) c.newInstance();
      pm.init(manager);
      return pm;
    } catch (Exception e) {
      e.printStackTrace(System.err);
      throw new PMException("Could not instantiate persistence manager class " +
                             c.getName(), e);
    }
  }
View Full Code Here


   */
  public PM getJMPM(QName pQName) throws PMException {
    JMManager manager = getManagerByQName(pQName);
    Class c = manager.getPmClass();
    if (c == null) {
      throw new PMException("No persistency class configured for " + pQName);
    }
    try {
      PM pm = (PM) c.newInstance();
      pm.init(manager);
      return pm;
    } catch (Exception e) {
      throw new PMException("Could not instantiate persistence manager class " +
                             c.getName(), e);
    }
  }
View Full Code Here

      handler.init((JMUnmarshaller) null);
      handler.setObserver(pObserver);
      irh.setResultHandler(handler);
      performQuery(q, irh);
    } catch (InstantiationException e) {
      throw new PMException(e);
    } catch (IllegalAccessException e) {
      throw new PMException(e);
    } catch (SAXException e) {
      throw new PMException(e);
    } catch (JAXBException e) {
      if (e instanceof PMException) {
        throw (PMException) e;
      } else {
        throw new PMException(e);
      }
    }
  }
View Full Code Here

    try {
      String query = getInsertQuery(pElement);
      java.util.List idList = new java.util.ArrayList();
      performQuery(query, idList);
      if (idList.size() == 0) {
        throw new PMException("Query did not return an ino:id");
      }
    } catch (SAXException e) {
      throw new PMException(e);
    } catch (JAXBException e) {
      if (e instanceof PMException) {
        throw (PMException) e;
      } else {
        throw new PMException(e);
      }
    }
  }
View Full Code Here

  public void update(javax.xml.bind.Element pElement) throws PMException {
    try {
      String query = getUpdateQuery(pElement);
      performQuery(query, (java.util.List) null);
    } catch (SAXException e) {
      throw new PMException(e);
    } catch (JAXBException e) {
      if (e instanceof PMException) {
        throw (PMException) e;
      } else {
        throw new PMException(e);
      }
    }
  }
View Full Code Here

  public void delete(javax.xml.bind.Element pElement) throws PMException {
    try {
      String query = getDeleteQuery(pElement);
      performQuery(query, (java.util.List) null);
    } catch (NoSuchMethodException e) {
      throw new PMException(e);
    } catch (IllegalAccessException e) {
      throw new PMException(e);
    } catch (InvocationTargetException e) {
      throw new PMException(e.getTargetException());
    } catch (SAXException e) {
      throw new PMException(e);
    } catch (JAXBException e) {
      if (e instanceof PMException) {
        throw (PMException) e;
      } else {
        throw new PMException(e);
      }
    }
  }
View Full Code Here

              PMException {
    String getMethodName = getGetIdMethodName();
    Method m = pElement.getClass().getMethod(getMethodName, ZERO_CLASSES);
    Object o = m.invoke(pElement, ZERO_OBJECTS);
    if (o == null) {
      throw new PMException("The method " + getMethodName + " returned null, which is no valid ID.");
    }
    return o.toString();
  }
View Full Code Here

            r.getContentAsSAX(handler);
          }
        }
      }
    } catch (IllegalAccessException e) {
      throw new PMException(e);
    } catch (InstantiationException e) {
      throw new PMException(e);
    } catch (XMLDBException e) {
      throw new PMException(e);
    }
  }
View Full Code Here

      ContentHandler ch = resource.setContentAsSAX();
      Marshaller marshaller = getManager().getFactory().createMarshaller();
      marshaller.marshal(pElement, ch);
      col.storeResource(resource);
    } catch (XMLDBException e) {
      throw new PMException(e);
    } catch (IllegalAccessException e) {
      throw new PMException(e);
    } catch (InstantiationException e) {
      throw new PMException(e);
    } catch (NoSuchMethodException e) {
      throw new PMException(e);
    } catch (InvocationTargetException e) {
      throw new PMException(e.getTargetException());
    } catch (JAXBException e) {
      if (e instanceof PMException) {
        throw (PMException) e;
      } else {
        throw new PMException(e);
      }
    }
  }
View Full Code Here

      ContentHandler ch = resource.setContentAsSAX();
      Marshaller marshaller = getManager().getFactory().createMarshaller();
      marshaller.marshal(pElement, ch);
      col.storeResource(resource);
    } catch (XMLDBException e) {
      throw new PMException(e);
    } catch (IllegalAccessException e) {
      throw new PMException(e);
    } catch (InstantiationException e) {
      throw new PMException(e);
    } catch (NoSuchMethodException e) {
      throw new PMException(e);
    } catch (InvocationTargetException e) {
      throw new PMException(e.getTargetException());
    } catch (JAXBException e) {
      if (e instanceof PMException) {
        throw (PMException) e;
      } else {
        throw new PMException(e);
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.ws.jaxme.PMException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.