xmlBlaster 2.1.0 API

org.xmlBlaster.util.queue
Interface I_EntryFactory

All Known Implementing Classes:
ClientEntryFactory, ServerEntryFactory

public interface I_EntryFactory

The Interface which can be used to convert an object which implements the interface I_Entry to a byte[] object and back. This is useful for example if you want to store such entries in persistent storage like a database or a file system. It might however be used even for other purposes.

Author:
michele@laghi.eu, xmlBlaster@marcelruff.info

Method Summary
 I_Entry createEntry(int priority, long timestamp, java.lang.String type, boolean persistent, long sizeInBytes, java.io.InputStream is, StorageId storageId)
          Parses back the raw data to a I_Entry (deserializing)
 I_Entry createEntry(XBStore store, XBMeat meat, XBRef ref)
          Added for 2008 Queues
 java.lang.Object getProperties()
          Access the current Parser configuration
 void initialize(Global glob)
          Is called after the instance is created.
 void setProperties(java.lang.Object userData)
          Allows to overwrite properties which where passed on initialize() The properties which support hot configuration are depending on the used implementation
 byte[] toBlob(I_Entry entry)
          Parses the specified entry to a byte array (serializing).
 

Method Detail

toBlob

byte[] toBlob(I_Entry entry)
              throws XmlBlasterException
Parses the specified entry to a byte array (serializing).

Throws:
XmlBlasterException

createEntry

I_Entry createEntry(int priority,
                    long timestamp,
                    java.lang.String type,
                    boolean persistent,
                    long sizeInBytes,
                    java.io.InputStream is,
                    StorageId storageId)
                    throws XmlBlasterException
Parses back the raw data to a I_Entry (deserializing)

Parameters:
priority - The priority of the entry (the queues first sort criteria)
timestamp - The queues second sort criteria
type - The type of the entry, used to know how to parse it
persistent - true: the entry is persistent, false: the entry is swapped from cache (no more RAM memory)
sizeInBytes - The approximate, immutable size that the entry occupies in RAM, this can be totally different to the size the entry occupies on storage
obj - The serialized data (formatted as given by 'type')
storageId - A unique identifier of the queue
Throws:
XmlBlasterException

initialize

void initialize(Global glob)
Is called after the instance is created.


setProperties

void setProperties(java.lang.Object userData)
Allows to overwrite properties which where passed on initialize() The properties which support hot configuration are depending on the used implementation


getProperties

java.lang.Object getProperties()
Access the current Parser configuration


createEntry

I_Entry createEntry(XBStore store,
                    XBMeat meat,
                    XBRef ref)
                    throws XmlBlasterException
Added for 2008 Queues

Parameters:
meat - The meat of the message (could be null if a reference)
ref - The reference of the message (should never be null)
storageId - the storageId
Returns:
the newly created I_Entry
Throws:
XmlBlasterException

xmlBlaster 2.1.0 API

Copyright © 1999-2011 The xmlBlaster.org contributers.