Examples of PMException


Examples of org.apache.ws.jaxme.PMException

            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

Examples of org.apache.ws.jaxme.PMException

      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

Examples of org.apache.ws.jaxme.PMException

      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

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

   */
  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

Examples of org.apache.ws.jaxme.PMException

   */
  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

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

      TaminoDataSource tds;
      try {
        InitialContext ic = new InitialContext();
        tds = (TaminoDataSource) ic.lookup(jndiReference);
      } catch (NamingException e) {
        throw new PMException(e);
      }
      try {
      return tds.getConnection();
    } catch (TServerNotAvailableException e) {
      throw new PMException(e);
    }
    }
View Full Code Here

Examples of org.apache.ws.jaxme.PMException

  protected TConnection getTConnection() throws PMException {
    TConnectionFactory factory = TConnectionFactory.getInstance();
    try {
      return factory.newConnection(url, user, password);
    } catch (TServerNotAvailableException 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 (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
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.