|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ResourceManager
Manages the CDOResource
instances in an associated ResourceSet
.
A ResourceManager
can be seen as a "CDO session" for the ResourceSet
.
It holds a handle to the Channel
that connects this ResourceManager
to the CDO server.
Nested Class Summary | |
---|---|
static interface |
ResourceManager.InvalidationListener
Can be registered with a ResourceManager to be subsequently notified about
invalidated objects. |
Method Summary | |
---|---|
void |
addInvalidationListener(ResourceManager.InvalidationListener listener)
Adds a ResourceManager.InvalidationListener to the list of listeners to be notified about
invalidated obejcts in the scope of this PackageManager . |
void |
commit()
Commits all changes to the CDO repository that have been applied to the contained CDOPersistable instances since the last call to commit() or the
creation of this ResourceManager , whichever occurred more recently. |
org.eclipse.emf.ecore.EObject |
createEObject(org.eclipse.emf.ecore.EClass eClass,
long oid,
int oca,
CDOResource resource)
For internal use only. |
org.eclipse.emf.common.util.URI |
createProxyURI(long oid)
For internal use only. |
org.eclipse.emf.ecore.resource.Resource |
createResource(org.eclipse.emf.common.util.URI uri)
A convenience method for creating a resource in the associated ResourceSet . |
org.eclipse.net4j.core.Channel |
getChannel()
Returns the Channel that represents the connection of this
ResourceManager to the CDO server. |
org.eclipse.emf.ecore.EObject |
getObject(long oid)
Returns the EObject that is internally identified by the given global
OID . |
PackageManager |
getPackageManager()
Returns the PackageManager used by this ResourceManager . |
org.eclipse.emf.ecore.EObject |
getProxyObject(long oid)
For internal use only. |
CDOResource |
getResource(int rid)
Returns the CDOResource instance with the given RID and loads
that CDOResource if necessary. |
org.eclipse.emf.ecore.resource.Resource |
getResource(org.eclipse.emf.common.util.URI uri,
boolean loadOnDemand)
A convenience method for querying a resource in the associated ResourceSet
and eventually loading that resource. |
org.eclipse.emf.ecore.resource.ResourceSet |
getResourceSet()
Returns the ResourceSet that is associated with and managed by this
ResourceManager . |
PausableChangeRecorder |
getTransaction()
For internal use only. |
void |
handleRemovedResources(int[] rids)
For internal use only. |
boolean |
hasDeferredInvalidation(org.eclipse.emf.ecore.EObject object)
Returns true if an invalidation has been deferred for the given
EObject within the current transaction, false otherwise. |
void |
invalidateObjects(long[] oids)
For internal use only. |
boolean |
isRequestingObjects()
For internal use only. |
boolean |
isRollbackOnly()
Returns true if the current transaction can only be rolled back
due to changes by another transaction, false otherwise. |
org.eclipse.emf.common.util.EList |
queryCrossReferences(org.eclipse.emf.ecore.EObject object)
TODO Document method queryCrossReferences The queryCrossReferences method. |
org.eclipse.emf.common.util.EList |
queryCrossReferences(org.eclipse.emf.ecore.EObject object,
CDOResource resource)
TODO Document method queryCrossReferences The queryCrossReferences method. |
java.util.Set |
queryExtent(org.eclipse.emf.ecore.EClass context)
Convenience method to query polymorphic, gloabl extents, returns the same result as queryExtent(context, false, null) . |
java.util.Set |
queryExtent(org.eclipse.emf.ecore.EClass context,
boolean exactMatch)
Convenience method to query gloabl extents, returns the same result as queryExtent(context, exactMatch, null) . |
java.util.Set |
queryExtent(org.eclipse.emf.ecore.EClass context,
boolean exactMatch,
CDOResource resource)
Sends a request to the CDO server to query all CDOPersistable instances in the given CDOResource or in all
resources of the CDO repository that are instances of the context EClass
or of any of its subclasses. |
java.util.Set |
queryExtent(org.eclipse.emf.ecore.EClass context,
CDOResource resource)
Convenience method to query polymorphic extents, returns the same result as queryExtent(context, false, resource) . |
void |
registerObject(long id,
org.eclipse.emf.ecore.EObject object)
For internal use only. |
void |
registerResource(CDOResource resource)
For internal use only. |
void |
registerResourcePath(CDOResource cdoResource,
java.lang.String path)
For internal use only. |
void |
removeInvalidationListener(ResourceManager.InvalidationListener listener)
Removes a ResourceManager.InvalidationListener from the list of listeners to be notified about
invalidated obejcts in the scope of this PackageManager . |
void |
requestObject(CDOPersistable cdoObject)
For internal use only. |
void |
reRegisterObject(org.eclipse.emf.ecore.EObject object,
long newId)
For internal use only. |
void |
rollback()
Rolls back the current transaction that is started with the creation of this ResourceManager or after a call to commit() ,
whichever occurred more recently. |
void |
setResourceSet(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
Associates the given ResourceSet with this ResourceManager . |
void |
startRequestingObjects()
For internal use only. |
void |
stopRequestingObjects()
For internal use only. |
Methods inherited from interface org.eclipse.net4j.spring.Service |
---|
addStateListener, dump, getState, isActive, isAutoStart, isStarted, removeStateListener, start, stop, testSetState |
Methods inherited from interface org.eclipse.net4j.spring.Loggable |
---|
debug, debug, error, error, fatal, fatal, getBeanName, getChild, getContainer, getFullBeanName, getLogger, info, info, isDebugEnabled, isErrorEnabled, isFatalEnabled, isInfoEnabled, isWarnEnabled, warn, warn |
Method Detail |
---|
boolean isRollbackOnly()
true
if the current transaction can only be rolled back
due to changes by another transaction, false
otherwise.
true
if the current transaction can only be rolled back
due to changes by another transaction, false
otherwise.boolean hasDeferredInvalidation(org.eclipse.emf.ecore.EObject object)
true
if an invalidation has been deferred for the given
EObject
within the current transaction, false
otherwise.
object
- The EObject
to check.
true
if an invalidation has been deferred for the given
EObject
within the current transaction, false
otherwise.void commit() throws OptimisticControlException
CDOPersistable
instances since the last call to commit()
or the
creation of this ResourceManager
, whichever occurred more recently.
This is a blocking call. The calling thread gets suspended until the confirmation
for the CommitTransactionRequest
is received and processed.
OptimisticControlException
- if one or several of the objects to be committed
has never versions at server side.CommitTransactionRequest
void rollback()
ResourceManager
or after a call to commit()
,
whichever occurred more recently.
The associated ResourceSet
and the contained Resource
and
EObject
instances are put back into the state before the first change
in the current transaction.
Finally a new transaction is started.
PausableChangeRecorder getTransaction()
org.eclipse.emf.ecore.resource.ResourceSet getResourceSet()
ResourceSet
that is associated with and managed by this
ResourceManager
.
ResourceSet
.void setResourceSet(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
ResourceSet
with this ResourceManager
.This method can only be called once!
resourceSet
- The ResourceSet
to associate.org.eclipse.net4j.core.Channel getChannel()
Channel
that represents the connection of this
ResourceManager
to the CDO server.
Channel
that represents the connection of this
ResourceManager
to the CDO server.CDOResource getResource(int rid)
CDOResource
instance with the given RID
and loads
that CDOResource
if necessary.
rid
- The RID
of the resource to load.
CDOResource
or null
if no resource with the
given RID
exists in the CDO repository.org.eclipse.emf.ecore.resource.Resource createResource(org.eclipse.emf.common.util.URI uri)
ResourceSet
.
Identical to calling getResourceSet().createResource(uri)
.
uri
- The URI of the resource to create.
null
if no factory is registered.org.eclipse.emf.ecore.resource.Resource getResource(org.eclipse.emf.common.util.URI uri, boolean loadOnDemand)
ResourceSet
and eventually loading that resource.
Identical to calling getResourceSet().getResource(uri, loadOnDemand)
.
uri
- The URI to resolve.loadOnDemand
- Whether to create and load the resource, if it doesn't already exists.
java.lang.RuntimeException
- if a resource can't be demand created.
org.eclipse.emf.common.util.WrappedException
- if a problem occurs during demand load.boolean isRequestingObjects()
void startRequestingObjects()
void stopRequestingObjects()
void requestObject(CDOPersistable cdoObject)
org.eclipse.emf.common.util.URI createProxyURI(long oid)
org.eclipse.emf.ecore.EObject getProxyObject(long oid)
void invalidateObjects(long[] oids)
void handleRemovedResources(int[] rids)
void registerObject(long id, org.eclipse.emf.ecore.EObject object)
void reRegisterObject(org.eclipse.emf.ecore.EObject object, long newId)
org.eclipse.emf.ecore.EObject createEObject(org.eclipse.emf.ecore.EClass eClass, long oid, int oca, CDOResource resource)
org.eclipse.emf.ecore.EObject getObject(long oid)
EObject
that is internally identified by the given global
OID
.
If the CDOResource
that contains the found EObject
is not loaded
yet, it is automatically loaded into the associated ResourceSet
before.
oid
- The OID
of the EObject
to return.
EObject
that is internally identified by the given global
OID
.void registerResource(CDOResource resource)
void registerResourcePath(CDOResource cdoResource, java.lang.String path)
PackageManager getPackageManager()
PackageManager
used by this ResourceManager
.
PackageManager
used by this ResourceManager
.java.util.Set queryExtent(org.eclipse.emf.ecore.EClass context)
queryExtent(context, false, null)
.
context
- The EClass
that all the objects to be queried
shall be castable to.
Set
of all the objects that can safely be casted to the
context EClass
.queryExtent(EClass, boolean, CDOResource)
java.util.Set queryExtent(org.eclipse.emf.ecore.EClass context, CDOResource resource)
queryExtent(context, false, resource)
.
context
- The EClass
that all the objects to be queried
shall be castable to.resource
- The CDOResource
to be used as the scope for the extent
or null
for global extent scope.
Set
of all the objects that can safely be casted to the
context EClass
.queryExtent(EClass, boolean, CDOResource)
java.util.Set queryExtent(org.eclipse.emf.ecore.EClass context, boolean exactMatch, CDOResource resource)
CDOPersistable
instances in the given CDOResource
or in all
resources of the CDO repository that are instances of the context EClass
or of any of its subclasses.
The CDOPersistable
instances do not have to be already
loaded in order to be found by this remote query. If they had not been loaded
before, CDO will create proxies for them and lazily load them while iterating
over the returned Set
. The remote query is performed on each call
to this method, no caching will occur.
context
- The EClass
that all the objects to be queried
shall be castable to.exactMatch
- Pass true
to exclude objects from the result
that are instances of subclasses of the context EClass
,
false
otherwise.resource
- The CDOResource
to be used as the scope for the extent
or null
for global extent scope.
Set
of all the objects that can safely be casted to the context
EClass
.CDOResource.queryExtent(EClass, boolean)
java.util.Set queryExtent(org.eclipse.emf.ecore.EClass context, boolean exactMatch)
queryExtent(context, exactMatch, null)
.
context
- The EClass
that all the objects to be queried
shall be castable to.exactMatch
- Pass true
to exclude objects from the result
that are instances of subclasses of the context EClass
,
false
otherwise.
Set
of all the objects in all resources of the CDO respository
that can safely be casted to the context EClass
.queryExtent(EClass, boolean, CDOResource)
org.eclipse.emf.common.util.EList queryCrossReferences(org.eclipse.emf.ecore.EObject object)
The queryCrossReferences
method.
object
-
org.eclipse.emf.common.util.EList queryCrossReferences(org.eclipse.emf.ecore.EObject object, CDOResource resource)
The queryCrossReferences
method.
object
- resource
-
void addInvalidationListener(ResourceManager.InvalidationListener listener)
ResourceManager.InvalidationListener
to the list of listeners to be notified about
invalidated obejcts in the scope of this PackageManager
.
listener
- The ResourceManager.InvalidationListener
to be added.void removeInvalidationListener(ResourceManager.InvalidationListener listener)
ResourceManager.InvalidationListener
from the list of listeners to be notified about
invalidated obejcts in the scope of this PackageManager
.
listener
- The ResourceManager.InvalidationListener
to be removed.
|
Copyright (c) 2004, 2005, 2006 Eike Stepper, Germany. All Rights Reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |