Package org.gatein.management.api.binding

Examples of org.gatein.management.api.binding.BindingException


                marshalPage(writer, page);
            }

            writer.finish();
        } catch (StaxNavException e) {
            throw new BindingException(e);
        } catch (XMLStreamException e) {
            throw new BindingException(e);
        }
    }
View Full Code Here


                return pageSet;
            } else {
                throw unknownElement(navigator);
            }
        } catch (StaxNavException e) {
            throw new BindingException(e);
        } catch (XMLStreamException e) {
            throw new BindingException(e);
        }
    }
View Full Code Here

         {
            outputStream.close();
         }
         catch (IOException e)
         {
            throw new BindingException("Exception closing underlying stream.", e);
         }
      }
View Full Code Here

         file = File.createTempFile("gatein-export", ".zip");
         zos = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(file)));
      }
      catch (IOException e)
      {
         throw new BindingException("Could not create temp file for export.", e);
      }

      try
      {
         if (model.getTasks().isEmpty())
         {
            zos.putNextEntry(new ZipEntry(""));
         }
         else
         {
            for (ExportTask task : model.getTasks())
            {
               String entry = task.getEntry();
               zos.putNextEntry(new ZipEntry(entry));

               // Call export task responsible for writing the data.
               task.export(zos);

               zos.closeEntry();
            }
         }
         zos.flush();
         zos.finish();
      }
      catch (Throwable t)
      {
         throw new BindingException("Exception writing data to zip.", t);
      }
      finally
      {
         IOTools.safeClose(zos);
      }

      try
      {
         InputStream inputStream = new BufferedInputStream(new FileInputStream(file));
         IOTools.copy(inputStream, outputStream);
      }
      catch (FileNotFoundException e)
      {
         throw new BindingException("Could not read from temporary zip file " + file, e);
      }
      catch (IOException e)
      {
         throw new BindingException("IOException writing data to final output stream.", e);
      }
   }
View Full Code Here

         printWriter.write(new JSONObject(json.toString()).toString(3));
         printWriter.flush();
      }
      catch (JSONException e)
      {
         throw new BindingException("Could not marshal to JSON format", e);
      }
      finally
      {
         IOTools.safeClose(printWriter);
      }
View Full Code Here

      {
         IOTools.copy(inputStream, baos);
      }
      catch (IOException e)
      {
         throw new BindingException("Could not read input stream for marshalling.", e);
      }

      String jsonString = new String(baos.toByteArray());
      try
      {
         JSONObject json = new JSONObject(jsonString);
         json.toString(3);
         throw new BindingException("Marshaller does not support unmarshalling of json data.");
      }
      catch (JSONException e)
      {
         throw new BindingException("Could not parse json string:\n" + jsonString, e);
      }
   }
View Full Code Here

            throw unknownElement(navigator);
         }
      }
      catch (StaxNavException e)
      {
         throw new BindingException(e);
      }
      catch (XMLStreamException e)
      {
         throw new BindingException(e);
      }
   }
View Full Code Here

         StaxWriter<Element> writer = createWriter(Element.class, outputStream);
         marshalNavigation(writer, navigation);
      }
      catch (StaxNavException e)
      {
         throw new BindingException(e);
      }
      catch (XMLStreamException e)
      {
         throw new BindingException(e);
      }
   }
View Full Code Here

         StaxNavigator<Element> navigator = createNavigator(Element.class, Element.UNKNOWN, is);
         return unmarshalNavigation(navigator);
      }
      catch (StaxNavException e)
      {
         throw new BindingException(e);
      }
   }
View Full Code Here

         writer.finish();
      }
      catch (StaxNavException e)
      {
         throw new BindingException(e);
      }
      catch (XMLStreamException e)
      {
         throw new BindingException(e);
      }
   }
View Full Code Here

TOP

Related Classes of org.gatein.management.api.binding.BindingException

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.