akarasulu 2003/11/12 21:13:08
Modified: kernel/spi project.xml
Added: kernel/spi/src/java/org/apache/avalon/merlin/kernel
KernelFactory.java DefaultKernelConfig.java
KernelConfig.java
Removed: kernel/spi/src/java/org/apache/avalon/merlin/kernel
Loader.java
Log:
Moving some stuff back into the SPI.
Revision Changes Path
1.1
avalon-sandbox/kernel/spi/src/java/org/apache/avalon/merlin/kernel/KernelFactory.java
Index: KernelFactory.java
===================================================================
/*
============================================================================
The Apache Software License, Version 1.1
============================================================================
Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without modifica-
tion, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. The end-user documentation included with the redistribution, if any, must
include the following acknowledgment: "This product includes software
developed by the Apache Software Foundation (http://www.apache.org/)."
Alternately, this acknowledgment may appear in the software itself, if
and wherever such third-party acknowledgments normally appear.
4. The names "Jakarta", "Apache Avalon", "Avalon Framework" and
"Apache Software Foundation" must not be used to endorse or promote
products derived from this software without prior written
permission. For written permission, please contact [EMAIL PROTECTED]
5. Products derived from this software may not be called "Apache", nor may
"Apache" appear in their name, without prior written permission of the
Apache Software Foundation.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This software consists of voluntary contributions made by many individuals
on behalf of the Apache Software Foundation. For more information on the
Apache Software Foundation, please see <http://www.apache.org/>.
*/
package org.apache.avalon.merlin.kernel ;
/**
* Interface used for factories that create Kernel instances.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Alex Karasulu</a>
* @author $Author: akarasulu $
* @version $Revision: 1.1 $
*/
public interface KernelFactory
{
/**
* Creates an instance of a Kernel based on configuration parameters.
*
* @param a_config the Kernel configuration to use
* @return the Kernel instance
* @throws KernelException if there is a problem instantiating the Kernel
*/
Kernel create( KernelConfig a_config ) throws KernelException ;
/**
* Creates a default Kernel configuration.
*
* @return the KernelConfig instance with default values populated
* @throws KernelException if there is a problem creating the KernelConfig
*/
KernelConfig getDefaultConfig() throws KernelException ;
}
1.1
avalon-sandbox/kernel/spi/src/java/org/apache/avalon/merlin/kernel/DefaultKernelConfig.java
Index: DefaultKernelConfig.java
===================================================================
/*
============================================================================
The Apache Software License, Version 1.1
============================================================================
Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without modifica-
tion, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. The end-user documentation included with the redistribution, if any, must
include the following acknowledgment: "This product includes software
developed by the Apache Software Foundation (http://www.apache.org/)."
Alternately, this acknowledgment may appear in the software itself, if
and wherever such third-party acknowledgments normally appear.
4. The names "Jakarta", "Apache Avalon", "Avalon Framework" and
"Apache Software Foundation" must not be used to endorse or promote
products derived from this software without prior written
permission. For written permission, please contact [EMAIL PROTECTED]
5. Products derived from this software may not be called "Apache", nor may
"Apache" appear in their name, without prior written permission of the
Apache Software Foundation.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This software consists of voluntary contributions made by many individuals
on behalf of the Apache Software Foundation. For more information on the
Apache Software Foundation, please see <http://www.apache.org/>.
*/
package org.apache.avalon.merlin.kernel ;
import org.apache.avalon.repository.RepositoryContext ;
/**
* Kernel configuration parameters.
*
* @todo finish and double check javadocs - ask Steve to take a look at em.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Alex Karasulu</a>
* @author $Author: akarasulu $
* @version $Revision: 1.1 $
*/
public class DefaultKernelConfig implements KernelConfig
{
/** flag for the kernel's server mode */
private boolean m_isServer ;
/** flag for the kernel's debug mode */
private boolean m_isDebug ;
/** flag for the kernel's info mode */
private boolean m_isInfo ;
/** the configuration url */
private String m_configUrl ;
/** the home directory for the Kernel instance */
private String m_homePath ;
/** the url to the kernel configuration */
private String m_kernelUrl ;
/** extention libraries to install */
private String m_libraryPath ;
/** the temp directory path */
private String m_tempPath ;
/** the block.xml files describing the blocks to install into the Kernel */
private String [] m_blockUrls ;
/** the system repository context */
private RepositoryContext m_sysCtx ;
/** the application repository context */
private RepositoryContext m_applCtx ;
/**
* @see org.apache.avalon.merlin.kernel.KernelConfig
* #getApplicationRepositoryContext()
*/
public RepositoryContext getApplicationRepositoryContext()
{
return m_applCtx ;
}
/**
* @see org.apache.avalon.merlin.kernel.KernelConfig#
* setApplicationRepositoryContext(
* org.apache.avalon.repository.RepositoryContext)
*/
public void setApplicationRepositoryContext( RepositoryContext a_applCtx )
{
m_applCtx = a_applCtx ;
}
/**
* @see org.apache.avalon.merlin.kernel.KernelConfig
* #getBlockUrls()
*/
public String[] getBlockUrls()
{
return m_blockUrls ;
}
/**
* @see org.apache.avalon.merlin.kernel.KernelConfig#setBlockUrls(
* java.lang.String[])
*/
public void setBlockUrls( String[] a_blockUrls )
{
m_blockUrls = a_blockUrls ;
}
/**
* @see org.apache.avalon.merlin.kernel.KernelConfig#getConfigUrl()
*/
public String getConfigUrl()
{
return m_configUrl ;
}
/**
* @see org.apache.avalon.merlin.kernel.KernelConfig#setConfigUrl(
* java.lang.String)
*/
public void setConfigUrl( String a_configUrl )
{
m_configUrl = a_configUrl ;
}
/**
* @see org.apache.avalon.merlin.kernel.KernelConfig#getHomePath()
*/
public String getHomePath()
{
return m_homePath ;
}
/**
* @see org.apache.avalon.merlin.kernel.KernelConfig#setHomePath(
* java.lang.String)
*/
public void setHomePath( String a_homePath )
{
m_homePath = a_homePath ;
}
/**
* @see org.apache.avalon.merlin.kernel.KernelConfig#isDebugEnabled()
*/
public boolean isDebugEnabled()
{
return m_isDebug ;
}
/**
* @see org.apache.avalon.merlin.kernel.KernelConfig#setDebugEnabled(
* boolean)
*/
public void setDebugEnabled( boolean a_isEnabled )
{
m_isDebug = a_isEnabled ;
}
/**
* @see org.apache.avalon.merlin.kernel.KernelConfig#isInfoEnabled()
*/
public boolean isInfoEnabled()
{
return m_isInfo ;
}
/**
* @see org.apache.avalon.merlin.kernel.KernelConfig#setInfoEnabled(boolean)
*/
public void setInfoEnabled( boolean a_isEnabled )
{
m_isInfo = a_isEnabled ;
}
/**
* @see org.apache.avalon.merlin.kernel.KernelConfig#isServer()
*/
public boolean isServer()
{
return m_isServer ;
}
/**
* @see org.apache.avalon.merlin.kernel.KernelConfig#setServer(boolean)
*/
public void setServer( boolean a_isServer )
{
m_isServer = a_isServer ;
}
/**
* @see org.apache.avalon.merlin.kernel.KernelConfig#getKernelUrl()
*/
public String getKernelUrl()
{
return m_kernelUrl ;
}
/**
* @see org.apache.avalon.merlin.kernel.KernelConfig#setKernelUrl(
* java.lang.String)
*/
public void setKernelUrl( String a_kernelUrl )
{
m_kernelUrl = a_kernelUrl ;
}
/**
* @see org.apache.avalon.merlin.kernel.KernelConfig#getLibraryPath()
*/
public String getLibraryPath()
{
return m_libraryPath ;
}
/**
* @see org.apache.avalon.merlin.kernel.KernelConfig#setLibraryPath(
* java.lang.String)
*/
public void setLibraryPath( String a_libraryPath )
{
m_libraryPath = a_libraryPath ;
}
/**
* @see org.apache.avalon.merlin.kernel.KernelConfig#
* getSystemRepositoryContext()
*/
public RepositoryContext getSystemRepositoryContext()
{
return m_sysCtx ;
}
/**
* @see org.apache.avalon.merlin.kernel.KernelConfig#
* setSystemRepositoryContext(
* org.apache.avalon.repository.RepositoryContext)
*/
public void setSystemRepositoryContext( RepositoryContext a_sysCtx )
{
m_sysCtx = a_sysCtx ;
}
/**
* @see org.apache.avalon.merlin.kernel.KernelConfig#getTempPath()
*/
public String getTempPath()
{
return m_tempPath ;
}
/**
* @see org.apache.avalon.merlin.kernel.KernelConfig#setTempPath(
* java.lang.String)
*/
public void setTempPath( String a_tempPath )
{
m_tempPath = a_tempPath ;
}
}
1.1
avalon-sandbox/kernel/spi/src/java/org/apache/avalon/merlin/kernel/KernelConfig.java
Index: KernelConfig.java
===================================================================
/*
============================================================================
The Apache Software License, Version 1.1
============================================================================
Copyright (C) 1999-2002 The Apache Software Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without modifica-
tion, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. The end-user documentation included with the redistribution, if any, must
include the following acknowledgment: "This product includes software
developed by the Apache Software Foundation (http://www.apache.org/)."
Alternately, this acknowledgment may appear in the software itself, if
and wherever such third-party acknowledgments normally appear.
4. The names "Jakarta", "Apache Avalon", "Avalon Framework" and
"Apache Software Foundation" must not be used to endorse or promote
products derived from this software without prior written
permission. For written permission, please contact [EMAIL PROTECTED]
5. Products derived from this software may not be called "Apache", nor may
"Apache" appear in their name, without prior written permission of the
Apache Software Foundation.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This software consists of voluntary contributions made by many individuals
on behalf of the Apache Software Foundation. For more information on the
Apache Software Foundation, please see <http://www.apache.org/>.
*/
package org.apache.avalon.merlin.kernel ;
import org.apache.avalon.repository.RepositoryContext ;
/**
* The Kernel configuration bean interface.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Alex Karasulu</a>
* @author $Author: akarasulu $
* @version $Revision: 1.1 $
*/
public interface KernelConfig
{
/**
* Return TRUE if the kernel is launched in server model.
* @return the server mode policy
*/
boolean isServer() ;
/**
* Return the debug policy. If TRUE debug level logging
* shall be enabled on all channels.
* @return the debug policy
*/
boolean isDebugEnabled() ;
/**
* Return the info policy. If TRUE an environment
* summary is listed during kernel establishment.
* @return the info policy
*/
boolean isInfoEnabled() ;
/**
* Gets the Repository configuration/context information as a bean for the
* repository containing artifacts required to bootstrap a Kernel
* implementation.
*
* @return the system repository context
*/
RepositoryContext getSystemRepositoryContext() ;
/**
* Gets the application repository context used during the retrival of
* resources such as jar files referenced by block include directives and
* classloader resource references. It is not used to for Kernel
* bootstrapping however at the discretion of the user this and the
* system repository may be one and the same.
*
* @return the local application repository context
*/
RepositoryContext getApplicationRepositoryContext() ;
/**
* Gets the path to the directory used as the base anchor for resolution of
* relative path references for jar extension library directory statements
* in classloader directives. If not supplied the value defaults to the
* current working directory or a file system root.
*
* @return the path to the library directory
*/
String getLibraryPath() ;
/**
* The path to the root working directory for the kernel. This config
* parameter determines the paths of some key Context properties obtained
* during the Contextualizable life-cycle phase.
*
* @return the path to the kernel root
*/
String getHomePath() ;
/**
* Gets the path to a temporary directory.
*
* @return path to temororary directory
*/
String getTempPath() ;
/**
* Gets the url for a configuration file. This file is for the block target
* configuration overrides.
*
* @return the url to a config file
*/
String getConfigUrl() ;
String[] getBlockUrls() ;
/**
* Gets the url for a Kernel XML configuration file.
*
* @return the path to a Kernel XML configuration file
*/
String getKernelUrl() ;
/**
* Set the configuration url.
* @param a_configUrl The configUrl to set.
*/
void setConfigUrl( String a_configUrl ) ;
/**
* @param a_homePath The homePath to set.
*/
void setHomePath( String a_homePath ) ;
/**
* @param a_isDebug The isDebug to set.
*/
void setDebugEnabled( boolean a_isDebug ) ;
/**
* @param a_isInfo The isInfo to set.
*/
void setInfoEnabled( boolean a_isInfo ) ;
/**
* @param a_isServer The isServer to set.
*/
void setServer( boolean a_isServer ) ;
/**
* @param a_kernelUrl The kernelUrl to set.
*/
void setKernelUrl( String a_kernelUrl ) ;
/**
* @param a_libraryPath The libraryPath to set.
*/
void setLibraryPath( String a_libraryPath ) ;
void setBlockUrls( String[] a_blockUrls ) ;
/**
* @param a_tempPath The tempPath to set.
*/
void setTempPath( String a_tempPath ) ;
/**
* @param a_ctx the application repository context
*/
void setApplicationRepositoryContext( RepositoryContext a_ctx ) ;
/**
* @param a_ctx the system repository context
*/
void setSystemRepositoryContext( RepositoryContext a_ctx ) ;
}
1.3 +6 -0 avalon-sandbox/kernel/spi/project.xml
Index: project.xml
===================================================================
RCS file: /home/cvs/avalon-sandbox/kernel/spi/project.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- project.xml 12 Nov 2003 19:27:30 -0000 1.2
+++ project.xml 13 Nov 2003 05:13:08 -0000 1.3
@@ -36,6 +36,12 @@
<version>1.2-dev</version>
</dependency>
+ <dependency>
+ <groupId>avalon-repository</groupId>
+ <artifactId>avalon-repository-api</artifactId>
+ <version>1.1-dev</version>
+ </dependency>
+
</dependencies>
</project>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]