Examples of Serializer


Examples of org.axonframework.serializer.Serializer

        // we want to delete the directory that will store our events
        final File eventsDir = new File(System.getProperty("java.io.tmpdir"), "Events");
        FileUtils.deleteDirectory(eventsDir);

        // we create a serializer, so we can ensure the event store and the upcasters use the same configuration
        Serializer serializer = new XStreamSerializer();
        // initialize a FileSystem Event Store
        FileSystemEventStore eventStore = new FileSystemEventStore(serializer, new SimpleEventFileResolver(eventsDir));
        // initialize the upcaster chain with our upcaster
        eventStore.setUpcasterChain(new LazyUpcasterChain(serializer,
                                                          Collections.<Upcaster>singletonList(new ToDoItemUpcaster())));
View Full Code Here

Examples of org.eclipse.persistence.sessions.serializers.Serializer

            logDebugMessage(message);
        }

        Object object = null;
        try {
            Serializer serializer = this.rcm.getSerializer();
            if (serializer != null) {
                object = serializer.deserialize(message.getBuffer(), (AbstractSession)this.rcm.getCommandProcessor());
            } else {
                object = message.getObject();           
            }
        } catch (Exception exception) {
            failDeserializeMessage(null, exception);
View Full Code Here

Examples of org.exist.storage.serializers.Serializer

                            }
                        }
                        else
                        {
                            //xml
                            Serializer serializer = context.getBroker().getSerializer();
                            serializer.setUser(context.getUser());
                            serializer.setProperty("omit-xml-declaration", "no");
                            getDynamicSerializerOptions(serializer);
                            value = serializer.serialize((NodeValue) content).getBytes();
                        }
                    }

                    if (entry instanceof ZipEntry &&
                        "store".equals(element.getAttribute("method"))) {
View Full Code Here

Examples of org.exolab.castor.xml.Serializer

     * @throws IOException in case taht wrapping the Writer fails
    **/
    public SchemaWriter(final Writer writer)
    throws IOException {
        this();
        Serializer serializer = _schemaContext.getSerializer();

        if (serializer == null) {
            throw new IOException("Unable to obtain serailizer");
        }

        serializer.setOutputCharStream(writer);

        DocumentHandler handler = serializer.asDocumentHandler();

        if (handler == null) {
            String err = "The following serializer is not SAX capable: ";
            err += serializer.getClass().getName();
            err += "; cannot proceed.";
            throw new IOException(err);
        }

        _handler = handler;
View Full Code Here

Examples of org.hibernate.search.indexes.serialization.codex.spi.Serializer

  /**
   * Convert a List of LuceneWork into a byte[]
   */
  @Override
  public byte[] toSerializedModel(List<LuceneWork> works) {
    Serializer serializer = provider.getSerializer();
    serializer.luceneWorks( works );

    for (LuceneWork work : works) {
      if (work instanceof OptimizeLuceneWork) {
        serializer.addOptimizeAll();
      }
      else if (work instanceof PurgeAllLuceneWork) {
        serializer.addPurgeAll( work.getEntityClass().getName() );
      }
      else if (work instanceof DeleteLuceneWork) {
        serializer.addDelete( work.getEntityClass().getName(), toByteArray( work.getId() ) );
      }
      else if (work instanceof AddLuceneWork ) {
        buildDocument( work.getDocument(), serializer );
        serializer.addAdd( work.getEntityClass().getName(), toByteArray( work.getId() ), work.getFieldToAnalyzerMap() );
      }
      else if (work instanceof UpdateLuceneWork ) {
        buildDocument( work.getDocument(), serializer );
        serializer.addUpdate( work.getEntityClass().getName(), toByteArray( work.getId() ), work.getFieldToAnalyzerMap() );
      }
    }
    return serializer.serialize();
  }
View Full Code Here

Examples of org.hibernate.search.indexes.serialization.spi.Serializer

   * Convert a List of LuceneWork into a byte[]
   */
  @Override
  public byte[] toSerializedModel(List<LuceneWork> works) {
    try {
      Serializer serializer = provider.getSerializer();
      serializer.luceneWorks( works );

      for (LuceneWork work : works) {
        if (work instanceof OptimizeLuceneWork) {
          serializer.addOptimizeAll();
        }
        else if (work instanceof PurgeAllLuceneWork) {
          serializer.addPurgeAll( work.getEntityClass().getName() );
        }
        else if (work instanceof DeleteLuceneWork) {
          processId(work, serializer);
          serializer.addDelete( work.getEntityClass().getName() );
        }
        else if (work instanceof AddLuceneWork ) {
          buildDocument( work.getDocument(), serializer );
          processId(work, serializer);
          serializer.addAdd( work.getEntityClass().getName(),  work.getFieldToAnalyzerMap() );
        }
        else if (work instanceof UpdateLuceneWork ) {
          buildDocument( work.getDocument(), serializer );
          processId(work, serializer);
          serializer.addUpdate( work.getEntityClass().getName(), work.getFieldToAnalyzerMap() );
        }
      }
      return serializer.serialize();
    }
    catch ( RuntimeException e ) {
      if ( e instanceof SearchException ) {
        throw e;
      }
View Full Code Here

Examples of org.htmlcleaner.Serializer

    // Write the resource content to disk. This step is needed, as the preview
    // generator can only handle files.
    try {
      xhtmlFile = File.createTempFile("xhtml", ".xml");
      Serializer xhtmlSerializer = new SimpleXmlSerializer(xhtmlProperties);
      xhtmlSerializer.writeToFile(xhtmlNode, xhtmlFile.getAbsolutePath(), "UTF-8");
    } catch (IOException e) {
      logger.error("Error creating temporary copy of file content at " + xhtmlFile, e);
      FileUtils.deleteQuietly(xhtmlFile);
      throw e;
    } finally {
View Full Code Here

Examples of org.jasig.portal.serialize.Serializer

            of.setDoctype(WEB_PORTLET_PUBLIC_ID, WEB_PORTLET_DTD);

            OutputStream outputStream = new FileOutputStream(webAppsDir + webModule + File.separator + "WEB-INF" + File.separator + "web.xml");
            Writer writer = new OutputStreamWriter(outputStream, "utf-8");

            Serializer serializer = new XMLSerializer(writer, of);
            try {
                WebApplicationMarshaller wam = new WebApplicationMarshaller();
                wam.init(webApplicationDefinition, serializer);
                wam.marshall();
            } catch (Exception e) {
View Full Code Here

Examples of org.jboss.dna.connector.store.jpa.util.Serializer

        this.nameOfDefaultWorkspace = nameOfDefaultWorkspace;
        this.creatingWorkspacesAllowed = creatingWorkspacesAllowed;
        this.largeValueMinimumSizeInBytes = largeValueMinimumSizeInBytes;
        this.compressData = compressData;
        this.enforceReferentialIntegrity = enforceReferentialIntegrity;
        this.serializer = new Serializer(context, true);
        this.logger = getExecutionContext().getLogger(getClass());
        this.cache = new RequestProcessorCache(this.pathFactory);
        this.predefinedWorkspaceNames = predefinedWorkspaceNames;

        // Start the transaction ...
View Full Code Here

Examples of org.jboss.errai.reflections.serializers.Serializer

        FilterBuilder filter = FilterBuilder.parse(includeExclude);

        configurationBuilder.filterInputsBy(filter);

        Serializer serializerInstance = null;
        if (serializer != null && serializer.length() != 0) {
            try {
                serializerInstance = (Serializer) Class.forName(serializer).newInstance();
                configurationBuilder.setSerializer(serializerInstance);
            } catch (Exception ex) {
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.