|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnl.toolforge.karma.core.boot.WorkingContext
A WorkingContext
is used by Karma to determine the environment in which the user wants to use Karma. A
working context is represented on your local harddisk by a directory in which a developers' project work will be
stored. The WorkingContext
class is the bridge from Karma domain objects (Manifest
and
Module
to name the most important ones) to a developer's harddisk.
A WorkingContext should be configured before it can be constructed. The
configure(WorkingContextConfiguration)
-method should be called to configure a WorkingContext.
Field Summary | |
static ErrorCode |
CANNOT_REMOVE_ACTIVE_WORKING_CONTEXT
|
static java.lang.String |
CONFIGURATION_BASE_DIRECTORY
|
static java.lang.String |
DEFAULT
The default working context. |
static java.lang.String |
LOCATION_STORE_MODULE
|
static java.lang.String |
MANIFEST_STORE_MODULE
|
static java.lang.String |
PROJECT_BASE_DIRECTORY_PROPERTY
Property indicating the base directory for development projects. |
static java.lang.String |
PROJECT_LOCAL_REPOSITORY_PROPERTY
Property indicating the root of a repository directory `Maven style`. |
static java.lang.String |
WORKING_CONTEXT_PREFERENCE
|
Constructor Summary | |
WorkingContext(java.lang.String workingContext)
Constructs a WorkingContext in the default configuration base directory. |
|
WorkingContext(java.lang.String workingContext,
java.io.File configBaseDir)
Constructs a WorkingContext with configBaseDir as the configuration base directory. |
Method Summary | |
void |
configure(WorkingContextConfiguration configuration)
|
java.io.File |
getAdminDir()
Returns a File reference to the administration directory for the working context. |
WorkingContextConfiguration |
getConfiguration()
Get the configuration for this working context or null it this working context had not been
configured. |
static java.io.File |
getConfigurationBaseDir()
Returns a File reference to the default base directory for Karma configuration files. |
java.lang.String |
getContextManifestPreference()
Determines the last used manifest for this working context. |
static java.io.File |
getKarmaHome()
|
static java.io.File |
getLocalRepository()
See PROJECT_LOCAL_REPOSITORY_PROPERTY . |
LocationLoader |
getLocationLoader()
Returns a reference to the LocationLoader for the working context. |
java.io.File |
getLocationStoreBasedir()
Returns a File reference to the location store directory for the working context. |
ManifestCollector |
getManifestCollector()
Returns a reference to the ManifestCollector for the working context. |
ManifestLoader |
getManifestLoader()
Returns a reference to the ManifestLoader for the working context. |
java.io.File |
getManifestStoreBasedir()
Returns a File reference to the manifest store directory for the working context. |
java.lang.String |
getName()
Returns the name of this working context. |
java.io.File |
getProjectBaseDirectory()
Returns a File reference to the project base directory, which can be configured by the
projects.basedir property in the working-context.xml file. |
java.util.Properties |
getProperties()
Get the properties of this working context. |
java.io.File |
getWorkingContextConfigurationBaseDir()
Returns a File reference to the configuration directory for the current working context. |
void |
remove()
Removes a working contexts' configuration directory. |
java.lang.String |
toString()
Returns the working contexts' name. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final ErrorCode CANNOT_REMOVE_ACTIVE_WORKING_CONTEXT
public static final java.lang.String WORKING_CONTEXT_PREFERENCE
public static final java.lang.String CONFIGURATION_BASE_DIRECTORY
public static final java.lang.String PROJECT_BASE_DIRECTORY_PROPERTY
public static final java.lang.String PROJECT_LOCAL_REPOSITORY_PROPERTY
public static final java.lang.String MANIFEST_STORE_MODULE
public static final java.lang.String LOCATION_STORE_MODULE
public static final java.lang.String DEFAULT
Constructor Detail |
public WorkingContext(java.lang.String workingContext)
WorkingContext
in the default configuration base directory. The
configure(WorkingContextConfiguration)
-method should be called to configure this working context.
workingContext
- A working context name. If workingContext
doesn't match the \w+
pattern, DEFAULT
is assumed.public WorkingContext(java.lang.String workingContext, java.io.File configBaseDir)
WorkingContext
with configBaseDir
as the configuration base directory. When
configBaseDir
does not exist, it will be created. The configure(WorkingContextConfiguration)
-
method should be called to configure this working context.
workingContext
- A working context name. If workingContext
doesn't match the \w+
pattern, DEFAULT
is assumed.configBaseDir
- The configuration base directory. If the directory does not exist, it will be created.Method Detail |
public static java.io.File getConfigurationBaseDir()
File
reference to the default base directory for Karma configuration files. When the
directory does not exist, it is created.
File
reference to the default base directory for Karma configuration files.public void configure(WorkingContextConfiguration configuration)
public java.lang.String getName()
public WorkingContextConfiguration getConfiguration()
null
it this working context had not been
configured.
public java.util.Properties getProperties()
public void remove() throws java.io.IOException
java.io.IOException
public java.io.File getWorkingContextConfigurationBaseDir()
File
reference to the configuration directory for the current working context. When the
directory does not exist, it is created. This method will return the directory File
reference to
$HOME/.karma/working-contexts/<working-context-name>
.
File
reference to the configuration directory for the current working context.public java.io.File getProjectBaseDirectory()
File
reference to the project base directory, which can be configured by the
projects.basedir
property in the working-context.xml
file.
File
reference to the project base directory.public java.io.File getAdminDir()
File
reference to the administration directory for the working context. In the
administration directory, the manifest store and the location store are located for the current working context.
public java.io.File getManifestStoreBasedir()
File
reference to the manifest store directory for the working context. When the directory
does not exist, it will be created. In this directory, the manifest store will be checked out.
public java.io.File getLocationStoreBasedir()
File
reference to the location store directory for the working context. When the directory
does not exist, it will be created. In this directory, the location store will be checked out.
public static java.io.File getLocalRepository()
PROJECT_LOCAL_REPOSITORY_PROPERTY
. When the property is not set, the default repository is
assumed to be in getConfigurationBaseDir()
/.repository
.
PROJECT_LOCAL_REPOSITORY_PROPERTY
public static java.io.File getKarmaHome()
public java.lang.String getContextManifestPreference()
Determines the last used manifest for this working context. This fact is maintained in the .java
file
on a users' harddisk, as per the specification for java.template.prefs
, included in the JDK since
1.4
.
A String
made up of the working context name and karma.manifest.last
.
public LocationLoader getLocationLoader() throws LocationException
LocationLoader
for the working context.
LocationException
public ManifestCollector getManifestCollector()
ManifestCollector
for the working context.
public ManifestLoader getManifestLoader()
ManifestLoader
for the working context.
public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |