public final class WorkspaceList extends Object
Computer
to keep track of workspaces that are actively in use.Computer.getWorkspaceList()
Modifier and Type | Class and Description |
---|---|
static class |
WorkspaceList.Entry
Book keeping for workspace allocation.
|
static class |
WorkspaceList.Lease
Represents a leased workspace that needs to be returned later.
|
Constructor and Description |
---|
WorkspaceList() |
Modifier and Type | Method and Description |
---|---|
WorkspaceList.Lease |
acquire(FilePath p)
Acquires the given workspace.
|
WorkspaceList.Lease |
acquire(FilePath p,
boolean quick)
|
WorkspaceList.Lease |
acquire(FilePath p,
boolean quick,
Object context)
|
WorkspaceList.Lease |
allocate(FilePath base)
Allocates a workspace by adding some variation to the given base to make it unique.
|
WorkspaceList.Lease |
allocate(FilePath base,
Object context)
|
WorkspaceList.Lease |
record(FilePath p)
Just record that this workspace is being used, without paying any attention to the synchronization support.
|
public WorkspaceList.Lease allocate(@Nonnull FilePath base) throws InterruptedException
This method doesn't block prolonged amount of time. Whenever a desired workspace is in use, the unique variation is added.
InterruptedException
public WorkspaceList.Lease allocate(@Nonnull FilePath base, Object context) throws InterruptedException
context
- Threads that share the same context can re-acquire the same lock (which will just increment the lock count.)
This allows related executors to share the same workspace.InterruptedException
public WorkspaceList.Lease record(@Nonnull FilePath p)
public WorkspaceList.Lease acquire(@Nonnull FilePath p) throws InterruptedException
FilePath
as given to this method.InterruptedException
public WorkspaceList.Lease acquire(@Nonnull FilePath p, boolean quick) throws InterruptedException
quick
- If true, indicates that the acquired workspace will be returned quickly.
This makes other calls to allocate(FilePath)
to wait for the release of this workspace.InterruptedException
public WorkspaceList.Lease acquire(@Nonnull FilePath p, boolean quick, Object context) throws InterruptedException
context
- Threads that share the same context can re-acquire the same lock (which will just increment the lock count.)
This allows related executors to share the same workspace.InterruptedException
Copyright © 2014. All rights reserved.