IBM Rational Software Modeler
Release 6.0

com.ibm.xtools.patterns.framework.uml2.persistence
Class PatternInstanceStore

java.lang.Object
  extended bycom.ibm.xtools.patterns.framework.AbstractPatternStore.Instance
      extended bycom.ibm.xtools.patterns.framework.uml2.persistence.PatternInstanceStore

public class PatternInstanceStore
extends AbstractPatternStore.Instance

This is the UML2 pattern instance store which is the default persistent store for pattern instances in the framework. The pattern instance store is compatible and is used in conjunction with the UML2 pattern definition store also found in this package. A concrete factory is also supplied in this package in order to keep the family of concrete products (the pattern definition store and the pattern instance store) instantiated together when the concrete pattern store factory is selected by the client (or by default) via an abstract configuration. The purpose of the pattern instance store is to persist and reconstitute pattern instances from UML2 models. For the UML2 persistent store implementation, the pattern instance is mapped to a UML2 templateable element. This UML2 templateable element contains a UML2 template binding that points to the UML2 template signature as persisted by the pattern definition store.


Constructor Summary
protected PatternInstanceStore()
          Instantiation only from subclasses and this package's classes.
 
Method Summary
 void addParameterValues(AbstractPatternInstance instance, IParameterDescriptor parameter, Object[] value)
          Adds a parameter value to the given instance's persistent representation.
 boolean containsInstance(AbstractPatternInstance instance)
          Determines if a pattern instance is already contained with the pattern instance store.
 Object createInstance(AbstractPatternStore.Definition definitionStore, AbstractPatternInstance instance, Object targetObject)
          Creates a new pattern instance in the pattern instance store.
 Object getDefinition(AbstractPatternInstance instance)
           
 IPatternIdentity getDefinitionIdentity(AbstractPatternStore.Definition definitionStore, Object representation)
          Get the definition identity associated with the instance representation object being passed in.
 Object[] getParameterValues(AbstractPatternInstance instance, IParameterDescriptor parameter)
          Get the persisted parameter values for the given instance and parameter descriptor.
static boolean isInstanceRepresentation(Object representation)
          Determines if the representation object passed in is an instance representation.
 void removeInstance(AbstractPatternInstance instance)
          Remove the persisted pattern instance given the transient pattern instance.
 void removeParameterValues(AbstractPatternInstance instance, IParameterDescriptor parameter, Object[] value)
          Remove the given parameter values from the pattern instance store.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PatternInstanceStore

protected PatternInstanceStore()
Instantiation only from subclasses and this package's classes.

Method Detail

isInstanceRepresentation

public static boolean isInstanceRepresentation(Object representation)
Determines if the representation object passed in is an instance representation.

Parameters:
representation - a potential instance representation
Returns:
true if this is an instance representation object

addParameterValues

public void addParameterValues(AbstractPatternInstance instance,
                               IParameterDescriptor parameter,
                               Object[] value)
Description copied from class: AbstractPatternStore.Instance
Adds a parameter value to the given instance's persistent representation. The parameter value is cumulative and therefore adding a value does not replace any current values.

Specified by:
addParameterValues in class AbstractPatternStore.Instance
Parameters:
instance - the instance of interest
parameter - the parameter to add a value to
value - the value to be added to the given parameter within the instance store

containsInstance

public boolean containsInstance(AbstractPatternInstance instance)
Description copied from class: AbstractPatternStore.Instance
Determines if a pattern instance is already contained with the pattern instance store.

Specified by:
containsInstance in class AbstractPatternStore.Instance
Parameters:
instance - the pattern instance of interest
Returns:
indicates if the instance is contained in the persistent instance store

createInstance

public Object createInstance(AbstractPatternStore.Definition definitionStore,
                             AbstractPatternInstance instance,
                             Object targetObject)
Description copied from class: AbstractPatternStore.Instance
Creates a new pattern instance in the pattern instance store.

Specified by:
createInstance in class AbstractPatternStore.Instance
Parameters:
definitionStore - the associated definition store, this is needed so any appropriate connections between the definition and instance can be made
instance - the instance to be persisted in the pattern instance store
targetObject - the target object defines the context
Returns:
the newly created pattern instance as persisted in the pattern instance store, the returned instance object is used when subsequent method calls on the pattern store require an instance objet

getDefinition

public Object getDefinition(AbstractPatternInstance instance)
Specified by:
getDefinition in class AbstractPatternStore.Instance

getDefinitionIdentity

public IPatternIdentity getDefinitionIdentity(AbstractPatternStore.Definition definitionStore,
                                              Object representation)
Description copied from class: AbstractPatternStore.Instance
Get the definition identity associated with the instance representation object being passed in.

Specified by:
getDefinitionIdentity in class AbstractPatternStore.Instance
Parameters:
definitionStore - the definition store that is used internally by the instance store when needed to implement this method's underlying behavior
representation - the object that represents the instance in the persistent store (or has some known relationship to the object that represents the instance in the persistent store)
Returns:
the pattern identity associated with the instance passed in

getParameterValues

public Object[] getParameterValues(AbstractPatternInstance instance,
                                   IParameterDescriptor parameter)
Description copied from class: AbstractPatternStore.Instance
Get the persisted parameter values for the given instance and parameter descriptor.

Specified by:
getParameterValues in class AbstractPatternStore.Instance
Parameters:
instance - the instance of interest
parameter - the parameter descriptor that qualifies the values to reconstitute
Returns:
the parameter values as represented by the pattern instance store

removeInstance

public void removeInstance(AbstractPatternInstance instance)
Description copied from class: AbstractPatternStore.Instance
Remove the persisted pattern instance given the transient pattern instance.

Specified by:
removeInstance in class AbstractPatternStore.Instance
Parameters:
instance - the instance corresponding to the pattern store instance to remove

removeParameterValues

public void removeParameterValues(AbstractPatternInstance instance,
                                  IParameterDescriptor parameter,
                                  Object[] value)
Description copied from class: AbstractPatternStore.Instance
Remove the given parameter values from the pattern instance store.

Specified by:
removeParameterValues in class AbstractPatternStore.Instance
Parameters:
instance - the instance that qualifies the values to remove
parameter - the parameter of interest
value - the value to remove from the persisted values in the pattern instance store

IBM Rational Software Modeler
Release 6.0


Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2004. All rights reserved.