org.eclipse.emf.transaction.impl
Class ResourceSetManager

java.lang.Object
  extended by org.eclipse.emf.transaction.impl.ResourceSetManager

public final class ResourceSetManager
extends Object

The resource set manager keeps track of the load state of Resources in a resource set managed by a transactional editing domain. It assists in the enforcement of write transaction semantics for certain kinds of changes to the state of a resource (in particular, its contents).

The resource set manager is a singleton rather than a per-editing-domain instance primarily because the notification filters need to be able to distinguish events coming from loading/unloading resources, and filters do not have any editing domain context. This is not a problem, as the resources are tracked by their object identity, so their states are absolute, not relative to any particular editing domain.


Method Summary
static ResourceSetManager getInstance()
          Obtains the singleton manager instance.
 boolean isLoaded(Resource res)
          Queries whether the specified resource is currently loaded.
 boolean isLoading(Resource res)
          Queries whether the specified resource is currently loading.
 boolean isUnloaded(Resource res)
          Queries whether the specified resource is currently unloaded.
 boolean isUnloading(Resource res)
          Queries whether the specified resource is currently unloading.
 void observe(Resource res, Notification notification)
          Analyzes a notification from a resource for any potential state change.
 void observe(ResourceSet rset)
          Observes the specified resource set, usually only when the editing domain is initialized.
 void observe(ResourceSet rset, Notification notification)
          Analyzes a notification from a resource set for any potential state changes in its resources.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ResourceSetManager getInstance()
Obtains the singleton manager instance.

Returns:
the singleton instance

observe

public void observe(ResourceSet rset)
Observes the specified resource set, usually only when the editing domain is initialized. This resource set may already contain resources in a variety of states, so I will examine each of them in turn and record their states.

Parameters:
rset - a resource set

observe

public void observe(ResourceSet rset,
                    Notification notification)
Analyzes a notification from a resource set for any potential state changes in its resources.

Parameters:
rset - a resource set sending a notification
notification - the notification from the resource set

observe

public void observe(Resource res,
                    Notification notification)
Analyzes a notification from a resource for any potential state change.

Parameters:
res - a resource
notification - the notification from the resource

isLoaded

public boolean isLoaded(Resource res)
Queries whether the specified resource is currently loaded.

Parameters:
res - a resource
Returns:
true if the resource has completed loading and is not now unloading; false, otherwise

isLoading

public boolean isLoading(Resource res)
Queries whether the specified resource is currently loading.

Parameters:
res - a resource
Returns:
true if the resource is not yet loaded but is in the process of loading; false, otherwise

isUnloading

public boolean isUnloading(Resource res)
Queries whether the specified resource is currently unloading.

Parameters:
res - a resource
Returns:
true if the resource is loaded but is in the process of unloading; false, otherwise

isUnloaded

public boolean isUnloaded(Resource res)
Queries whether the specified resource is currently unloaded.

Parameters:
res - a resource
Returns:
true if the resource has completed unloading and is not now loading; false, otherwise

Copyright 2002, 2007 IBM Corporation and others.
All Rights Reserved.