You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Gerhard Froehlich <g-...@gmx.de> on 2001/07/09 22:20:57 UTC

[c2] component manager question

Hi Team,
I tried to get the FilesystemStore from the ComponentManager
in my MRUMemoryStore class. I looked around in your source code
to understand how to use the component manager (and the avalon
project of course):

--schnipp--
...
   /** the component manager */
  protected ComponentManager manager;

  public MRUMemoryStore() {
    this.jvm     = Runtime.getRuntime();
    this.cache   = new HashMap();
    this.mrulist = new LinkedList();
  }

  public void compose(ComponentManager manager) throws ComponentException {
    try {
      this.manager = manager;
      getLogger().debug("Looking up FilesystemStore" +
FilesystemStore.ROLE);
      this.fsstore = (Store)manager.lookup(Store.ROLE + "/Filesystem");
    } catch(ComponentException e) {
      getLogger().error("Error in MRUMemoryStore",e);
    }
  }
...
-schnapp--

But this method is never executed. How would you solve this?

Cheers
Gerhard


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


AW: [c2] component manager question

Posted by Gerhard Froehlich <g-...@gmx.de>.
that was it.

thanx
-----Ursprungliche Nachricht-----
Von: Berin Loritsch [mailto:bloritsch@apache.org]
Gesendet: Montag, 9. Juli 2001 22:54
An: cocoon-dev@xml.apache.org
Betreff: Re: [c2] component manager question


Gerhard Froehlich wrote:
>
> Hi Team,
> I tried to get the FilesystemStore from the ComponentManager
> in my MRUMemoryStore class. I looked around in your source code
> to understand how to use the component manager (and the avalon
> project of course):

Does your class implement the Composable interface?

>
> --schnipp--
> ...
>    /** the component manager */
>   protected ComponentManager manager;
>
>   public MRUMemoryStore() {
>     this.jvm     = Runtime.getRuntime();
>     this.cache   = new HashMap();
>     this.mrulist = new LinkedList();
>   }
>
>   public void compose(ComponentManager manager) throws ComponentException
{
>     try {
>       this.manager = manager;
>       getLogger().debug("Looking up FilesystemStore" +
> FilesystemStore.ROLE);
>       this.fsstore = (Store)manager.lookup(Store.ROLE + "/Filesystem");
>     } catch(ComponentException e) {
>       getLogger().error("Error in MRUMemoryStore",e);
>     }
>   }
> ...
> -schnapp--
>
> But this method is never executed. How would you solve this?
>
> Cheers
> Gerhard
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: [c2] component manager question

Posted by Berin Loritsch <bl...@apache.org>.
Gerhard Froehlich wrote:
> 
> Hi Team,
> I tried to get the FilesystemStore from the ComponentManager
> in my MRUMemoryStore class. I looked around in your source code
> to understand how to use the component manager (and the avalon
> project of course):

Does your class implement the Composable interface?

> 
> --schnipp--
> ...
>    /** the component manager */
>   protected ComponentManager manager;
> 
>   public MRUMemoryStore() {
>     this.jvm     = Runtime.getRuntime();
>     this.cache   = new HashMap();
>     this.mrulist = new LinkedList();
>   }
> 
>   public void compose(ComponentManager manager) throws ComponentException {
>     try {
>       this.manager = manager;
>       getLogger().debug("Looking up FilesystemStore" +
> FilesystemStore.ROLE);
>       this.fsstore = (Store)manager.lookup(Store.ROLE + "/Filesystem");
>     } catch(ComponentException e) {
>       getLogger().error("Error in MRUMemoryStore",e);
>     }
>   }
> ...
> -schnapp--
> 
> But this method is never executed. How would you solve this?
> 
> Cheers
> Gerhard
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org

Re: [c2] component manager question

Posted by Donald Ball <ba...@webslingerZ.com>.
On Mon, 9 Jul 2001, Gerhard Froehlich wrote:

> Hi Team,
> I tried to get the FilesystemStore from the ComponentManager
> in my MRUMemoryStore class. I looked around in your source code
> to understand how to use the component manager (and the avalon
> project of course):
>
> --schnipp--
> ...
>    /** the component manager */
>   protected ComponentManager manager;
>
>   public MRUMemoryStore() {
>     this.jvm     = Runtime.getRuntime();
>     this.cache   = new HashMap();
>     this.mrulist = new LinkedList();
>   }
>
>   public void compose(ComponentManager manager) throws ComponentException {
>     try {
>       this.manager = manager;
>       getLogger().debug("Looking up FilesystemStore" +
> FilesystemStore.ROLE);
>       this.fsstore = (Store)manager.lookup(Store.ROLE + "/Filesystem");
>     } catch(ComponentException e) {
>       getLogger().error("Error in MRUMemoryStore",e);
>     }
>   }

you should implement Composable if you're not already.

- donald


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


RE: [c2] component manager question

Posted by Vadim Gritsenko <vg...@hns.com>.
Make sure MRUMemoryStore extends Composable interface from avalon:

import org.apache.avalon.framework.component.Composable;

Vadim

> -----Original Message-----
> From: Gerhard Froehlich [mailto:g-froehlich@gmx.de]
> Sent: Monday, July 09, 2001 16:21
> To: cocoon-dev@xml.apache.org
> Subject: [c2] component manager question
> 
> 
> Hi Team,
> I tried to get the FilesystemStore from the ComponentManager
> in my MRUMemoryStore class. I looked around in your source code
> to understand how to use the component manager (and the avalon
> project of course):
> 
> --schnipp--
> ...
>    /** the component manager */
>   protected ComponentManager manager;
> 
>   public MRUMemoryStore() {
>     this.jvm     = Runtime.getRuntime();
>     this.cache   = new HashMap();
>     this.mrulist = new LinkedList();
>   }
> 
>   public void compose(ComponentManager manager) throws ComponentException {
>     try {
>       this.manager = manager;
>       getLogger().debug("Looking up FilesystemStore" +
> FilesystemStore.ROLE);
>       this.fsstore = (Store)manager.lookup(Store.ROLE + "/Filesystem");
>     } catch(ComponentException e) {
>       getLogger().error("Error in MRUMemoryStore",e);
>     }
>   }
> ...
> -schnapp--
> 
> But this method is never executed. How would you solve this?
> 
> Cheers
> Gerhard
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org