avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hamm...@apache.org
Subject cvs commit: jakarta-avalon-cornerstone/apps/jesktop/src/java/org/apache/avalon/jesktop/services DesktopKernelService.java KernelConfigManager.java
Date Mon, 05 Nov 2001 13:55:53 GMT
hammant     01/11/05 05:55:53

  Modified:    apps/jesktop build.xml
               apps/jesktop/lib jesktop-api.jar
               apps/jesktop/src/conf jesktop-assembly.xml
                        jesktop-config.xml
               apps/jesktop/src/java/org/apache/avalon/jesktop/builtinapps/config
                        ControlPanel.java
               apps/jesktop/src/java/org/apache/avalon/jesktop/core
                        AppLauncherImpl.java ConfigManagerImpl.java
                        DesktopKernelImpl.java DesktopKernelImpl.xinfo
  Added:       apps/jesktop/src/java/org/apache/avalon/jesktop/core
                        ConfigManagerImpl.xinfo
               apps/jesktop/src/java/org/apache/avalon/jesktop/services
                        DesktopKernelService.java KernelConfigManager.java
  Log:
  new Jesktop service - ConfigManager
  
  Revision  Changes    Path
  1.13      +5 -6      jakarta-avalon-cornerstone/apps/jesktop/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/jesktop/build.xml,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- build.xml	2001/10/27 13:14:24	1.12
  +++ build.xml	2001/11/05 13:55:53	1.13
  @@ -45,6 +45,7 @@
     <property name="phoenix.apps" value="${phoenix.home}/apps"/>
     <property name="install.dir" value="${phoenix.home}"/>
     <property name="install.bin.dir" value="${install.dir}/bin"/>
  +  <property name="install.var.dir" value="${install.dir}/var"/>  
     <property name="install.lib.dir" value="${install.dir}/lib"/>
     <property name="install.data.dir" value="${install.dir}/conf"/>
     <property name="install.doc.dir" value="${install.dir}/docs"/>
  @@ -448,12 +449,10 @@
          ===================================================================
     -->
     <target name="install" depends="all,check-phoenix" description="Installs Jesktop into
Phoenix">
  -    <delete dir="${phoenix.apps}/${jar.name}/" />
  -    <copy todir="${phoenix.apps}" filtering="off">
  -      <fileset dir="dist">
  -        <include name="${jar.name}.sar"/>
  -      </fileset>
  -    </copy>
  +    <echo message="Installing to ${install.dir}" />    
  +    <copy file="${build.lib}/jesktop.sar" todir="${install.dir}" />
  +    <delete file="${install.var.dir}/jesktop-install.log" />     
  +    <delete dir="${install.dir}/jesktop" />
     </target>
   
     <target name="check-phoenix" unless="phoenix.apps">
  
  
  
  1.4       +45 -41    jakarta-avalon-cornerstone/apps/jesktop/lib/jesktop-api.jar
  
  	<<Binary file>>
  
  
  1.4       +11 -2     jakarta-avalon-cornerstone/apps/jesktop/src/conf/jesktop-assembly.xml
  
  Index: jesktop-assembly.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/jesktop/src/conf/jesktop-assembly.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- jesktop-assembly.xml	2001/10/02 17:47:04	1.3
  +++ jesktop-assembly.xml	2001/11/05 13:55:53	1.4
  @@ -33,14 +33,23 @@
                role="org.apache.avalon.cornerstone.services.threads.ThreadManager" />
     </block>
   
  +  <block class="org.apache.avalon.cornerstone.blocks.dom.DOMBuilderFactory" name="dom-builder-factory"
/>
  + 
  +
     <!--                 -->
     <!-- Jesktops blocks -->
     <!--                 -->
  +  
  +  <block class="org.apache.avalon.jesktop.core.ConfigManagerImpl" name="cfg-mgr">
  +      <provide name="dom-builder-factory" role="org.apache.avalon.cornerstone.services.dom.DocumentBuilderFactory"
/>
  +      <provide name="objectstorage" role="org.apache.avalon.cornerstone.services.store.Store"/>
  +  </block>  
  +  
     <block class="org.apache.avalon.jesktop.windowmanagers.windoze.WindozeWindowManager1"
            name="jesktop-windowmanager"/>
   
  -  <block class="org.apache.avalon.jesktop.core.DesktopKernelImpl"
  -         name="jesktop-kernel" >
  +  <block class="org.apache.avalon.jesktop.core.DesktopKernelImpl" name="jesktop-kernel"
>
  +    <provide name="cfg-mgr" role="org.apache.avalon.jesktop.services.KernelConfigManager"/>
       <provide name="jesktop-windowmanager" role="org.jesktop.api.WindowManager"/>
       <provide name="objectstorage" role="org.apache.avalon.cornerstone.services.store.Store"/>
       <provide name="thread-manager" role="org.apache.avalon.cornerstone.services.threads.ThreadManager"/>
  
  
  
  1.4       +8 -0      jakarta-avalon-cornerstone/apps/jesktop/src/conf/jesktop-config.xml
  
  Index: jesktop-config.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/jesktop/src/conf/jesktop-config.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- jesktop-config.xml	2001/10/06 16:58:54	1.3
  +++ jesktop-config.xml	2001/11/05 13:55:53	1.4
  @@ -87,5 +87,13 @@
                   model="SYNCHRONOUS">
         </repository>
     </jesktop-kernel>
  +    
  +  <cfg-mgr>
  +  </cfg-mgr>
  +    
  +  <dom-builder-factory>
  +      <domClass>org.apache.xerces.jaxp.DocumentBuilderFactoryImpl</domClass>
  +  </dom-builder-factory>  
  +  
   
   </config>
  
  
  
  1.3       +8 -7      jakarta-avalon-cornerstone/apps/jesktop/src/java/org/apache/avalon/jesktop/builtinapps/config/ControlPanel.java
  
  Index: ControlPanel.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/jesktop/src/java/org/apache/avalon/jesktop/builtinapps/config/ControlPanel.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ControlPanel.java	2001/10/10 13:26:37	1.2
  +++ ControlPanel.java	2001/11/05 13:55:53	1.3
  @@ -18,6 +18,7 @@
   import org.w3c.dom.Document;
   import org.apache.avalon.jesktop.core.LaunchableTargetHolder;
   import org.apache.avalon.jesktop.core.ConfigManagerImpl;
  +import org.apache.avalon.jesktop.services.KernelConfigManager;
   
   import javax.swing.JTabbedPane;
   import javax.swing.JPanel;
  @@ -41,7 +42,7 @@
    *
    *
    * @author <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
Dec 2000.
  - * @version $Revision: 1.2 $
  + * @version $Revision: 1.3 $
    */
   public class ControlPanel extends JFrimble implements DesktopKernelAware, PropertyChangeListener
{
   
  @@ -56,7 +57,7 @@
       private Vector tryableConfigs = new Vector();
       private Vector triedConfigs = new Vector();
       private LaunchableTargetHolder mLaunchableTargetHolder;
  -    private ConfigManagerImpl mConfigManager;
  +    private KernelConfigManager mConfigManager;
       private ControlPanelConfigManager cpConfigManger;
       private Configlet selectedConfiglet;
       private Vector configletWrappers = new Vector(); 
  @@ -98,7 +99,7 @@
        * @param mConfigManager
        *
        */
  -    public void setConfigManager(ConfigManagerImpl cm) {
  +    public void setConfigManager(KernelConfigManager cm) {
           this.mConfigManager = cm;
           this.cpConfigManger = new ControlPanelConfigManager();
       }
  @@ -226,7 +227,7 @@
        *
        *
        * @author <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
Dec 2000.
  -     * @version $Revision: 1.2 $
  +     * @version $Revision: 1.3 $
        */
       private class OKBtn extends JButton {
   
  @@ -261,7 +262,7 @@
        *
        *
        * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  -     * @version $Revision: 1.2 $
  +     * @version $Revision: 1.3 $
        */
       private class TryBtn extends JButton {
   
  @@ -296,7 +297,7 @@
        *
        *
        * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  -     * @version $Revision: 1.2 $
  +     * @version $Revision: 1.3 $
        */
       private class RevertBtn extends JButton {
   
  @@ -340,7 +341,7 @@
        *
        *
        * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  -     * @version $Revision: 1.2 $
  +     * @version $Revision: 1.3 $
        */
       private class ControlPanelConfigManager implements ConfigManager {
   
  
  
  
  1.6       +16 -13    jakarta-avalon-cornerstone/apps/jesktop/src/java/org/apache/avalon/jesktop/core/AppLauncherImpl.java
  
  Index: AppLauncherImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/jesktop/src/java/org/apache/avalon/jesktop/core/AppLauncherImpl.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- AppLauncherImpl.java	2001/10/28 12:50:33	1.5
  +++ AppLauncherImpl.java	2001/11/05 13:55:53	1.6
  @@ -17,6 +17,7 @@
   import org.jesktop.api.AlreadyLaunchedException;
   import org.jesktop.api.DesktopKernelAware;
   import org.jesktop.api.LaunchedTarget;
  +import org.jesktop.api.DesktopKernel;
   import org.jesktop.frimble.FrimbleCallback;
   import org.jesktop.frimble.Frimble;
   import org.jesktop.frimble.JFrimble;
  @@ -24,6 +25,8 @@
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.ConfigurationException;
   import org.apache.avalon.jesktop.builtinapps.config.ControlPanel;
  +import org.apache.avalon.jesktop.services.DesktopKernelService;
  +import org.apache.avalon.jesktop.services.KernelConfigManager;
   
   import javax.swing.JComponent;
   import javax.swing.JLabel;
  @@ -43,30 +46,30 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.5 $
  + * @version $Revision: 1.6 $
    */
   public class AppLauncherImpl extends AppBase implements AppLauncher, FrimbleCallback {
   
       private static int TEMPAPPSUFFIX = 1;
       private WindowManager mWindowManager;
       private LaunchableTargetHolder mLaunchableTargetHolder;
  -    private DesktopKernelImpl mDesktopKernelImpl;
  +    private DesktopKernelService mDesktopKernelService;
       private Vector mLaunchedTargets;
       private ImageRepository mImageRepository;
       private Decorator mDecorator;
  -    private ConfigManagerImpl mConfigManagerImpl;
  +    private KernelConfigManager mConfigManager;
   
       protected AppLauncherImpl(final WindowManager windowManager,
                                 final LaunchableTargetHolder launchableTargetHolder,
  -                              final DesktopKernelImpl desktopKernelImpl,
  -                              final ConfigManagerImpl configManagerImpl, final Vector launchedTargets,
  +                              final DesktopKernelService desktopKernelService,
  +                              final KernelConfigManager configManager, final Vector launchedTargets,
                                 final ImageRepository imageRepository, final Decorator decorator,
                                 final File baseDir) {
           super(baseDir);
           mLaunchableTargetHolder = launchableTargetHolder;
           mWindowManager = windowManager;
  -        mDesktopKernelImpl = desktopKernelImpl;
  -        mConfigManagerImpl = configManagerImpl;
  +        mDesktopKernelService = desktopKernelService;
  +        mConfigManager = configManager;
           mLaunchedTargets = launchedTargets;
           mImageRepository = imageRepository;
           mDecorator = decorator;
  @@ -214,7 +217,7 @@
               if (instantiatedApp instanceof ControlPanel) {
                   ((ControlPanel) instantiatedApp)
                       .setLaunchableTargetHolder(mLaunchableTargetHolder);
  -                ((ControlPanel) instantiatedApp).setConfigManager(mConfigManagerImpl);
  +                ((ControlPanel) instantiatedApp).setConfigManager(mConfigManager);
                   
               }
   
  @@ -270,7 +273,7 @@
   
           if (instantiatedApp instanceof DesktopKernelAware) {
               DesktopKernelAware dak = (DesktopKernelAware) instantiatedApp;
  -            dak.setDesktopKernel(mDesktopKernelImpl.getProxy());
  +            dak.setDesktopKernel(mDesktopKernelService.getProxy());
           }
   
           if (frimble != null) {
  @@ -282,11 +285,11 @@
   
               //frimble.pack();
               frimble.setVisible(true);
  -            frimble.addFrimbleListener(mDesktopKernelImpl.getKernelFrimbleListener());
  +            frimble.addFrimbleListener(mDesktopKernelService.getKernelFrimbleListener());
           }
   
           if (fullClosable) {
  -            LaunchedTarget lchd = mDesktopKernelImpl.makeKernelLaunchedTarget(frimble,
  +            LaunchedTarget lchd = mDesktopKernelService.makeKernelLaunchedTarget(frimble,
                                         instantiatedApp, launchableTarget);
   
               mWindowManager.addLaunchedTarget(lchd);
  @@ -300,11 +303,11 @@
                   ShutdownConfirmer sc = new ShutdownConfirmer() {
   
                       public void shutdownJesktopOnly(boolean force) throws PropertyVetoException
{
  -                        mDesktopKernelImpl.shutdownJesktopOnly(force);
  +                        mDesktopKernelService.shutdownJesktopOnly(force);
                       }
   
                       public void shutdownAvalon(boolean force) throws PropertyVetoException
{
  -                        mDesktopKernelImpl.shutdownAvalon(force);
  +                        mDesktopKernelService.shutdownAvalon(force);
                       }
                   };
   
  
  
  
  1.5       +71 -21    jakarta-avalon-cornerstone/apps/jesktop/src/java/org/apache/avalon/jesktop/core/ConfigManagerImpl.java
  
  Index: ConfigManagerImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/jesktop/src/java/org/apache/avalon/jesktop/core/ConfigManagerImpl.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ConfigManagerImpl.java	2001/10/10 15:50:57	1.4
  +++ ConfigManagerImpl.java	2001/11/05 13:55:53	1.5
  @@ -20,12 +20,27 @@
   import org.jesktop.api.Decorator;
   
   import org.apache.avalon.cornerstone.services.store.ObjectRepository;
  +import org.apache.avalon.cornerstone.services.dom.DocumentBuilderFactory;
  +import org.apache.avalon.framework.component.ComponentManager;
  +import org.apache.avalon.framework.component.ComponentException;
  +import org.apache.avalon.framework.component.Composable;
  +import org.apache.avalon.framework.logger.AbstractLoggable;
  +import org.apache.avalon.framework.context.Contextualizable;
  +import org.apache.avalon.framework.context.Context;
  +import org.apache.avalon.framework.context.ContextException;
  +import org.apache.avalon.framework.configuration.Configurable;
  +import org.apache.avalon.framework.configuration.Configuration;
  +import org.apache.avalon.framework.configuration.ConfigurationException;
  +import org.apache.avalon.phoenix.Block;
  +import org.apache.avalon.jesktop.services.KernelConfigManager;
   import org.apache.xerces.dom.DocumentImpl;
   
   import org.w3c.dom.Document;
   import org.w3c.dom.Element;
   
   import javax.swing.JComponent;
  +import javax.xml.parsers.ParserConfigurationException;
  +import javax.xml.parsers.DocumentBuilder;
   
   import java.util.HashMap;
   import java.util.Set;
  @@ -40,23 +55,58 @@
    *
    *
    * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  - * @version $Revision: 1.4 $
  + * @version $Revision: 1.5 $
    */
  -public class ConfigManagerImpl implements ConfigManager {
  +public class ConfigManagerImpl extends AbstractLoggable
  +        implements Block, KernelConfigManager, ConfigManager, Contextualizable, Composable,
Configurable  {
   
       private final static String CFG = "cfg-";
       private ObjectRepository mObjectRepository;
       private LaunchableTargetHolder mLaunchableTargetHolder;
       private PropertyChangeSupport propChgSupport = new PropertyChangeSupport("DummyBean");
       //private HashMap configListeners = new HashMap();
  -    private org.apache.xerces.parsers.DOMParser parser =
  -        new org.apache.xerces.parsers.DOMParser();
  -    
  -    protected ConfigManagerImpl(final ObjectRepository rep, final LaunchableTargetHolder
lth) {
  -        this.mObjectRepository = rep;
  +    private DocumentBuilderFactory mDocumentBuilderFactory;
  +    private DocumentBuilder mDocumentBuilder;
  +
  +    private ConfigManagerImpl() {
  +    }
  +
  +    public void setLaunchableTargetHolder(final LaunchableTargetHolder lth) {
           this.mLaunchableTargetHolder = lth;
       }
   
  +    public void contextualize(Context context)
  +            throws ContextException {
  +    }
  +
  +    public void configure(Configuration configuration)
  +            throws ConfigurationException {
  +    }
  +
  +    /**
  +     * Method compose
  +     *
  +     *
  +     * @param componentManager
  +     *
  +     * @throws ComponentException
  +     *
  +     */
  +    public void compose(ComponentManager componentManager) throws ComponentException {
  +        mObjectRepository = (ObjectRepository) componentManager.lookup(ObjectRepository.class.getName());
  +        mDocumentBuilderFactory =
  +            (DocumentBuilderFactory) componentManager.lookup(DocumentBuilderFactory.class.getName());
  +        try
  +        {
  +            mDocumentBuilder = mDocumentBuilderFactory.newDocumentBuilder();
  +        }
  +        catch (ParserConfigurationException pce)
  +        {
  +            throw new ComponentException("ParserConfiguration Exception in compose()",pce);
  +        }
  +    }
  +
  +
       /**
        * Method getObjConfig
        *
  @@ -102,7 +152,7 @@
           }
       }
   
  -    protected String getStringConfig(final String configPath, final String defaultVal)
{
  +    public String getStringConfig(final String configPath, final String defaultVal) {
   
           if (mObjectRepository.containsKey(CFG + configPath)) {
               return (String) mObjectRepository.get(CFG + configPath);
  @@ -113,54 +163,54 @@
           }
       }
       
  -    protected void registerConfigInterest(final Configlet clet, final String configPath)
{
  +    public void registerConfigInterest(final Configlet clet, final String configPath) {
           propChgSupport.addPropertyChangeListener(ConfigManager.PROPCHG_PREFIX + configPath,
clet);      
       }
   
  -    protected void unRegisterConfigInterest(final Configlet clet) {
  +    public void unRegisterConfigInterest(final Configlet clet) {
           propChgSupport.removePropertyChangeListener(clet);
       }
   
  -    protected void registerConfigInterest(final DesktopKernelImpl dki, final String configPath)
{
  +    public void registerConfigInterest(final DesktopKernel dk, final String configPath)
{
           
  -        propChgSupport.addPropertyChangeListener(ConfigManager.PROPCHG_PREFIX + configPath,
dki);        
  +        propChgSupport.addPropertyChangeListener(ConfigManager.PROPCHG_PREFIX + configPath,
dk);
           
       }
   
  -    protected void unRegisterConfigInterest(final DesktopKernelImpl dki) {
  -        propChgSupport.removePropertyChangeListener(dki);
  +    public void unRegisterConfigInterest(final DesktopKernel dk) {
  +        propChgSupport.removePropertyChangeListener(dk);
       }
   
  -    protected void registerConfigInterest(final WindowManager wm, final String configPath)
{
  +    public void registerConfigInterest(final WindowManager wm, final String configPath)
{
           
           propChgSupport.addPropertyChangeListener(ConfigManager.PROPCHG_PREFIX + configPath,
wm);        
       }
   
  -    protected void unRegisterConfigInterest(final WindowManager wm) {
  +    public void unRegisterConfigInterest(final WindowManager wm) {
           propChgSupport.removePropertyChangeListener(wm);
       }
       
  -    protected void registerConfigInterest(final Decorator dec, final String configPath)
{
  +    public void registerConfigInterest(final Decorator dec, final String configPath) {
           propChgSupport.addPropertyChangeListener(ConfigManager.PROPCHG_PREFIX + configPath,
(PropertyChangeListener) dec);      
       }    
       
  -    protected void unRegisterConfigInterest(final Decorator dec) {
  +    public void unRegisterConfigInterest(final Decorator dec) {
           propChgSupport.removePropertyChangeListener((PropertyChangeListener) dec);
       }    
   
  -    private void notifyInterested(final String configPath, final Configlet sendingConfiglet,
  +    public void notifyInterested(final String configPath, final Configlet sendingConfiglet,
                                     final Object config) {
           propChgSupport.firePropertyChange(ConfigManager.PROPCHG_PREFIX + configPath,null,config);
       }
   
  -     protected void notifyObjConfig(final String configPath, ClassLoader classLoader) {
  +    public void notifyObjConfig(final String configPath, ClassLoader classLoader) {
   
           Object obj = getObjConfig(configPath, classLoader);         
           notifyInterested(configPath,null,obj);
   
       } 
       
  -     protected void notifyXMLConfig(final String configPath, ClassLoader classLoader) {
  +    public void notifyXMLConfig(final String configPath, ClassLoader classLoader) {
   
           Document doc = this.getXMLConfig(configPath, classLoader);         
           notifyInterested(configPath,null,doc);
  
  
  
  1.11      +26 -23    jakarta-avalon-cornerstone/apps/jesktop/src/java/org/apache/avalon/jesktop/core/DesktopKernelImpl.java
  
  Index: DesktopKernelImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/jesktop/src/java/org/apache/avalon/jesktop/core/DesktopKernelImpl.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- DesktopKernelImpl.java	2001/10/23 08:50:19	1.10
  +++ DesktopKernelImpl.java	2001/11/05 13:55:53	1.11
  @@ -23,6 +23,8 @@
   import org.apache.avalon.cornerstone.services.threads.ThreadManager;
   import org.apache.avalon.jesktop.builtinapps.installer.ConfirmInstallation;
   import org.apache.avalon.jesktop.builtinapps.sys.ErrorApp;
  +import org.apache.avalon.jesktop.services.DesktopKernelService;
  +import org.apache.avalon.jesktop.services.KernelConfigManager;
   import org.apache.avalon.excalibur.thread.ThreadPool;
   import org.apache.avalon.excalibur.proxy.DynamicProxy;
   import org.jesktop.api.*;
  @@ -59,11 +61,11 @@
    * @version 1.0
    */
   public class DesktopKernelImpl extends AbstractLoggable
  -        implements Block, DesktopKernel, ShutdownConfirmer, Contextualizable, Composable,

  +        implements Block, DesktopKernelService, DesktopKernel, ShutdownConfirmer, Contextualizable,
Composable,
                      Initializable, Configurable, PropertyChangeListener {
       
       private ComponentManager mCompManager;
  -    private Configuration configuration;
  +    private Configuration phoenixConfiguration;
   
       //  protected final static Logger LOGGER = LogKit.getLoggerFor("jesktop-kernel");
       private static boolean LOG = true;
  @@ -74,7 +76,7 @@
       private AppLauncher mAppLauncherProxy, mAppLauncher;
       private ImageRepository mImageRepository;
       private ImageRepository mImageRepositoryProxy;
  -    private ConfigManagerImpl configManager;
  +    private KernelConfigManager mConfigManager;
       private DecoratorLaunchableTarget currentDecoratorLaunchableTarget;
       private Decorator mCurrentDecorator;
       private final KernelFrimbleListener kernelFrimbleListener = new KernelFrimbleListener();
  @@ -108,7 +110,7 @@
        *
        */
       public DesktopKernelImpl() {
  -        propertyChangeSupport = new PropertyChangeSupport(DesktopKernel.ROLE);
  +        propertyChangeSupport = new PropertyChangeSupport(DesktopKernel.class.getName());
       }
   
       
  @@ -153,11 +155,11 @@
           propertyChangeSupport.removePropertyChangeListener(propertyName, listener);
       }
   
  -    protected FrimbleListener getKernelFrimbleListener() {
  +    public FrimbleListener getKernelFrimbleListener() {
           return kernelFrimbleListener;
       }
   
  -    protected LaunchedTarget makeKernelLaunchedTarget(final Frimble frimble, final Object
instantiatedApp,
  +    public LaunchedTarget makeKernelLaunchedTarget(final Frimble frimble, final Object
instantiatedApp,
                                                         final LaunchableTarget launchableTarget)
{
           return new KernelLaunchedTarget(frimble, instantiatedApp, launchableTarget);
       }
  @@ -187,7 +189,7 @@
        *
        */
       public void configure(final Configuration confManager) {
  -        this.configuration = confManager;
  +        this.phoenixConfiguration = confManager;
       }
   
       /**
  @@ -228,11 +230,12 @@
           try {
               mWindowManager = (WindowManager) mCompManager.lookup(WindowManager.ROLE);
               mJesktopStore =  (Store) mCompManager.lookup(Store.ROLE);
  -            mThreadManager = (ThreadManager) mCompManager.lookup(ThreadManager.ROLE); 
          
  +            mThreadManager = (ThreadManager) mCompManager.lookup(ThreadManager.ROLE);
  +            mConfigManager = (KernelConfigManager) mCompManager.lookup(ConfigManager.class.getName());
   
               Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
   
  -            Configuration repConf = configuration.getChild("repository");
  +            Configuration repConf = phoenixConfiguration.getChild("repository");
   
               if (mJesktopStore != null) {
                   repository = (ObjectRepository) mJesktopStore.select(repConf);
  @@ -259,14 +262,14 @@
               mAppInstaller = new AppInstallerImpl(propertyChangeSupport, this,
                                                   launchableTargetHolder, mImageRepository,
mBaseDirectory);
               mAppInstallerProxy = (AppInstaller) DynamicProxy.newInstance(mAppInstaller,
new Class[] {AppInstaller.class});
  -            configManager = new ConfigManagerImpl(repository, launchableTargetHolder);
  +            mConfigManager.setLaunchableTargetHolder(launchableTargetHolder);
   
  -            configManager.registerConfigInterest(this, "decorator/currentDecorator");
  -            configManager.registerConfigInterest(mWindowManager, "desktop/settings");
  +            mConfigManager.registerConfigInterest(this, "decorator/currentDecorator");
  +            mConfigManager.registerConfigInterest(mWindowManager, "desktop/settings");
               setDecoratorLaunchableTarget(defaultDecorator);
   
               initializeDecorator();
  -            configManager.notifyObjConfig("decorator/currentDecorator", getClass().getClassLoader());
  +            mConfigManager.notifyObjConfig("decorator/currentDecorator", getClass().getClassLoader());
               mWindowManager.setKernelCallback(mDesktopKernelProxy);
               mWindowManager
                   .setPersistableConfig(new PersistableConfigImpl(repository,
  @@ -275,7 +278,7 @@
                                                                       .getName().hashCode()));
               notifyLaunchableTargetListeners();
               mWindowManager.initializeView();
  -            configManager.notifyXMLConfig("desktop/settings", getClass().getClassLoader());
  +            mConfigManager.notifyXMLConfig("desktop/settings", getClass().getClassLoader());
   
               new File("Jesktop/Temp").mkdir();
   
  @@ -512,7 +515,7 @@
       }
   
       protected ConfigManager getConfigManager() {
  -        return configManager;
  +        return mConfigManager;
       }
   
       private LaunchableTarget getAssociatedViewer(final URL url) {
  @@ -693,21 +696,21 @@
   
               if (mCurrentDecorator instanceof ObjConfigurable) {
                   ((ObjConfigurable) mCurrentDecorator)
  -                    .setConfig(configManager.getObjConfig(dlt.getConfigPath(), cLoader));
  +                    .setConfig(mConfigManager.getObjConfig(dlt.getConfigPath(), cLoader));
               }
   
               currentDecoratorLaunchableTarget = dlt;
               
               if (oldDecorator instanceof PropertyChangeListener) {
  -                configManager.unRegisterConfigInterest(oldDecorator);
  +                mConfigManager.unRegisterConfigInterest(oldDecorator);
               }
   
               if (mCurrentDecorator instanceof PropertyChangeListener) {
  -                configManager.registerConfigInterest(mCurrentDecorator,currentDecoratorLaunchableTarget.getConfigPath());
  +                mConfigManager.registerConfigInterest(mCurrentDecorator,currentDecoratorLaunchableTarget.getConfigPath());
               }            
               
               mAppLauncher = new AppLauncherImpl(mWindowManager, launchableTargetHolder,
this,
  -                                              configManager, launchedTargets, mImageRepository,
  +                                              mConfigManager, launchedTargets, mImageRepository,
                                                 mCurrentDecorator, mBaseDirectory);
               
               mAppLauncherProxy = (AppLauncher) DynamicProxy.newInstance(mAppLauncher, new
Class[] {AppLauncher.class});
  @@ -722,13 +725,13 @@
           }
       }
   
  -    protected DesktopKernel getProxy() {
  +    public DesktopKernel getProxy() {
         return mDesktopKernelProxy;        
       }
       
       private void initializeDecorator() {
   
  -        String targetName = configManager.getStringConfig("decorator/currentDecorator",
DFT_DECORATOR);
  +        String targetName = mConfigManager.getStringConfig("decorator/currentDecorator",
DFT_DECORATOR);
          
           //if (targetName.equals(DFT_DECORATOR)) {
           //    setDecoratorLaunchableTarget(defaultDecorator);
  @@ -780,7 +783,7 @@
        *
        *
        * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  -     * @version $Revision: 1.10 $
  +     * @version $Revision: 1.11 $
        */
       private class KernelLaunchedTarget extends LaunchedTargetImpl {
   
  @@ -841,7 +844,7 @@
        *
        *
        * @author Paul Hammant <a href="mailto:Paul_Hammant@yahoo.com">Paul_Hammant@yahoo.com</a>
  -     * @version $Revision: 1.10 $
  +     * @version $Revision: 1.11 $
        */
       private class KernelFrimbleListener extends FrimbleAdapter {
   
  
  
  
  1.5       +6 -3      jakarta-avalon-cornerstone/apps/jesktop/src/java/org/apache/avalon/jesktop/core/DesktopKernelImpl.xinfo
  
  Index: DesktopKernelImpl.xinfo
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-cornerstone/apps/jesktop/src/java/org/apache/avalon/jesktop/core/DesktopKernelImpl.xinfo,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DesktopKernelImpl.xinfo	2001/10/02 17:46:45	1.4
  +++ DesktopKernelImpl.xinfo	2001/11/05 13:55:53	1.5
  @@ -9,7 +9,7 @@
   
     <!-- services that are offered by this block -->
     <services>
  -    <service name="org.jesktop.api.DesktopKernel" version="1.0" />
  +    <service name="org.apache.avalon.jesktop.services.DesktopKernelService" version="1.0"
/>
     </services>
     <dependencies>
       <dependency>
  @@ -17,9 +17,12 @@
       </dependency>
       <dependency>
         <service name="org.apache.avalon.cornerstone.services.store.Store" version="1.0"/>
  -    </dependency>    
  +    </dependency>
       <dependency>
         <service name="org.apache.avalon.cornerstone.services.threads.ThreadManager" version="1.0"/>
  -    </dependency>     
  +    </dependency>
  +    <dependency>
  +      <service name="org.apache.avalon.jesktop.services.KernelConfigManager" version="1.0"/>
  +    </dependency>
     </dependencies> 
   </blockinfo>
  
  
  
  1.1                  jakarta-avalon-cornerstone/apps/jesktop/src/java/org/apache/avalon/jesktop/core/ConfigManagerImpl.xinfo
  
  Index: ConfigManagerImpl.xinfo
  ===================================================================
  <?xml version="1.0"?>
  
  <blockinfo>
  
    <!-- section to describe block -->
    <block>
      <version>1.0</version>
    </block>
  
    <!-- services that are offered by this block -->
    <services>
      <service name="org.jesktop.config.ConfigManager" version="1.0" />
    </services>
    <dependencies>
      <dependency>
        <service name="org.apache.avalon.cornerstone.services.store.Store" version="1.0"/>
      </dependency>    
      <dependency>
        <service name="org.apache.avalon.cornerstone.services.dom.DocumentBuilderFactory"
version="1.0"/>
      </dependency>    
    </dependencies> 
  </blockinfo>
  
  
  
  1.1                  jakarta-avalon-cornerstone/apps/jesktop/src/java/org/apache/avalon/jesktop/services/DesktopKernelService.java
  
  Index: DesktopKernelService.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 file.
   */
  package org.apache.avalon.jesktop.services;
  
  import org.jesktop.api.DesktopKernel;
  import org.jesktop.api.LaunchedTarget;
  import org.jesktop.frimble.FrimbleListener;
  import org.jesktop.frimble.Frimble;
  import org.jesktop.launchable.LaunchableTarget;
  
  import java.beans.PropertyVetoException;
  
  public interface DesktopKernelService extends DesktopKernel {
  
      DesktopKernel getProxy();
  
      FrimbleListener getKernelFrimbleListener();
  
      LaunchedTarget makeKernelLaunchedTarget(Frimble frimble, Object instantiatedApp, LaunchableTarget
launchableTarget);
  
      void shutdownJesktopOnly(boolean force) throws PropertyVetoException;
  
      void shutdownAvalon(boolean force) throws PropertyVetoException;
  
  }
  
  
  
  1.1                  jakarta-avalon-cornerstone/apps/jesktop/src/java/org/apache/avalon/jesktop/services/KernelConfigManager.java
  
  Index: KernelConfigManager.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 file.
   */
  package org.apache.avalon.jesktop.services;
  
  import org.jesktop.api.WindowManager;
  import org.jesktop.api.Decorator;
  import org.jesktop.api.DesktopKernel;
  import org.jesktop.config.ConfigManager;
  import org.jesktop.config.Configlet;
  import org.jesktop.config.XMLConfiglet;
  import org.jesktop.config.ObjConfiglet;
  import org.w3c.dom.Document;
  import org.apache.avalon.jesktop.core.LaunchableTargetHolder;
  
  import java.beans.PropertyChangeListener;
  
  /**
   * @author  Paul_Hammant <Paul_Hammant@yahoo.com>
   * @version 1.0
   */
  public interface KernelConfigManager extends ConfigManager {
  
      void registerConfigInterest(final Configlet clet, final String configPath);
  
      void unRegisterConfigInterest(final Configlet clet);
  
      void registerConfigInterest(final DesktopKernel dk, final String configPath);
  
      void unRegisterConfigInterest(final DesktopKernel dk);
  
      void registerConfigInterest(final WindowManager wm, final String configPath);
  
      void unRegisterConfigInterest(final WindowManager wm);
  
      void registerConfigInterest(final Decorator dec, final String configPath);
  
      void unRegisterConfigInterest(final Decorator dec);
  
      void notifyInterested(final String configPath, final Configlet sendingConfiglet, final
Object config);
  
      void notifyObjConfig(final String configPath, ClassLoader classLoader);
  
      void notifyXMLConfig(final String configPath, ClassLoader classLoader);
  
      Object getObjConfig(final String configPath, final ClassLoader classLoader);
  
      Document getXMLConfig(final String configPath, final ClassLoader classLoader);
  
      String getStringConfig(final String configPath, final String defaultVal);
  
      void notifyUpdated(final XMLConfiglet clet);
  
      void notifyUpdated(final ObjConfiglet clet);
  
      void notifyUpdatedNoSave(final ObjConfiglet clet);
  
      void notifyUpdatedNoSave(final XMLConfiglet clet);
  
      void setLaunchableTargetHolder(LaunchableTargetHolder lth);
  }
  
  
  

--
To unsubscribe, e-mail:   <mailto:avalon-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-dev-help@jakarta.apache.org>


Mime
View raw message