donaldp 2002/08/31 17:43:54
Added: src/java/org/apache/avalon/phoenix/components/cpbuilder/metadata
ClassloaderDef.java EntryDef.java FilesetDef.java
JoinDef.java
Log:
Start adding metadata to describe ClassLoader hierarchies
Revision Changes Path
1.1
jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/cpbuilder/metadata/ClassloaderDef.java
Index: ClassloaderDef.java
===================================================================
/*
* Copyright (C) The Apache Software Foundation. All rights reserved.
*
* This software is published under the terms of the Apache Software License
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE.txt file.
*/
package org.apache.avalon.phoenix.components.cpbuilder.metadata;
import org.apache.avalon.excalibur.extension.Extension;
/**
* This class defines a specific classloader, made up of
* {@link EntryDef}, {@link Extension} and
* {@link FilesetDef} objects.
*
* @author <a href="mailto:peter at apache.org">Peter Donald</a>
* @version $Revision: 1.1 $ $Date: 2002/09/01 00:43:54 $
*/
public class ClassloaderDef
{
/**
* The name of the current classloader.
* This may be used by other ClassLoader definitions to refer
* to this ClassLoader.
*/
private final String m_name;
/**
* The name of the parent classloader.
*/
private final String m_parent;
/**
* The Entrys that are added to this ClassLoader.
*/
private final EntryDef[] m_entrys;
/**
* The Entrys that are required by this ClassLoader.
*/
private final Extension[] m_extensions;
/**
* The Filesets that are added to this ClassLoader.
*/
private final FilesetDef[] m_filesets;
public ClassloaderDef( final String name,
final String parent,
final EntryDef[] elements,
final Extension[] extensions,
final FilesetDef[] filesets )
{
m_name = name;
m_parent = parent;
m_entrys = elements;
m_extensions = extensions;
m_filesets = filesets;
}
/**
* Return the name of Classloader.
*
* @return the name of Classloader.
* @see #m_name
*/
public String getName()
{
return m_name;
}
/**
* Return the name of parent Classloader.
*
* @return the name of parent Classloader.
* @see #m_parent
*/
public String getParent()
{
return m_parent;
}
/**
* Return the elements added to Classloader.
*
* @return the elements added to Classloader.
* @see #m_entrys
*/
public EntryDef[] getEntrys()
{
return m_entrys;
}
/**
* Return the extensions added to Classloader.
*
* @return the extensions added to Classloader.
* @see #m_extensions
*/
public Extension[] getExtensions()
{
return m_extensions;
}
/**
* Return the filesets added to Classloader.
*
* @return the filesets added to Classloader.
* @see #m_filesets
*/
public FilesetDef[] getFilesets()
{
return m_filesets;
}
}
1.1
jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/cpbuilder/metadata/EntryDef.java
Index: EntryDef.java
===================================================================
/*
* Copyright (C) The Apache Software Foundation. All rights reserved.
*
* This software is published under the terms of the Apache Software License
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE.txt file.
*/
package org.apache.avalon.phoenix.components.cpbuilder.metadata;
/**
* This class defines a specific URL to add to a ClassLoader.
* It uses the same resolution semantics as the
* {@link java.security.CodeSource} class. In other words,
* locations that end with a '/' character are considered to
* be a directory in which .class files are stored. All other
* locations are considered to be jar files.
*
* @author <a href="mailto:peter at apache.org">Peter Donald</a>
* @version $Revision: 1.1 $ $Date: 2002/09/01 00:43:54 $
*/
public class EntryDef
{
private final String m_location;
/**
* Construct a entry with specified location.
*
* @param location the location (must not be null)
*/
public EntryDef( final String location )
{
if( null == location )
{
throw new NullPointerException( "location" );
}
m_location = location;
}
/**
* Return the location associated with Entry.
*
* @return the location associated with Entry.
*/
public String getLocation()
{
return m_location;
}
}
1.1
jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/cpbuilder/metadata/FilesetDef.java
Index: FilesetDef.java
===================================================================
/*
* Copyright (C) The Apache Software Foundation. All rights reserved.
*
* This software is published under the terms of the Apache Software License
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE.txt file.
*/
package org.apache.avalon.phoenix.components.cpbuilder.metadata;
/**
* This class represent a set of files anchored in a base
* directory. The set of files is determined by the include and
* excludes that are specified for fileset. If no includes or
* excludes are specified then all files in base directory
* are added to fileset.
*
* @author <a href="mailto:peter at apache.org">Peter Donald</a>
* @version $Revision: 1.1 $ $Date: 2002/09/01 00:43:54 $
*/
public class FilesetDef
{
/**
* The base directory from which to apply all the
* includes/excludes.
*/
private final String m_baseDirectory;
/**
* The set of patterns to include in fileset.
*/
private final String[] m_includes;
/**
* The set of patterns to exclude from fileset.
*/
private final String[] m_excludes;
public FilesetDef( final String baseDirectory,
final String[] includes,
final String[] excludes )
{
if( null == baseDirectory )
{
throw new NullPointerException( "baseDirectory" );
}
if( null == includes )
{
throw new NullPointerException( "includes" );
}
if( null == excludes )
{
throw new NullPointerException( "excludes" );
}
m_baseDirectory = baseDirectory;
m_includes = includes;
m_excludes = excludes;
}
/**
* Return the base directory of fileset.
*
* @return the base directory of fileset.
*/
public String getBaseDirectory()
{
return m_baseDirectory;
}
/**
* Return the list of includes for fileset.
*
* @return the list of includes for fileset.
*/
public String[] getIncludes()
{
return m_includes;
}
/**
* Return the list of excludes for fileset.
*
* @return the list of excludes for fileset.
*/
public String[] getExcludes()
{
return m_excludes;
}
}
1.1
jakarta-avalon-phoenix/src/java/org/apache/avalon/phoenix/components/cpbuilder/metadata/JoinDef.java
Index: JoinDef.java
===================================================================
/*
* Copyright (C) The Apache Software Foundation. All rights reserved.
*
* This software is published under the terms of the Apache Software License
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE.txt file.
*/
package org.apache.avalon.phoenix.components.cpbuilder.metadata;
/**
* This class defines a classloader that "merges" multiple
* classloaders. For this to be successful, it is required that
* the ClassLoaders contain disjoint sets of classes (with the
* exception of classes loaded from the system classpath).
*
* @author <a href="mailto:peter at apache.org">Peter Donald</a>
* @version $Revision: 1.1 $ $Date: 2002/09/01 00:43:54 $
*/
public class JoinDef
{
/**
* The name of the current classloader.
* This may be used by other ClassLoader definitions to refer
* to this ClassLoader.
*/
private final String m_name;
/**
* The list of classloaders that are merged in
* this classloader.
*/
private final String[] m_classloaders;
/**
* The definition for set of classloaders
*
* @param name
* @param classloaders
*/
public JoinDef( final String name,
final String[] classloaders )
{
m_name = name;
m_classloaders = classloaders;
}
/**
* Return the name of Classloader.
*
* @return the name of Classloader.
* @see #m_name
*/
public String getName()
{
return m_name;
}
/**
* Return the list of classloaders that are merged in
* this classloader
*
* @return the list of classloaders that are merged
* in this classloader
* @see #m_classloaders
*/
public String[] getClassloaders()
{
return m_classloaders;
}
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>