mcconnell 2003/11/20 14:44:23
Modified: repository/main/src/java/org/apache/avalon/repository
Bootstrapper.java InitialRepositoryFactory.java
Log:
Update initial factory to support default constructor.
Revision Changes Path
1.7 +16 -13
avalon-sandbox/repository/main/src/java/org/apache/avalon/repository/Bootstrapper.java
Index: Bootstrapper.java
===================================================================
RCS file:
/home/cvs/avalon-sandbox/repository/main/src/java/org/apache/avalon/repository/Bootstrapper.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- Bootstrapper.java 20 Nov 2003 04:19:07 -0000 1.6
+++ Bootstrapper.java 20 Nov 2003 22:44:23 -0000 1.7
@@ -469,14 +469,16 @@
System.exit( -1 );
}
- String l_fqcn = getMainClassname( a_args );
- if( null == l_fqcn )
- {
- final String error =
- "Cannot resolve an main class.";
- System.out.println( error );
- System.exit( -1 );
- }
+ // SJM: disabled main class aquistion for the moment
+
+ //String l_fqcn = getMainClassname( a_args );
+ //if( null == l_fqcn )
+ //{
+ // final String error =
+ // "Cannot resolve an main class.";
+ // System.out.println( error );
+ // System.exit( -1 );
+ //}
String[] l_repositories = DEFAULT_REPOSITORIES; // need to handle this via
args
@@ -486,20 +488,21 @@
try
{
+ System.out.println("initiating repository creation" );
InitialRepositoryFactory l_factory =
new InitialRepositoryFactory( l_repositories ) ;
RepositoryContext l_context = l_factory.getDefaultContext();
l_repository = l_factory.create( l_context ) ;
+ System.out.println("repository established" );
System.out.println(
- "local cache: ["
- + l_repository.getLocation()
- + "]");
+ "cache: "
+ + l_repository.getLocation() );
l_bootstrapper = new Bootstrapper( l_repository, l_jar ) ;
- System.out.println("established: " + l_jarSpec );
+ System.out.println("classloader established: " + l_jarSpec );
//l_bootstrapper.main( l_fqcn, a_args ) ;
}
1.9 +16 -4
avalon-sandbox/repository/main/src/java/org/apache/avalon/repository/InitialRepositoryFactory.java
Index: InitialRepositoryFactory.java
===================================================================
RCS file:
/home/cvs/avalon-sandbox/repository/main/src/java/org/apache/avalon/repository/InitialRepositoryFactory.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- InitialRepositoryFactory.java 20 Nov 2003 05:41:00 -0000 1.8
+++ InitialRepositoryFactory.java 20 Nov 2003 22:44:23 -0000 1.9
@@ -228,8 +228,9 @@
//
m_repositories = repositories;
- Properties l_props = RepositoryUtils.getProperties( m_repositories,
implementation ) ;
- Attributes l_attrs = RepositoryUtils.getAsAttributes( l_props ) ;
+ Properties l_props =
+ RepositoryUtils.getProperties( m_repositories, implementation ) ;
+ Attributes attributes = RepositoryUtils.getAsAttributes( l_props ) ;
//
// Download every dependency referenced by the implementation into the
@@ -243,7 +244,7 @@
try
{
NamingEnumeration l_list =
- l_attrs.get( AVALON_ARTIFACT_DEPENDENCY ).getAll() ;
+ attributes.get( AVALON_ARTIFACT_DEPENDENCY ).getAll() ;
while ( l_list.hasMore() )
{
l_spec = ( String ) l_list.next() ;
@@ -321,6 +322,17 @@
// RepositoryFactory
// ------------------------------------------------------------------------
+ /**
+ * Creates a new Repository using a defaults.
+ *
+ * @return the newly created Repository
+ * @throws RepositoryException if there is a problem creating the Repository
+ */
+ public Repository create() throws RepositoryException
+ {
+ return create( getDefaultContext() );
+ }
+
/**
* Factory method that creates a repository by calling the delegate factory.
*
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]