alma::acs::entityutil::EntityDeserializer Class Reference

Collaboration diagram for alma::acs::entityutil::EntityDeserializer:
Collaboration graph
[legend]

List of all members.

Public Member Functions

Object deserializeEntity (String xmlString, Class entityClass) throws EntityException
Object deserializeEntity (XmlEntityStruct xes, Class entityClass) throws EntityException

Static Public Member Functions

static EntityDeserializer getEntityDeserializer (Logger logger)

Private Member Functions

 EntityDeserializer (Logger logger)
Object deserializeEntity (String xmlString, Class entityClass, String timestamp) throws EntityException

Private Attributes

Logger m_logger
EntityTFinder m_finder

Static Private Attributes

static EntityDeserializer s_entityDeserializer

Detailed Description

Helper class to convert serialized XML entities from the ALMA project data model (APDM) to their Java binding class representations.

Note that normally a Java component does not need to explicitly perform this conversion, since the Java container translates between the XML-string representation that goes over CORBA, and the binding class (tree) that the custom-generated component's Java interface uses as parameters or return value.

However, there is a case where a Java component should use the EntityDeserializer: Applications receiving XML data from the ALMA archive: the archive does currently not offer a type-safe interface for APDM entities. Use deserializeEntity(XmlEntityStruct, Class) to convert the XmlEntityStruct you get from the archive into a Java binding object tree whose root node is an instance of the specified Class.

Author:
hsommer May 6, 2003 5:31:57 PM

Constructor & Destructor Documentation

alma::acs::entityutil::EntityDeserializer::EntityDeserializer ( Logger  logger  )  [inline, private]
Parameters:
logger 

References m_finder, and m_logger.

Referenced by getEntityDeserializer().


Member Function Documentation

Object alma::acs::entityutil::EntityDeserializer::deserializeEntity ( XmlEntityStruct  xes,
Class  entityClass 
) throws EntityException [inline]

Deserializes (parses) the entity xml contained in xes and instantiates the binding objects.

Parameters:
xes the struct used for CORBA transport of serialized entity objects.
entityClass the binding class of which we want an instance filled with the xml data, e.g. SchedBlock.class.
Returns:
the binding class instance (should be cast to entityClass by the caller).
Exceptions:
EntityException 

References deserializeEntity().

Object alma::acs::entityutil::EntityDeserializer::deserializeEntity ( String  xmlString,
Class  entityClass,
String  timestamp 
) throws EntityException [inline, private]

Deserializes (parses) an entity xml and instantiates the binding objects.

Parameters:
xmlString the stringified xml.
entityClass the binding class of which we want an instance filled with the xml data.
timestamp the timestamp to be stored in the entity object, for later serialization.
Returns:
the binding class instance (should be casted by the caller).
Exceptions:
EntityException if the binding class instance can't be constructed from the xml. Note that this exception is only logged at FINER level by this method, so make sure to log it appropriately.

References alma::acs::entityutil::EntityTFinder::extractEntityT(), m_finder, and m_logger.

Object alma::acs::entityutil::EntityDeserializer::deserializeEntity ( String  xmlString,
Class  entityClass 
) throws EntityException [inline]

Deserializes (parses) an entity xml and instantiates the binding objects.

Parameters:
xmlString the stringified xml.
entityClass the binding class of which we want an instance filled with the xml data.
Returns:
the binding class instance (should be casted by the caller).
Deprecated:
use deserializeEntity(XmlEntityStruct, Class) instead. With the addition of timestamp to EntityT, this method will produce binding classes whose XML data can't be stored in the archive.

Referenced by deserializeEntity(), and alma::demo::XmlComponentImpl::XmlComponentHelper::IFTranslator::xmlInOutMethod().

static EntityDeserializer alma::acs::entityutil::EntityDeserializer::getEntityDeserializer ( Logger  logger  )  [inline, static]

Singleton accessor.

Parameters:
logger Logger to be used (may be null in subsequent invocations since only one instance of EntityDeserializer is constructed and then reused)
Returns:
single instance

References EntityDeserializer(), and s_entityDeserializer.


Member Data Documentation

Referenced by getEntityDeserializer().


The documentation for this class was generated from the following file:

Generated by  doxygen 1.6.2