org.openmdx.base.accessor.jmi.spi
Class RefRootPackage_1

java.lang.Object
  extended by org.openmdx.base.accessor.jmi.spi.RefPackage_1
      extended by org.openmdx.base.accessor.jmi.spi.RefRootPackage_1
All Implemented Interfaces:
Serializable, RefBaseObject, RefPackage, RefPackage_1_0, RefPackage_1_1, RefPackageFactory_1_0, Marshaller

public class RefRootPackage_1
extends RefPackage_1
implements RefPackage_1_1, RefPackageFactory_1_0, Marshaller, Serializable

RefRootPackage_1 class. This is at the same time the JMI root package which acts as a factory for creating application-specific packages by calling refPackage().

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.openmdx.base.accessor.jmi.spi.RefPackage_1
classes, filterConstructors, structConstructors
 
Constructor Summary
RefRootPackage_1(ObjectFactory_1_0 objectFactory)
          Constructor.
RefRootPackage_1(ObjectFactory_1_0 objectFactory, boolean throwNotFoundIfNull)
          Constructor.
RefRootPackage_1(ObjectFactory_1_0 objectFactory, Map packageImpls, Object context)
          Constructor.
RefRootPackage_1(ObjectFactory_1_0 objectFactory, Map packageImpls, Object context, boolean throwNotFoundIfNull)
          Constructor.
RefRootPackage_1(ObjectFactory_1_0 objectFactory, Map packageImpls, Object context, String defaultLocationSuffix, boolean throwNotFoundIfNull)
          Constructor.
RefRootPackage_1(ObjectFactory_1_0 objectFactory, PersistenceManagerFactory persistenceManagerFactory)
          Constructor
RefRootPackage_1(ObjectFactory_1_0 objectFactory, String defaultLocationSuffix)
          Constructor.
 
Method Summary
 boolean cache(Object unmarshalled, Object marshalled)
          Registers an object unless an object matching the unmarshalled object is already registerd.
 RefPackage_1_1 createRefPackage()
          Create a new RefPackage
 Object marshal(Object source)
          Marshals an object
 RefClass refClass(String qualifiedClassName)
           
 RefStruct refCreateStruct(String structName, List args)
           
 RefStruct refCreateStruct(String structName, Object arg)
          arg must be instanceof Structure_1_0.
 RefPackage refImmediatePackage()
           
 RefObject refMetaObject()
          The root package does not have a meta object.
 Model_1_0 refModel()
          Returns model defined for this package.
 String refMofId()
           
 RefObject refObject(RefObject primary, RefObject secondary)
          Returns a proxy implementing the interfaces of both RefObjects and delegating to the primary RefObject if possible the secondary RefObject as fallback
 ObjectFactory_1_0 refObjectFactory()
          Returns the object factory from which the package creates and retrieves objects.
 RefPackage refOutermostPackage()
           
 RefPackage refPackage(String nestedPackageName)
           
 PersistenceManager refPersistenceManager()
          Retrieves the JDO Persistence Manager delegating to this package.
 UnitOfWork_1_0 refUnitOfWork()
          Return the current unit of work.
 Object unmarshal(Object source)
          Unmarshals an object
 
Methods inherited from class org.openmdx.base.accessor.jmi.spi.RefPackage_1
refAllAssociations, refAllClasses, refAllPackages, refAssociation, refAssociation, refBegin, refClass, refCommit, refCreateFilter, refCreateFilter, refCreateStruct, refDelete, refGetEnum, refGetEnum, refObject, refPackage, refRollback, refVerifyConstraints
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.openmdx.base.accessor.jmi.cci.RefPackage_1_1
refCreateFilter
 
Methods inherited from interface org.openmdx.base.accessor.jmi.cci.RefPackage_1_0
refBegin, refCommit, refCreateFilter, refObject, refRollback
 
Methods inherited from interface javax.jmi.reflect.RefPackage
refAllAssociations, refAllClasses, refAllPackages, refAssociation, refAssociation, refClass, refCreateStruct, refDelete, refGetEnum, refGetEnum, refPackage
 
Methods inherited from interface javax.jmi.reflect.RefBaseObject
equals, hashCode, refVerifyConstraints
 

Constructor Detail

RefRootPackage_1

public RefRootPackage_1(ObjectFactory_1_0 objectFactory,
                        PersistenceManagerFactory persistenceManagerFactory)
Constructor


RefRootPackage_1

public RefRootPackage_1(ObjectFactory_1_0 objectFactory)
Constructor. Same as this(objectFactory, null, null)


RefRootPackage_1

public RefRootPackage_1(ObjectFactory_1_0 objectFactory,
                        boolean throwNotFoundIfNull)
Constructor. Same as this(objectFactory, null, null)


RefRootPackage_1

public RefRootPackage_1(ObjectFactory_1_0 objectFactory,
                        String defaultLocationSuffix)
Constructor. Same as this(objectFactory, null, null, defaultLocationSuffix, true).


RefRootPackage_1

public RefRootPackage_1(ObjectFactory_1_0 objectFactory,
                        Map packageImpls,
                        Object context)
Constructor. Same as this(objectFactory, packageImpls, context, true).


RefRootPackage_1

public RefRootPackage_1(ObjectFactory_1_0 objectFactory,
                        Map packageImpls,
                        Object context,
                        boolean throwNotFoundIfNull)
Constructor. Same as this(objectFactory, packageImpls, context, "accessor.jmi", throwNotFoundIfNull)


RefRootPackage_1

public RefRootPackage_1(ObjectFactory_1_0 objectFactory,
                        Map packageImpls,
                        Object context,
                        String defaultLocationSuffix,
                        boolean throwNotFoundIfNull)
Constructor.

Parameters:
objectFactory - delegation object factory. This JMI implementation implements the facade pattern. The 'real' objects are managed by the specified object factory. The JMI classes put a typed JMI facade on top of the objects managed by the factory. All object handling is performed by the object factory.
packageImpls - Specifies the location of the JMI implementation classes in the format [key=,value=]. The marshaller looks up the implementation classes at the specified location.
context - user-specific context object. The context object is available from all instance-level JMI objects. The framework does not read or update the context object.
defaultLocationSuffix - The default value is 'cci'. This suffix is required to construct a default location for looking up the JMI interface and implementation classes which is: .., e.g. 'org.omg.model1.cci.StructuralFeature' or 'org.omg.model1.cci.StructuralFeatureImpl'. In case of .NET deployment the defaultLocationSuffix should be set to 'cci.dotnet'.
throwNotFoundIfNull - if true RefObject.get(qualifier) always throws a NOT_FOUND exception independent of the multiplicity (0..1|1..1) of the modeled reference. This flag is for backwards compatibility. If false get(qualifier) throws a NOT_FOUND if the object was not found and multiplicity is 1..1. It returns null if the object was not found and multiplicity is 0..1.
Method Detail

createRefPackage

public RefPackage_1_1 createRefPackage()
Description copied from interface: RefPackageFactory_1_0
Create a new RefPackage

Specified by:
createRefPackage in interface RefPackageFactory_1_0
Returns:
a new RefPackage instance

unmarshal

public Object unmarshal(Object source)
                 throws ServiceException
Description copied from interface: Marshaller
Unmarshals an object

Specified by:
unmarshal in interface Marshaller
Parameters:
source - The marshalled object
Returns:
The unmarshalled object
Throws:
ServiceException - MARSHAL_FAILURE: Object can't be unmarshalled

marshal

public Object marshal(Object source)
               throws ServiceException
Description copied from interface: Marshaller
Marshals an object

Specified by:
marshal in interface Marshaller
Parameters:
source - The object to be marshalled
Returns:
The marshalled object
Throws:
ServiceException - MARSHAL_FAILURE: Object can't be marshalled

cache

public boolean cache(Object unmarshalled,
                     Object marshalled)
Registers an object unless an object matching the unmarshalled object is already registerd.

Parameters:
unmarshalled - the unmarshalled object
marshalled - the marshalled object
Returns:
true if no object matching the unmarshalled object is registered yet

refCreateStruct

public RefStruct refCreateStruct(String structName,
                                 Object arg)
Description copied from class: RefPackage_1
arg must be instanceof Structure_1_0. arg is wrapped by the typed JMI structure class.

Specified by:
refCreateStruct in interface RefPackage_1_0
Overrides:
refCreateStruct in class RefPackage_1

refModel

public Model_1_0 refModel()
Description copied from interface: RefPackage_1_0
Returns model defined for this package.

Specified by:
refModel in interface RefPackage_1_0
Overrides:
refModel in class RefPackage_1
Returns:
Model_1_0 model assigned to this package.

refObjectFactory

public ObjectFactory_1_0 refObjectFactory()
Description copied from interface: RefPackage_1_0
Returns the object factory from which the package creates and retrieves objects.

Specified by:
refObjectFactory in interface RefPackage_1_0
Overrides:
refObjectFactory in class RefPackage_1
Returns:
ObjectFactory_1_0 object factory.

refUnitOfWork

public UnitOfWork_1_0 refUnitOfWork()
Description copied from interface: RefPackage_1_0
Return the current unit of work. Equivalent to refOutermostPackage().refUnitOfWork().

Specified by:
refUnitOfWork in interface RefPackage_1_0
Overrides:
refUnitOfWork in class RefPackage_1

refImmediatePackage

public RefPackage refImmediatePackage()
Specified by:
refImmediatePackage in interface RefBaseObject
Overrides:
refImmediatePackage in class RefPackage_1

refOutermostPackage

public RefPackage refOutermostPackage()
Specified by:
refOutermostPackage in interface RefBaseObject
Overrides:
refOutermostPackage in class RefPackage_1

refMetaObject

public RefObject refMetaObject()
The root package does not have a meta object.

Specified by:
refMetaObject in interface RefBaseObject
Overrides:
refMetaObject in class RefPackage_1
Returns:
RefObject null, the root package does not have a meta object.

refPackage

public RefPackage refPackage(String nestedPackageName)
Specified by:
refPackage in interface RefPackage
Overrides:
refPackage in class RefPackage_1

refClass

public RefClass refClass(String qualifiedClassName)
Specified by:
refClass in interface RefPackage
Overrides:
refClass in class RefPackage_1

refCreateStruct

public RefStruct refCreateStruct(String structName,
                                 List args)
Specified by:
refCreateStruct in interface RefPackage
Overrides:
refCreateStruct in class RefPackage_1

refMofId

public String refMofId()
Specified by:
refMofId in interface RefBaseObject

refPersistenceManager

public PersistenceManager refPersistenceManager()
Retrieves the JDO Persistence Manager delegating to this package.

Specified by:
refPersistenceManager in interface RefPackage_1_1
Overrides:
refPersistenceManager in class RefPackage_1
Returns:
the JDO Persistence Manager delegating to this package.

refObject

public RefObject refObject(RefObject primary,
                           RefObject secondary)
Returns a proxy implementing the interfaces of both RefObjects and delegating to
  1. the primary RefObject if possible
  2. the secondary RefObject as fallback

Specified by:
refObject in interface RefPackage_1_1
Overrides:
refObject in class RefPackage_1
Parameters:
primary - its methods override the secondary object's methods
secondary - its interfacse are implemented by the proxy object as well
Returns:
a proxy object delgating to the primary or secondary object as appropriate


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