CVS: jcontainer/loom/engine/src/java/org/jcontainer/loom/components/classloader DefaultClassLoaderManager.java,1.11,1.12 PolicyClassLoader.java,1.4,1.5 SarLoaderResolver.java,1.7,1.8 SarPolicy.java,1.4,1.5 SarPolicyResolver.java,1.7,1.8 SarPolicyVerifier.java,1.5,1.6
Peter Donald <pdonald-yCVjj/[email protected]> Sat, 29 Nov 2003 07:44:49 -0600
| Newsgroups | gmane.comp.java.jcontainer.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/jcontainer/jcontainer/loom/engine/src/java/org/jcontainer/loom/components/classloader
In directory hogshead.codehaus.org:/tmp/cvs-serv31016/loom/engine/src/java/org/jcontainer/loom/components/classloader
Modified Files:
DefaultClassLoaderManager.java PolicyClassLoader.java
SarLoaderResolver.java SarPolicy.java SarPolicyResolver.java
SarPolicyVerifier.java
Log Message:
Remove email addie
Index: DefaultClassLoaderManager.java
===================================================================
RCS file: /cvsroot/jcontainer/jcontainer/loom/engine/src/java/org/jcontainer/loom/components/classloader/DefaultClassLoaderManager.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- DefaultClassLoaderManager.java 16 Oct 2003 14:45:45 -0000 1.11
+++ DefaultClassLoaderManager.java 29 Nov 2003 13:44:15 -0000 1.12
@@ -120,18 +120,17 @@
import org.w3c.dom.Element;
/**
- * Component that creates and manages the {@link ClassLoader}
- * for an application loaded out of a <tt>.sar</tt> deployment.
+ * Component that creates and manages the {@link ClassLoader} for an application
+ * loaded out of a <tt>.sar</tt> deployment.
*
- * <p>Currently it creates a policy based on the policy declaration
- * in the configuration. It then just creates a URLClassLoader and
- * populates it with the specified codebase {@link URL}s.</p>
+ * <p>Currently it creates a policy based on the policy declaration in the
+ * configuration. It then just creates a URLClassLoader and populates it with
+ * the specified codebase {@link URL}s.</p>
*
- * <p>In the future this class will scan the manifests for "Optional
- * Packages" formely called "Extensions" which it will add to the
- * {@link ClassLoader}</p>
+ * <p>In the future this class will scan the manifests for "Optional Packages"
+ * formely called "Extensions" which it will add to the {@link ClassLoader}</p>
*
- * @author <a href="mailto:peter at realityforge.org">Peter Donald</a>
+ * @author Peter Donald
* @see ClassLoaderManager
*/
public class DefaultClassLoaderManager
@@ -139,37 +138,31 @@
implements ClassLoaderManager, Composable, Active
{
/**
- * Constant for name of element that indicates custom
- * classloader tree to define.
+ * Constant for name of element that indicates custom classloader tree to
+ * define.
*/
private static final String CLASSLOADERS_ELEMENT = "classloaders";
/**
- * Component to manage "Optional Packages" aka
- * Extensions to allow programs to declare dependencies
- * on such extensions.
+ * Component to manage "Optional Packages" aka Extensions to allow programs
+ * to declare dependencies on such extensions.
*/
private PackageManager m_packageManager;
/**
- * Parent ClassLoader for all applications
- * aka as the "common" classloader.
+ * Parent ClassLoader for all applications aka as the "common" classloader.
*/
private ClassLoader m_commonClassLoader;
- /**
- * The utility class used to verify {@link ClassLoaderMetaData} objects.
- */
+ /** The utility class used to verify {@link ClassLoaderMetaData} objects. */
private final ClassLoaderVerifier m_verifier = new ClassLoaderVerifier();
- /**
- * Utility class to build map of {@link ClassLoader} objects.
- */
+ /** Utility class to build map of {@link ClassLoader} objects. */
private final LoaderBuilder m_builder = new LoaderBuilder();
/**
- * Utility class to read {@link ClassLoaderSetMetaData} objects
- * from XML trees.
+ * Utility class to read {@link ClassLoaderSetMetaData} objects from XML
+ * trees.
*/
private final ClassLoaderSetReader m_reader = new ClassLoaderSetReader();
@@ -179,14 +172,10 @@
*/
private Map m_predefinedLoaders;
- /**
- * The contextdata used in interpolation of the policy configuration file.
- */
+ /** The contextdata used in interpolation of the policy configuration file. */
private final Map m_data = new HashMap();
- /**
- * The property expander that will expand properties in the policy configuraiton file.
- */
+ /** The property expander that will expand properties in the policy configuraiton file. */
private final PropertyExpander m_expander = new PropertyExpander();
/**
@@ -224,26 +213,30 @@
}
/**
- * Create a {@link ClassLoader} for a specific application.
- * See Class Javadoc for description of technique for creating
- * {@link ClassLoader}.
+ * Create a {@link ClassLoader} for a specific application. See Class
+ * Javadoc for description of technique for creating {@link ClassLoader}.
*
- * @param environment the configuration "environment.xml" for the application
+ * @param environment the configuration "environment.xml" for the
+ * application
* @param homeDirectory the base directory of application
* @param workDirectory the work directory of application
* @return the ClassLoader created
* @throws Exception if an error occurs
*/
- public ClassLoaderSet createClassLoaderSet( final Configuration environment,
- final Map data,
- final File homeDirectory,
- final File workDirectory )
+ public ClassLoaderSet createClassLoaderSet(
+ final Configuration environment,
+ final Map data,
+ final File homeDirectory,
+ final File workDirectory )
throws Exception
{
//Configure policy
final Configuration policyConfig = environment.getChild( "policy" );
final Policy policy =
- configurePolicy( policyConfig, data, homeDirectory, workDirectory );
+ configurePolicy( policyConfig,
+ data,
+ homeDirectory,
+ workDirectory );
final ClassLoaderSetMetaData metaData =
getLoaderMetaData( environment );
@@ -255,7 +248,9 @@
homeDirectory, workDirectory );
setupLogger( resolver );
final Map map =
- m_builder.buildClassLoaders( metaData, resolver, m_predefinedLoaders );
+ m_builder.buildClassLoaders( metaData,
+ resolver,
+ m_predefinedLoaders );
final ClassLoader defaultClassLoader =
(ClassLoader)map.get( metaData.getDefault() );
return new ClassLoaderSet( defaultClassLoader, map );
@@ -263,13 +258,14 @@
/**
* Extract the {@link ClassLoaderMetaData} from the environment
- * configuration. If no <classloader/> section is defined
- * in the config file then a default metadata will be created.
+ * configuration. If no <classloader/> section is defined in the
+ * config file then a default metadata will be created.
*
* @param environment the environment configuration
* @return the {@link ClassLoaderMetaData} object
*/
- private ClassLoaderSetMetaData getLoaderMetaData( final Configuration environment )
+ private ClassLoaderSetMetaData getLoaderMetaData(
+ final Configuration environment )
throws Exception
{
final boolean loaderDefined = isClassLoaderDefined( environment );
@@ -279,16 +275,17 @@
}
else
{
- final Configuration loaderConfig = environment.getChild( CLASSLOADERS_ELEMENT );
+ final Configuration loaderConfig = environment.getChild(
+ CLASSLOADERS_ELEMENT );
final Element element = ConfigurationUtil.toElement( loaderConfig );
return m_reader.build( element );
}
}
/**
- * Create the default {@link ClassLoaderSetMetaData}. The
- * default metadata includes all jars in the /SAR-INF/lib/ directory
- * in addition to the /SAR-INF/classes/ directory.
+ * Create the default {@link ClassLoaderSetMetaData}. The default metadata
+ * includes all jars in the /SAR-INF/lib/ directory in addition to the
+ * /SAR-INF/classes/ directory.
*
* @return the default {@link ClassLoaderSetMetaData} object
*/
@@ -306,9 +303,14 @@
final Extension[] extensions = new Extension[ 0 ];
final FileSetMetaData[] filesets = new FileSetMetaData[]{fileSet};
final ClassLoaderMetaData loader =
- new ClassLoaderMetaData( name, parent, entrys, extensions, filesets );
+ new ClassLoaderMetaData( name,
+ parent,
+ entrys,
+ extensions,
+ filesets );
final String[] predefined = new String[]{parent};
- final ClassLoaderMetaData[] classLoaders = new ClassLoaderMetaData[]{loader};
+ final ClassLoaderMetaData[] classLoaders = new ClassLoaderMetaData[]{
+ loader};
final JoinMetaData[] joins = new JoinMetaData[ 0 ];
return
new ClassLoaderSetMetaData( name,
@@ -318,10 +320,12 @@
}
/**
- * Return true if environment config defines "classloader" element, false otherwise.
+ * Return true if environment config defines "classloader" element, false
+ * otherwise.
*
* @param environment the environment config
- * @return true if environment config defines "classloader" element, false otherwise.
+ * @return true if environment config defines "classloader" element, false
+ * otherwise.
*/
private boolean isClassLoaderDefined( final Configuration environment )
{
Index: PolicyClassLoader.java
===================================================================
RCS file: /cvsroot/jcontainer/jcontainer/loom/engine/src/java/org/jcontainer/loom/components/classloader/PolicyClassLoader.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- PolicyClassLoader.java 5 Nov 2003 04:06:37 -0000 1.4
+++ PolicyClassLoader.java 29 Nov 2003 13:44:15 -0000 1.5
@@ -97,12 +97,12 @@
import org.jcontainer.dna.Logger;
/**
- * Classloader that uses a specified {@link Policy} object
- * rather than system {@link Policy} object.
+ * Classloader that uses a specified {@link Policy} object rather than system
+ * {@link Policy} object.
*
* <p>Note that parts of this were cloned from other projects</p>
*
- * @author <a href="mailto:peter at realityforge.org">Peter Donald</a>
+ * @author Peter Donald
*/
class PolicyClassLoader
extends URLClassLoader
@@ -115,8 +115,8 @@
private Logger m_logger;
/**
- * Construct a ClassLoader using specified URLs, parent
- * ClassLoader and Policy object.
+ * Construct a ClassLoader using specified URLs, parent ClassLoader and
+ * Policy object.
*
* @param urls the URLs to load resources from
* @param parent the parent ClassLoader
@@ -140,9 +140,8 @@
}
/**
- * Overide findClass to log debugging information
- * indicating that a class is being loaded from application
- * ClassLoader.
+ * Overide findClass to log debugging information indicating that a class is
+ * being loaded from application ClassLoader.
*
* @param name the name of class ot load
* @return the Class loaded
@@ -159,8 +158,8 @@
}
/**
- * Overide so we can have a per-application security policy with
- * no side-effects to other applications.
+ * Overide so we can have a per-application security policy with no
+ * side-effects to other applications.
*
* @param codeSource the codeSource to get permissions for
* @return the PermissionCollection
@@ -175,9 +174,9 @@
}
/**
- * Return an enumeration of {@link URL}s representing all of the
- * resources with the given name. If no resources with this name are found,
- * return an empty enumeration.
+ * Return an enumeration of {@link URL}s representing all of the resources
+ * with the given name. If no resources with this name are found, return an
+ * empty enumeration.
*
* <p>Note that this method is overidden to provide debugging
* information.</p>
@@ -198,9 +197,8 @@
}
/**
- * Find the resource in the ClassLoader. Return a {@link URL}
- * object if found, otherwise return null if this resource cannot
- * be found.
+ * Find the resource in the ClassLoader. Return a {@link URL} object if
+ * found, otherwise return null if this resource cannot be found.
*
* <p>Note that this method is overidden to provide debugging
* information.</p>
Index: SarLoaderResolver.java
===================================================================
RCS file: /cvsroot/jcontainer/jcontainer/loom/engine/src/java/org/jcontainer/loom/components/classloader/SarLoaderResolver.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- SarLoaderResolver.java 11 Nov 2003 11:29:51 -0000 1.7
+++ SarLoaderResolver.java 29 Nov 2003 13:44:15 -0000 1.8
@@ -94,19 +94,19 @@
import org.jcontainer.dna.LogEnabled;
import org.jcontainer.dna.Logger;
import org.jcontainer.dna.impl.ContainerUtil;
-import org.jcontainer.loom.components.extensions.pkgmgr.PackageManager;
import org.jcontainer.loom.components.extensions.pkgmgr.OptionalPackage;
+import org.jcontainer.loom.components.extensions.pkgmgr.PackageManager;
import org.jcontainer.loom.components.util.ResourceUtil;
-import org.realityforge.salt.i18n.ResourceManager;
-import org.realityforge.salt.i18n.Resources;
import org.realityforge.classman.builder.SimpleLoaderResolver;
import org.realityforge.extension.Extension;
+import org.realityforge.salt.i18n.ResourceManager;
+import org.realityforge.salt.i18n.Resources;
/**
- * a LoaderResolver that knows about container environment,
- * and the way it is split across multiple directories.
+ * a LoaderResolver that knows about container environment, and the way it is
+ * split across multiple directories.
*
- * @author <a href="mailto:peter at realityforge.org">Peter Donald</a>
+ * @author Peter Donald
* @version $Revision$ $Date$
*/
class SarLoaderResolver
@@ -116,30 +116,21 @@
private final static Resources REZ =
ResourceManager.getPackageResources( SarLoaderResolver.class );
- /**
- * The PackageManager to use to resolve Extensions.
- */
+ /** The PackageManager to use to resolve Extensions. */
private PackageManager m_manager;
- /**
- * Logger to use when reporting information
- */
+ /** Logger to use when reporting information */
private Logger m_logger;
- /**
- * The policy object to use when creating ClassLoaders
- */
+ /** The policy object to use when creating ClassLoaders */
private Policy m_policy;
- /**
- * Base work directory for application.
- */
+ /** Base work directory for application. */
private File m_workDirectory;
/**
- * Create a resolver for a jar.
- * The resolver merges both the work and base directory
- * hierarchies.
+ * Create a resolver for a jar. The resolver merges both the work and base
+ * directory hierarchies.
*
* @param manager the PackageManager
* @param policy the policy to use when creating classloaders
@@ -216,8 +207,8 @@
}
/**
- * Resolve a fileset. Make sure it is resolved against
- * both the work and the base directories of application.
+ * Resolve a fileset. Make sure it is resolved against both the work and the
+ * base directories of application.
*
* @param baseDirectory the base directory of fileset
* @param includes the fileset includes
@@ -231,12 +222,22 @@
throws Exception
{
final URL[] baseURLs =
- resolveFileSet( getBaseDirectory(), baseDirectory, includes, excludes );
+ resolveFileSet( getBaseDirectory(),
+ baseDirectory,
+ includes,
+ excludes );
final URL[] workURLs =
- resolveFileSet( m_workDirectory, baseDirectory, includes, excludes );
+ resolveFileSet( m_workDirectory,
+ baseDirectory,
+ includes,
+ excludes );
final URL[] urls = new URL[ baseURLs.length + workURLs.length ];
System.arraycopy( baseURLs, 0, urls, 0, baseURLs.length );
- System.arraycopy( workURLs, 0, urls, baseURLs.length, workURLs.length );
+ System.arraycopy( workURLs,
+ 0,
+ urls,
+ baseURLs.length,
+ workURLs.length );
return urls;
}
Index: SarPolicy.java
===================================================================
RCS file: /cvsroot/jcontainer/jcontainer/loom/engine/src/java/org/jcontainer/loom/components/classloader/SarPolicy.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- SarPolicy.java 5 Oct 2003 10:07:03 -0000 1.4
+++ SarPolicy.java 29 Nov 2003 13:44:15 -0000 1.5
@@ -98,7 +98,7 @@
/**
* Policy that extracts information from policy files.
*
- * @author <a href="mailto:peter at realityforge.org">Peter Donald</a>
+ * @author Peter Donald
*/
class SarPolicy
extends DefaultPolicy
@@ -133,7 +133,8 @@
{
if( m_logger.isDebugEnabled() )
{
- m_logger.debug( "getPermissions(" + codeSource.getLocation() + ");" );
+ m_logger.debug(
+ "getPermissions(" + codeSource.getLocation() + ");" );
}
return super.getPermissions( codeSource );
Index: SarPolicyResolver.java
===================================================================
RCS file: /cvsroot/jcontainer/jcontainer/loom/engine/src/java/org/jcontainer/loom/components/classloader/SarPolicyResolver.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- SarPolicyResolver.java 11 Nov 2003 11:29:51 -0000 1.7
+++ SarPolicyResolver.java 29 Nov 2003 13:44:15 -0000 1.8
@@ -96,10 +96,10 @@
import org.realityforge.xmlpolicy.builder.PolicyResolver;
/**
- * A basic resolver that resolves container specific features.
- * (like remapping URLs).
+ * A basic resolver that resolves container specific features. (like remapping
+ * URLs).
*
- * @author <a href="mailto:peter at realityforge.org">Peter Donald</a>
+ * @author Peter Donald
* @version $Revision$ $Date$
*/
class SarPolicyResolver
Index: SarPolicyVerifier.java
===================================================================
RCS file: /cvsroot/jcontainer/jcontainer/loom/engine/src/java/org/jcontainer/loom/components/classloader/SarPolicyVerifier.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- SarPolicyVerifier.java 16 Oct 2003 14:45:45 -0000 1.5
+++ SarPolicyVerifier.java 29 Nov 2003 13:44:15 -0000 1.6
@@ -93,7 +93,7 @@
/**
* A simple adapter for verifier to support logging to container subsystems.
*
- * @author <a href="mailto:peter at realityforge.org">Peter Donald</a>
+ * @author Peter Donald
* @version $Revision$ $Date$
*/
class SarPolicyVerifier