org.openmdx.base.accessor.generic.cci
Interface ObjectFactory_1_0

All Superinterfaces:
Marshaller
All Known Subinterfaces:
Connection_1_0, Connection_1_1, Connection_1_2, Connection_1_3, Connection_1_4, Connection_1_5, ObjectFactory_1_1, ObjectFactory_1_2, ObjectFactory_1_3, ObjectFactory_1_4
All Known Implementing Classes:
Connection_1, Manager_1, RefObjectFactory_1, ViewConnection_1

public interface ObjectFactory_1_0
extends Marshaller

openMDX Object Layer: Object Factory Interface.

The object factory returns the same object for a given object id as long as it is not garbage collected.


Method Summary
 void close()
          Close the object factory.
 Object_1_0 createObject(String objectClass)
          Create an object
 Object_1_0 createObject(String objectClass, Object_1_0 initialValues)
          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.
 
Methods inherited from interface org.openmdx.compatibility.base.marshalling.Marshaller
marshal, unmarshal
 

Method Detail

close

void close()
           throws ServiceException
Close the object factory.

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

Throws:
ServiceException

getUnitOfWork

UnitOfWork_1_0 getUnitOfWork()
                             throws ServiceException
Return the unit of work associated with the current object factory.

Returns:
the unit of work
Throws:
ServiceException - ILLEGAL_STATE if the object factory is closed

getObject

Object_1_0 getObject(Object accessPath)
                     throws ServiceException
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.

Parameters:
accessPath - Access path of object to be retrieved.
Returns:
A persistent object
Throws:
ServiceException - ILLEGAL_STATE if the object factory is closed

createObject

Object_1_0 createObject(String objectClass)
                        throws ServiceException
Create an object

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

Object_1_0 createObject(String objectClass,
                        Object_1_0 initialValues)
                        throws ServiceException
Creates a new object with the initial values.

Throws:
ServiceException

createStructure

Structure_1_0 createStructure(String type,
                              List<String> fieldNames,
                              List<?> fieldValues)
                              throws ServiceException
Create an object

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.