org.openmdx.base.accessor.generic.spi
Class ViewConnection_1

java.lang.Object
  extended by org.openmdx.compatibility.base.marshalling.CachingMarshaller
      extended by org.openmdx.base.accessor.generic.spi.ViewConnection_1
All Implemented Interfaces:
Serializable, ObjectFactory_1_0, ObjectFactory_1_1, ObjectFactory_1_2, ObjectFactory_1_3, CachingMarshaller_1_0, Marshaller

public class ViewConnection_1
extends CachingMarshaller
implements ObjectFactory_1_3

StateConnection_1

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.openmdx.compatibility.base.marshalling.CachingMarshaller
mapping
 
Method Summary
protected  void assertOpen()
          Asserts that the connection is open
 void clear()
          Clears the cache
 Object_1_0 cloneObject(Path target, Object_1_0 original, boolean completelyDirty)
          This method clones an object
 void close()
          Close the object factory.
protected  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 initialValues)
          This method creates a new object with the initial values.
 Object_1_0 createObject(String roleClass, String roleId, Object_1_0 roleCapable)
          This method creates a new role of a RoleCapable object.
 Structure_1_0 createStructure(String type, List fieldNames, List fieldValues)
          Create an object
 void evict()
           
 Connection_1Factory getConnectionFactory()
          Return this connection's factory
 Object_1_0 getObject(Object accessPath)
          Get an object from the object factory.
 Object_1_0 getObject(Object accessPath, Boolean dateStateInstance, boolean initializeCacheWithDelegate)
           
 UnitOfWork_1_0 getUnitOfWork()
          Return the unit of work associated with the current object factory.
 Boolean hasContainerManagedUnitOfWork()
          Container managed units of work are either non transactional or part of a bigger unit of work.
protected  boolean isOpen()
          Tells whether the connection is open of not
 Object unmarshal(Object source)
          Unmarshals an object
 
Methods inherited from class org.openmdx.compatibility.base.marshalling.CachingMarshaller
cache, 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
 

Method Detail

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

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 initialValues)
                        throws ServiceException
Description copied from interface: ObjectFactory_1_1
This method creates a new object with the initial values.

This method method and its org::openmdx::compatibility::role1 model are deprecated in favour of the org::openmdx::base::RoleCapable class and the $link{ObjectFactory_1_1#createObject(java.lang.String, java.lang.String,Object_1_0) createObject(String,String,Object_1_0)} method.

Specified by:
createObject in interface ObjectFactory_1_0
Specified by:
createObject in interface ObjectFactory_1_1
Throws:
ServiceException
See Also:
Role

createStructure

public Structure_1_0 createStructure(String type,
                                     List 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

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

getObject

public Object_1_0 getObject(Object accessPath,
                            Boolean dateStateInstance,
                            boolean initializeCacheWithDelegate)
                     throws ServiceException
Throws:
ServiceException

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

createMarshalledObject

protected 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

isOpen

protected final boolean isOpen()
Tells whether the connection is open of not

Returns:
true if the connection is open.

assertOpen

protected void assertOpen()
                   throws ServiceException
Asserts that the connection is open

Throws:
ServiceException - ILLEGAL_STATE if the connection is closed

unmarshal

public Object unmarshal(Object source)
                 throws ServiceException
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
Throws:
ServiceException - MARSHAL_FAILURE Object can't be unmarshalled

createObject

public Object_1_0 createObject(String roleClass,
                               String roleId,
                               Object_1_0 roleCapable)
                        throws ServiceException
Description copied from interface: ObjectFactory_1_1
This method creates a new role of a RoleCapable object.

Specified by:
createObject in interface ObjectFactory_1_1
Throws:
ServiceException
See Also:
RoleCapable

getConnectionFactory

public Connection_1Factory getConnectionFactory()
Description copied from interface: ObjectFactory_1_2
Return this connection's factory

Specified by:
getConnectionFactory in interface ObjectFactory_1_2
Returns:
the corresponding connection factory

hasContainerManagedUnitOfWork

public Boolean hasContainerManagedUnitOfWork()
Description copied from interface: ObjectFactory_1_2
Container managed units of work are either non transactional or part of a bigger unit of work.

Specified by:
hasContainerManagedUnitOfWork in interface ObjectFactory_1_2
Returns:
the value of the ContainerManaged property.

cloneObject

public Object_1_0 cloneObject(Path target,
                              Object_1_0 original,
                              boolean completelyDirty)
                       throws ServiceException
Description copied from interface: ObjectFactory_1_3
This method clones an object

Specified by:
cloneObject in interface ObjectFactory_1_3
Returns:
the clone
Throws:
ServiceException

clear

public void clear()
Clears the cache

Specified by:
clear in interface ObjectFactory_1_3
Overrides:
clear in class CachingMarshaller

evict

public void evict()
Specified by:
evict in interface ObjectFactory_1_3


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