xmlBlaster 2.1.0 API

org.xmlBlaster.engine.queuemsg
Class ServerEntryFactory

java.lang.Object
  extended by org.xmlBlaster.engine.queuemsg.ServerEntryFactory
All Implemented Interfaces:
I_EntryFactory

public class ServerEntryFactory
extends java.lang.Object
implements I_EntryFactory

The implementation of the interface which can be used to convert an object which implements the interface I_Entry to an 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

Field Summary
static java.lang.String ENTRY_TYPE_DUMMY
           
static java.lang.String ENTRY_TYPE_HISTORY_REF
           
static java.lang.String ENTRY_TYPE_MSG_RAW
           
static java.lang.String ENTRY_TYPE_MSG_SERIAL
           
static java.lang.String ENTRY_TYPE_MSG_XML
           
static java.lang.String ENTRY_TYPE_SESSION
           
static java.lang.String ENTRY_TYPE_SUBSCRIBE
           
static java.lang.String ENTRY_TYPE_TOPIC_SERIAL
           
static java.lang.String ENTRY_TYPE_TOPIC_XML
           
static java.lang.String ENTRY_TYPE_UPDATE_REF
           
private  ServerScope glob
           
private static java.util.logging.Logger log
           
private static java.lang.String ME
           
 
Constructor Summary
ServerEntryFactory()
           
 
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
private  java.util.Map<java.lang.String,java.lang.String> getCSV(java.lang.String csv)
           
 java.lang.Object getProperties()
          Access the current Parser configuration
private  StorageId getStorageId(XBStore store)
           
 void initialize(Global glob)
          Is called after the instance is created.
static void main(java.lang.String[] args)
          Measure performance for XML-ASCII versus java.io.Serializable persistence.
 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).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ME

private static final java.lang.String ME
See Also:
Constant Field Values

glob

private ServerScope glob

log

private static java.util.logging.Logger log

ENTRY_TYPE_MSG_SERIAL

public static final java.lang.String ENTRY_TYPE_MSG_SERIAL
See Also:
Constant Field Values

ENTRY_TYPE_MSG_XML

public static final java.lang.String ENTRY_TYPE_MSG_XML
See Also:
Constant Field Values

ENTRY_TYPE_MSG_RAW

public static final java.lang.String ENTRY_TYPE_MSG_RAW
See Also:
Constant Field Values

ENTRY_TYPE_UPDATE_REF

public static final java.lang.String ENTRY_TYPE_UPDATE_REF
See Also:
Constant Field Values

ENTRY_TYPE_HISTORY_REF

public static final java.lang.String ENTRY_TYPE_HISTORY_REF
See Also:
Constant Field Values

ENTRY_TYPE_TOPIC_SERIAL

public static final java.lang.String ENTRY_TYPE_TOPIC_SERIAL
See Also:
Constant Field Values

ENTRY_TYPE_TOPIC_XML

public static final java.lang.String ENTRY_TYPE_TOPIC_XML
See Also:
Constant Field Values

ENTRY_TYPE_SESSION

public static final java.lang.String ENTRY_TYPE_SESSION
See Also:
Constant Field Values

ENTRY_TYPE_SUBSCRIBE

public static final java.lang.String ENTRY_TYPE_SUBSCRIBE
See Also:
Constant Field Values

ENTRY_TYPE_DUMMY

public static final java.lang.String ENTRY_TYPE_DUMMY
See Also:
Constant Field Values
Constructor Detail

ServerEntryFactory

public ServerEntryFactory()
Method Detail

toBlob

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

Specified by:
toBlob in interface I_EntryFactory
Throws:
XmlBlasterException

createEntry

public 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)

Specified by:
createEntry in interface I_EntryFactory
Parameters:
type - see ENTRY_TYPE_MSG etc.
priority - The priority of the entry (the queues first sort criteria)
timestamp - The queues second sort criteria
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
storageId - A unique identifier of the queue
Throws:
XmlBlasterException

initialize

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

Specified by:
initialize in interface I_EntryFactory
Parameters:
name - A name identifying this plugin.

setProperties

public 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

Specified by:
setProperties in interface I_EntryFactory

getProperties

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

Specified by:
getProperties in interface I_EntryFactory

main

public static void main(java.lang.String[] args)
Measure performance for XML-ASCII versus java.io.Serializable persistence.
 java org.xmlBlaster.engine.queuemsg.ServerEntryFactory
 


getCSV

private java.util.Map<java.lang.String,java.lang.String> getCSV(java.lang.String csv)

getStorageId

private StorageId getStorageId(XBStore store)

createEntry

public I_Entry createEntry(XBStore store,
                           XBMeat meat,
                           XBRef ref)
                    throws XmlBlasterException
Description copied from interface: I_EntryFactory
Added for 2008 Queues

Specified by:
createEntry in interface I_EntryFactory
meat - The meat of the message (could be null if a reference)
ref - The reference of the message (should never be null)
Returns:
the newly created I_Entry
Throws:
XmlBlasterException

xmlBlaster 2.1.0 API

Copyright © 1999-2011 The xmlBlaster.org contributers.