org.apache.avalon.tools.model
Class Magic

java.lang.Object
  extended byorg.apache.tools.ant.ProjectComponent
      extended byorg.apache.tools.ant.types.DataType
          extended byorg.apache.avalon.tools.model.Magic

public class Magic
extends org.apache.tools.ant.types.DataType

The Magic class is the application root of the magic system.

Version:
$Revision: 1.2 $ $Date: 2004/03/17 10:30:09 $
Author:
Avalon Development Team

Field Summary
static String CACHE_KEY
          Immutable key to the magic main cache directory.
static String DOCS_KEY
          Immutable key to the magic docs cache directory.
static String GUMP_SIGNATURE_KEY
          Immutable key to the gump signature identifier used when magic is executed under control of the gump integration plartform.
static String HOSTS_KEY
          Immutable key to a property declaring a set of repository hosts.
static String KEY
          Immutable key to the magic home.
static String PROXY_HOST_KEY
          Immutable key to the magic proxy hostname value.
static String PROXY_PASSWORD_KEY
          Immutable key to the magic proxy password value.
static String PROXY_PORT_KEY
          Immutable key to the magic proxy port value.
static String PROXY_USERNAME_KEY
          Immutable key to the magic proxy username value.
static String TEMPLATES_KEY
          Immutable key to the magic template directory.
 
Fields inherited from class org.apache.tools.ant.types.DataType
checked, description, ref
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
project
 
Method Summary
 Repository getDocsRepository()
          Return the magic doc repository cache directory.
 String getGumpSignature()
          Return the gump signature.
 Home getHome(org.apache.tools.ant.Project project, String value)
          Return the magic home.
 Repository getRepository()
          Return the magic artifact repository cache directory.
static Magic getSystem(org.apache.tools.ant.Project project)
          Utility operation to return the magic system assigned to the project.
 File getSystemDirectory()
          Return the magic system directory.
protected  void loadProperties(org.apache.tools.ant.Project project, File file)
          Utility method to load properties form a file.
 
Methods inherited from class org.apache.tools.ant.types.DataType
checkAttributesAllowed, checkChildrenAllowed, circularReference, dieOnCircularReference, getCheckedRef, getDescription, getRefid, isChecked, isReference, noChildrenAllowed, setChecked, setDescription, setRefid, tooManyAttributes
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject, log, log, setProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEY

public static final String KEY
Immutable key to the magic home.

See Also:
Constant Field Values

GUMP_SIGNATURE_KEY

public static final String GUMP_SIGNATURE_KEY
Immutable key to the gump signature identifier used when magic is executed under control of the gump integration plartform.

See Also:
Constant Field Values

HOSTS_KEY

public static final String HOSTS_KEY
Immutable key to a property declaring a set of repository hosts.

See Also:
Constant Field Values

CACHE_KEY

public static final String CACHE_KEY
Immutable key to the magic main cache directory.

See Also:
Constant Field Values

DOCS_KEY

public static final String DOCS_KEY
Immutable key to the magic docs cache directory.

See Also:
Constant Field Values

TEMPLATES_KEY

public static final String TEMPLATES_KEY
Immutable key to the magic template directory.

See Also:
Constant Field Values

PROXY_HOST_KEY

public static final String PROXY_HOST_KEY
Immutable key to the magic proxy hostname value.

See Also:
Constant Field Values

PROXY_PORT_KEY

public static final String PROXY_PORT_KEY
Immutable key to the magic proxy port value.

See Also:
Constant Field Values

PROXY_USERNAME_KEY

public static final String PROXY_USERNAME_KEY
Immutable key to the magic proxy username value.

See Also:
Constant Field Values

PROXY_PASSWORD_KEY

public static final String PROXY_PASSWORD_KEY
Immutable key to the magic proxy password value.

See Also:
Constant Field Values
Method Detail

getSystem

public static Magic getSystem(org.apache.tools.ant.Project project)
Utility operation to return the magic system assigned to the project.

Parameters:
project - the ant project
Returns:
the assigned magic system

getSystemDirectory

public File getSystemDirectory()
Return the magic system directory.

Returns:
the system directory

getRepository

public Repository getRepository()
Return the magic artifact repository cache directory.

Returns:
the main cache directory

getDocsRepository

public Repository getDocsRepository()
Return the magic doc repository cache directory.

Returns:
the docs cache directory

getGumpSignature

public String getGumpSignature()
Return the gump signature. If not null magic we assume that magic is running under gump.

Returns:
the gump signature

getHome

public Home getHome(org.apache.tools.ant.Project project,
                    String value)
Return the magic home. Current implementation is restricted to a a single stqtic home. Future implementations may relax this restriction.

Parameters:
project - the current project
value - a value used to resolve the home index if needed
Returns:
the home instance

loadProperties

protected void loadProperties(org.apache.tools.ant.Project project,
                              File file)
                       throws org.apache.tools.ant.BuildException
Utility method to load properties form a file.

Parameters:
project - the project into which properties shall be loaded
file - the file from which properties will be loaded
Throws:
org.apache.tools.ant.BuildException