org.openmdx.base.accessor.jmi.cci
Class RefObjectFactory_1

java.lang.Object
  extended by org.openmdx.compatibility.base.marshalling.CachingMarshaller
      extended by org.openmdx.base.accessor.jmi.cci.RefObjectFactory_1
All Implemented Interfaces:
Serializable, ObjectFactory_1_0, CachingMarshaller_1_0, Marshaller

public class RefObjectFactory_1
extends CachingMarshaller
implements ObjectFactory_1_0

ObjectFactory facade delegating to a JmiAccessor_1.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.openmdx.compatibility.base.marshalling.CachingMarshaller
mapping
 
Constructor Summary
RefObjectFactory_1(RefRootPackage_1 refRootPackage)
           
RefObjectFactory_1(RefRootPackage_1 refRootPackage, Set<Path> directAccessPaths)
           
 
Method Summary
 void close()
          Close the object factory.
 Object createMarshalledObject(Object source)
          Marshals an object to be cached.
 Object_1_0 createObject(String objectClass)
          Create an object
 Object_1_0 createObject(String objectClass, Object_1_0 base)
          Creates a new object with the initial values.
 Structure_1_0 createStructure(String type, List<String> fieldNames, List<?> fieldValues)
          Create an object
 Object_1_0 getObject(Object accessPath)
          Get an object from the object factory.
 UnitOfWork_1_0 getUnitOfWork()
          Return the unit of work associated with the current object factory.
 Object unmarshal(Object source)
          Unmarshals an object
 
Methods inherited from class org.openmdx.compatibility.base.marshalling.CachingMarshaller
cache, clear, evict, marshal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.openmdx.compatibility.base.marshalling.Marshaller
marshal
 

Constructor Detail

RefObjectFactory_1

public RefObjectFactory_1(RefRootPackage_1 refRootPackage,
                          Set<Path> directAccessPaths)

RefObjectFactory_1

public RefObjectFactory_1(RefRootPackage_1 refRootPackage)
Method Detail

createMarshalledObject

public Object createMarshalledObject(Object source)
                              throws ServiceException
Description copied from class: CachingMarshaller
Marshals an object to be cached.

Specified by:
createMarshalledObject in class CachingMarshaller
Parameters:
source - The object to be marshalled
Returns:
The marshalled object; or null if source is null
Throws:
ServiceException - MARSHAL_FAILURE Object can't be marshalled

unmarshal

public Object unmarshal(Object source)
Description copied from class: CachingMarshaller
Unmarshals an object

Specified by:
unmarshal in interface Marshaller
Specified by:
unmarshal in class CachingMarshaller
Parameters:
source - The marshalled object
Returns:
The unmarshalled object; or null if source is null

close

public void close()
           throws ServiceException
Description copied from interface: ObjectFactory_1_0
Close the object factory.

After the close method completes, all methods on the ObjectFactory_1_0 instance except isClosed() throw an ILLEGAL_STATE ServiceException.

Specified by:
close in interface ObjectFactory_1_0
Throws:
ServiceException

getObject

public Object_1_0 getObject(Object accessPath)
                     throws ServiceException
Description copied from interface: ObjectFactory_1_0
Get an object from the object factory.

If an object with the given access path is already in the cache it is returned, otherwise a new object is returned.

Specified by:
getObject in interface ObjectFactory_1_0
Parameters:
accessPath - Access path of object to be retrieved.
Returns:
A persistent object
Throws:
ServiceException - ILLEGAL_STATE if the object factory is closed

getUnitOfWork

public UnitOfWork_1_0 getUnitOfWork()
                             throws ServiceException
Description copied from interface: ObjectFactory_1_0
Return the unit of work associated with the current object factory.

Specified by:
getUnitOfWork in interface ObjectFactory_1_0
Returns:
the unit of work
Throws:
ServiceException - ILLEGAL_STATE if the object factory is closed

createObject

public Object_1_0 createObject(String objectClass)
                        throws ServiceException
Description copied from interface: ObjectFactory_1_0
Create an object

Specified by:
createObject in interface ObjectFactory_1_0
Parameters:
objectClass - The model class of the object to be created
Returns:
an object
Throws:
ServiceException - ILLEGAL_STATE if the object factory is closed

createObject

public Object_1_0 createObject(String objectClass,
                               Object_1_0 base)
                        throws ServiceException
Description copied from interface: ObjectFactory_1_0
Creates a new object with the initial values.

Specified by:
createObject in interface ObjectFactory_1_0
Throws:
ServiceException

createStructure

public Structure_1_0 createStructure(String type,
                                     List<String> fieldNames,
                                     List<?> fieldValues)
                              throws ServiceException
Description copied from interface: ObjectFactory_1_0
Create an object

Specified by:
createStructure in interface ObjectFactory_1_0
Parameters:
type - The type of the structure to be created
fieldNames - The names of the structure's fields
fieldValues - The structure's field values
Returns:
a structure
Throws:
ServiceException - ILLEGAL_STATE if the object factory is closed


This software is published under the BSD license. Copyright © 2003-2008, OMEX AG, Switzerland, All rights reserved. Use is subject to license terms.