This is necessary because the Client class that Perforce provides in their API is not complete. It is missing several fields and we cannot extend that class because its final. @author Mike Wille
An Atom Publishing Protocol Introspection Document workspace element.
Per APP Draft-08
The "app:workspace" element contains information elements about the collections of resources available for editing. The app:workspace element MUST contain one or more app:collection elements. appWorkspace = element app:workspace { appCommonAttributes, ( atomTitle & appCollection & extensionElement* ) }
Workspace has a generic API based on RepositoryObjects and their associations, as well as a more specific one dealing with resource processors, artifacts, features, distributions and targets. The latter is mostly intended for scripting, hence the shorthand notation of its method names:
Command syntax, first character is the "operation", then the "entity type" or "association". Note: not all combinations exist.
Operations: [c]reate, [l]ist, [d]elete, [u]pdate
Entities: [a]rtifact, [f]eature, [d]istribution, [t]arget
Associations: [a2f], [f2d], [d2t]
Workspace objects are most commonly obtained from a WorkspaceManager acting on behalf of the client. @see ObjectRepository @see WorkspaceManager
Workspace
object represents a "view" of an actual repository workspace entity as seen through the authorization settings of its associated Session
. Each Workspace
object is associated one-to-one with a Session
object. The Workspace
object can be acquired by calling {@link Session#getWorkspace()}
on the associated Session
object.
Workspaces are server-defined groups of Collections.
Major areas of functionality are farmed off to various manager classes. Open a type hierarchy on {@link IManager} to see all the different managers. Eachmanager is typically referenced three times in this class: Once in {@link #startup(IProgressMonitor)}when it is instantiated, once in {@link #shutdown(IProgressMonitor)} when itis destroyed, and once in a manager accessor method.
Workpace is a top concept in Gephi because all models that modules possesses are usually divided by workspace, for instance one GraphModel
per workspace. Therefore this class has a Lookup mechanism to let modules store their model in the workspace's lookup and query it when needed.
To know how you can manage loading and saving data in Gephi project files, see {@link WorkspacePersistenceProvider}.
add()
method when initialize: public void initialize(Workspace workspace) { workspace.add(new MyDataModel()) }When a workspace is selected, retrieve the workspace's data model:
public void select(Workspace workspace) { MyDataModel model = workspace.getLookup().lookup(MyDataModel.class); }@author Mathieu Bastian
Left as loose container in order to use for various purposes.
equals and hashCode are intentionally NOT implemented
Check for nulls.
If instantiated via a creation class, you can expect these fields to be set for you:
IndexReader
, and after that on the IndexWriter
To make safe changes to the objects in a workspace, a thread must write-synchronize using the following code:
try { _workspace.getWriteAccess(); // ... code that writes } finally { _workspace.doneWriting(); }Again, the call to doneWriting() is essential, or the workspace will remain permanently locked to either reading or writing.
Note that it is not necessary to obtain a write lock just to add an item to the workspace directory. The methods for accessing the directory are all synchronized, so there is no risk of any thread reading an inconsistent state. @author Edward A. Lee, Mudit Goel, Lukito Muliadi, Xiaojun Liu @version $Id: Workspace.java,v 1.108 2006/09/21 15:45:37 cxh Exp $ @since Ptolemy II 0.2 @Pt.ProposedRating Green (liuxj) @Pt.AcceptedRating Green (liuxj)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|