donaldp 01/04/24 02:53:25
Modified: src/java/org/apache/phoenix/engine
DefaultServerApplication.java
Log:
Made scope smaller by default (ie private rather than protected)
Also collected SystemManager from CM and propogated to facilities.
Revision Changes Path
1.23 +32 -21
jakarta-avalon-phoenix/src/java/org/apache/phoenix/engine/DefaultServerApplication.java
Index: DefaultServerApplication.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-phoenix/src/java/org/apache/phoenix/engine/DefaultServerApplication.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- DefaultServerApplication.java 2001/04/24 05:42:54 1.22
+++ DefaultServerApplication.java 2001/04/24 09:53:23 1.23
@@ -12,6 +12,7 @@
import org.apache.avalon.Initializable;
import org.apache.avalon.atlantis.Application;
import org.apache.avalon.atlantis.ApplicationException;
+import org.apache.avalon.atlantis.SystemManager;
import org.apache.avalon.camelot.AbstractContainer;
import org.apache.avalon.camelot.ContainerException;
import org.apache.avalon.camelot.Entry;
@@ -57,30 +58,32 @@
*/
public final class DefaultServerApplication
extends AbstractContainer
- implements Application, Configurable, Contextualizable
+ implements Application, Contextualizable, Composable, Configurable
{
- protected final static class PhaseEntry
+ private final static class PhaseEntry
{
protected BlockDAG.Traversal m_traversal;
protected BlockVisitor m_visitor;
}
- protected HashMap m_phases = new HashMap();
- protected BlockDAG m_dag = new BlockDAG();
+ private HashMap m_phases = new HashMap();
+ private BlockDAG m_dag = new BlockDAG();
//the following are used for setting up facilities
- protected Context m_context;
- protected Configuration m_configuration;
- protected ComponentManager m_componentManager;
-
- protected ApplicationManager m_applicationManager;
- protected LogManager m_logManager;
- protected PolicyManager m_policyManager;
- protected ThreadManager m_threadManager;
- protected ClassLoaderManager m_classLoaderManager;
+ private Context m_context;
+ private Configuration m_configuration;
+ private ComponentManager m_componentManager;
+ ///SystemManager provided by kernel
+ private SystemManager m_systemManager;
+
//these are the facilities (internal components) of ServerApplication
- protected ConfigurationRepository m_configurationRepository;
+ private ApplicationManager m_applicationManager;
+ private LogManager m_logManager;
+ private PolicyManager m_policyManager;
+ private ThreadManager m_threadManager;
+ private ClassLoaderManager m_classLoaderManager;
+ private ConfigurationRepository m_configurationRepository;
public DefaultServerApplication()
{
@@ -97,6 +100,13 @@
m_context = newContext;
}
+ public void compose( final ComponentManager componentManager )
+ throws ComponentException
+ {
+ m_systemManager = (SystemManager)componentManager.
+ lookup( "org.apache.avalon.atlantis.SystemManager" );
+ }
+
public void configure( final Configuration configuration )
throws ConfigurationException
{
@@ -131,7 +141,7 @@
m_phases.put( "shutdown", entry );
}
- protected void setupPhases()
+ private void setupPhases()
throws Exception
{
final Iterator phases = m_phases.values().iterator();
@@ -222,9 +232,9 @@
setupComponent( m_dag, "<core>.dag", null );
}
- protected void setupComponent( final Component object,
- final String logName,
- final Configuration configuration )
+ protected final void setupComponent( final Component object,
+ final String logName,
+ final Configuration configuration )
throws Exception
{
setupLogger( object, logName );
@@ -250,7 +260,7 @@
}
}
- protected void runPhase( final PhaseEntry phase )
+ protected final void runPhase( final PhaseEntry phase )
throws Exception
{
m_dag.walkGraph( phase.m_visitor, phase.m_traversal );
@@ -280,7 +290,7 @@
* @param entry the BlockEntry describing block
* @return the list of RoleEntry objects
*/
- protected void verifyDependenciesMap( final String name, final BlockEntry entry
)
+ private void verifyDependenciesMap( final String name, final BlockEntry entry )
throws ContainerException
{
//Make sure all role entries specified in config file are valid
@@ -323,9 +333,10 @@
*
* @return the ComponentManager
*/
- protected ComponentManager createComponentManager()
+ private ComponentManager createComponentManager()
{
final DefaultComponentManager componentManager = new
DefaultComponentManager();
+ componentManager.put( "org.apache.avalon.atlantis.SystemManager",
m_systemManager );
componentManager.put( "org.apache.avalon.camelot.Container", this );
componentManager.put( "org.apache.phoenix.engine.facilities.PolicyManager",
m_policyManager );
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]