Examples of PMException


Examples of org.apache.ws.jaxme.PMException

     Collection col = getXmlDbCollection();
     String id = getId(pElement);
     XMLResource resource = (XMLResource) col.createResource(id, XMLResource.RESOURCE_TYPE);
     col.removeResource(resource);
   } catch (XMLDBException e) {
     throw new PMException(e);
   } catch (IllegalAccessException e) {
     throw new PMException(e);
   } catch (InstantiationException e) {
     throw new PMException(e);
   } catch (InvocationTargetException e) {
     throw new PMException(e.getTargetException());
   } catch (NoSuchMethodException e) {
     throw new PMException(e);
    } catch (JAXBException e) {
      if (e instanceof PMException) {
        throw (PMException) e;
      } else {
        throw new PMException(e);
      }
   }
  }
View Full Code Here

Examples of org.apache.ws.jaxme.PMException

            delim = c;
            sb.append(c);
            break;
          case '?':
            if (!iter.hasNext()) {
              throw new PMException("Number of placeholder marks exceeds number of actual parameters");
            }
            PMParams.Param param = (PMParams.Param) iter.next();
            switch (param.getType()) {
              case Types.VARCHAR:
                sb.append('\'');
                sb.append(param.getValue());
                sb.append('\'');
                break;
              case Types.BIGINT:
              case Types.INTEGER:
              case Types.SMALLINT:
              case Types.TINYINT:
                sb.append(param.getValue());
                break;
              case Types.TIMESTAMP:
                sb.append('\'');
                sb.append(DatatypeConverter.printDateTime((Calendar) param.getValue()));
                sb.append('\'');
                break;
              case Types.DATE:
                sb.append('\'');
                sb.append(DatatypeConverter.printDate((Calendar) param.getValue()));
                sb.append('\'');
                break;
              case Types.TIME:
                sb.append('\'');
                sb.append(DatatypeConverter.printTime((Calendar) param.getValue()));
                sb.append('\'');
                break;
              default:
                throw new PMException("Invalid parameter type: " + param.getType());
            }
            break;
          default:
            sb.append(c);
            break;
        }
      }
    }
    if (inStr) {
      throw new PMException("Failed to parse query, expected trailing " + delim + " character: " + pQuery);
    }
    if (iter.hasNext()) {
      throw new PMException("Number of actual parameters exceeds number of placeholder marks.");
    }
    return sb.toString();
  }
View Full Code Here

Examples of org.apache.ws.jaxme.PMException

    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);
      }
    } catch (UnsupportedEncodingException e) {
        throw new PMException(e);
    }
  }
View Full Code Here

Examples of org.apache.ws.jaxme.PMException

  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 (UnsupportedEncodingException e) {
          throw new PMException(e);
      } catch (JAXBException e) {
          if (e instanceof PMException) {
              throw (PMException) e;
          } else {
              throw new PMException(e);
          }
      }
  }
View Full Code Here

Examples of org.apache.ws.jaxme.PMException

  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);
      }
    } catch (UnsupportedEncodingException e) {
        throw new PMException(e);
    }
  }
View Full Code Here

Examples of org.apache.ws.jaxme.PMException

                 iter.hasNext()) {
                TXMLObject object = iter.next();
                pObserver.notify(((TJMElement) object.getElement()).getJMElement());
            }
        } catch (TServerNotAvailableException e) {
            throw new PMException(e);
        } catch (NamingException e) {
            throw new PMException(e);
        } catch (TQueryException e) {
            throw new PMException(e);
        } catch (TNoSuchXMLObjectException e) {
            throw new PMException(e);
        } catch (TIteratorException e) {
            throw new PMException(e);
        } catch (JAXBException e) {
            throw new PMException(e);
        } finally {
            if (conn != null) { try { conn.close(); } catch (Throwable ignore) {} }
            setJAXBContext(null);
            DocumentDefaultHandler.setUnmarshallerHandler(null);
            ElementDefaultHandler.initData();
View Full Code Here

Examples of org.apache.ws.jaxme.PMException

            setJAXBContext(getManager().getFactory());
            conn = getTConnection();
            TXMLObjectAccessor accessor = conn.newXMLObjectAccessor(TAccessLocation.newInstance(collection), model);
            accessor.insert(getTXMLObject((InoObject) pElement));
        } catch (TServerNotAvailableException e) {
            throw new PMException(e);
        } catch (NamingException e) {
            throw new PMException(e);
        } catch (TInsertException e) {
            throw new PMException(e);
        } finally {
            if (conn != null) { try { conn.close(); } catch (Throwable ignore) {} }
            setJAXBContext(null);
        }
    }
View Full Code Here

Examples of org.apache.ws.jaxme.PMException

            setJAXBContext(getManager().getFactory());
            conn = getTConnection();
            TXMLObjectAccessor accessor = conn.newXMLObjectAccessor(TAccessLocation.newInstance(collection), model);
            accessor.update(getTXMLObject((InoObject) pElement));
        } catch (TServerNotAvailableException e) {
            throw new PMException(e);
        } catch (NamingException e) {
            throw new PMException(e);
        } catch (TUpdateException e) {
            throw new PMException(e);
        } finally {
            if (conn != null) { try { conn.close(); } catch (Throwable ignore) {} }
            setJAXBContext(null);
        }
    }
View Full Code Here

Examples of org.apache.ws.jaxme.PMException

            setJAXBContext(getManager().getFactory());
            conn = getTConnection();
            TXMLObjectAccessor accessor = conn.newXMLObjectAccessor(TAccessLocation.newInstance(collection), model);
            accessor.delete(getTXMLObject((InoObject) pElement));
        } catch (TServerNotAvailableException e) {
            throw new PMException(e);
        } catch (NamingException e) {
            throw new PMException(e);
        } catch (TDeleteException e) {
            throw new PMException(e);
        } finally {
            if (conn != null) { try { conn.close(); } catch (Throwable ignore) {} }
            setJAXBContext(null);
        }
    }
View Full Code Here

Examples of org.apache.ws.jaxme.PMException

              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
TOP
Copyright © 2018 www.massapi.com. 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.