You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-user@james.apache.org by James Diggans <jd...@excelsiortech.com> on 2001/10/07 06:57:07 UTC

James ComponentManager

Hello, I'm rather new to James and am using James 1.2.1 on a Linux 
system spooling to the filesystem (and keeping users there to keep 
things simple).

I'm trying to write an automated method to create new POP3 users and, 
being rather naive of the nuances of the older Avalon framework James 
1.2.1 users, I'm having a nearly impossible time resolving what seems to 
be a chicken-and-egg problem in dealing with ComponentManagers.

The Avalon jars that ship with James did not include the sources for the 
Avalon stuff that initially creates the first ComponentManager. All 
other component managers seemed to be created by passing their parent 
ComponentManager in.

The only implementing class I can find in any of the jars for the 
ComponentManager interface is the NamedComponentManagerImpl class ... 
but this doesn't seem to enjoy being instantiatied w/ an empty 
constructor. I'm nearly to the point of writing inflection code to check 
every single class in any of the jars for some freaking method allowing 
me to instantiate a ComponentManager ... can anyone suggest a way to do 
this?

There was word of an RMI-based method someone posted for talking to the 
RemoteManager .. this, too, would work but I am unable to find this post.

Any suggestions much appreciated, James looks to work very well for my 
needs indeed. Also, is there any current date for a release of James 
1.2.2 or 1.3 on the newer (read: documentation avail.) Avalon framework?

Kind regards,
James



---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org


Re: James ComponentManager

Posted by Darrell DeBoer <li...@bigdaz.com>.
Hi,

> Is the latest version of James in CVS built on Avalon 4.x? I've read
> over the Avalon javadocs but since James 1.2.1 is built on an older
> version of Avalon they're not doing me much good. Would the James
> dever's consider the current state of James in CVS fairly stable? I
> don't need to do anything fancy with it ... but I would like it to stay
> alive ...
>

If you're doing some development on top of James, I'd highly recommend
working against the code in CVS. (It's built on a recent version of Avalon
4.x) We're close to a release (2.0), and I'd say that the current CVS is
probably (close to) as stable as the 1.2.1 code.

The docs aren't quite there, but you shouldn't have too much trouble getting
it built and up and running. Make sure you drop us a line if you have
troubles.

ciao
Daz





---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org


Re: James ComponentManager

Posted by James Diggans <jd...@excelsiortech.com>.
Is the latest version of James in CVS built on Avalon 4.x? I've read 
over the Avalon javadocs but since James 1.2.1 is built on an older 
version of Avalon they're not doing me much good. Would the James 
dever's consider the current state of James in CVS fairly stable? I 
don't need to do anything fancy with it ... but I would like it to stay 
alive ...

-j

Danny Angus wrote:

>I'd suggest that you might find building the latest version of James from CVS a better bet, you can also d/l the source for Avalon, which will also provide javadocs, and other stuff.
>
>>-----Original Message-----
>>From: James Diggans [mailto:jdiggans@excelsiortech.com]
>>Sent: Sunday, October 07, 2001 5:57 AM
>>To: james-user@jakarta.apache.org
>>Subject: James ComponentManager
>>
>>
>>Hello, I'm rather new to James and am using James 1.2.1 on a Linux 
>>system spooling to the filesystem (and keeping users there to keep 
>>things simple).
>>
>>I'm trying to write an automated method to create new POP3 users and, 
>>being rather naive of the nuances of the older Avalon framework James 
>>1.2.1 users, I'm having a nearly impossible time resolving what seems to 
>>be a chicken-and-egg problem in dealing with ComponentManagers.
>>
>>The Avalon jars that ship with James did not include the sources for the 
>>Avalon stuff that initially creates the first ComponentManager. All 
>>other component managers seemed to be created by passing their parent 
>>ComponentManager in.
>>
>>The only implementing class I can find in any of the jars for the 
>>ComponentManager interface is the NamedComponentManagerImpl class ... 
>>but this doesn't seem to enjoy being instantiatied w/ an empty 
>>constructor. I'm nearly to the point of writing inflection code to check 
>>every single class in any of the jars for some freaking method allowing 
>>me to instantiate a ComponentManager ... can anyone suggest a way to do 
>>this?
>>
>>There was word of an RMI-based method someone posted for talking to the 
>>RemoteManager .. this, too, would work but I am unable to find this post.
>>
>>Any suggestions much appreciated, James looks to work very well for my 
>>needs indeed. Also, is there any current date for a release of James 
>>1.2.2 or 1.3 on the newer (read: documentation avail.) Avalon framework?
>>
>>Kind regards,
>>James
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: james-user-help@jakarta.apache.org
>>




---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org


RE: James ComponentManager

Posted by Danny Angus <da...@thought.co.uk>.
I'd suggest that you might find building the latest version of James from CVS a better bet, you can also d/l the source for Avalon, which will also provide javadocs, and other stuff.

> -----Original Message-----
> From: James Diggans [mailto:jdiggans@excelsiortech.com]
> Sent: Sunday, October 07, 2001 5:57 AM
> To: james-user@jakarta.apache.org
> Subject: James ComponentManager
> 
> 
> Hello, I'm rather new to James and am using James 1.2.1 on a Linux 
> system spooling to the filesystem (and keeping users there to keep 
> things simple).
> 
> I'm trying to write an automated method to create new POP3 users and, 
> being rather naive of the nuances of the older Avalon framework James 
> 1.2.1 users, I'm having a nearly impossible time resolving what seems to 
> be a chicken-and-egg problem in dealing with ComponentManagers.
> 
> The Avalon jars that ship with James did not include the sources for the 
> Avalon stuff that initially creates the first ComponentManager. All 
> other component managers seemed to be created by passing their parent 
> ComponentManager in.
> 
> The only implementing class I can find in any of the jars for the 
> ComponentManager interface is the NamedComponentManagerImpl class ... 
> but this doesn't seem to enjoy being instantiatied w/ an empty 
> constructor. I'm nearly to the point of writing inflection code to check 
> every single class in any of the jars for some freaking method allowing 
> me to instantiate a ComponentManager ... can anyone suggest a way to do 
> this?
> 
> There was word of an RMI-based method someone posted for talking to the 
> RemoteManager .. this, too, would work but I am unable to find this post.
> 
> Any suggestions much appreciated, James looks to work very well for my 
> needs indeed. Also, is there any current date for a release of James 
> 1.2.2 or 1.3 on the newer (read: documentation avail.) Avalon framework?
> 
> Kind regards,
> James
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: james-user-help@jakarta.apache.org
> 

Re: James ComponentManager

Posted by Oki DZ <ok...@pindad.com>.
On Sun, 7 Oct 2001, James Diggans wrote:
...
> The only implementing class I can find in any of the jars for the 
> ComponentManager interface is the NamedComponentManagerImpl class ... 
> but this doesn't seem to enjoy being instantiatied w/ an empty 
> constructor. I'm nearly to the point of writing inflection code to check 
> every single class in any of the jars for some freaking method allowing 
> me to instantiate a ComponentManager ... can anyone suggest a way to do 
> this?

If you want to get a reference to the Avalon's ComponentManager, you can
do it like:
 public void init() throws MessagingException {
	try {
	    ComponentManager componentManager = (ComponentManager)
		getMailetContext()
		.getAttribute(Constants.AVALON_COMPONENT_MANAGER);

And that's from mailets.

You don't instantiate the component manager created by Avalon; it's
already there, all you need to do is to use it. If you want to access the
component manager from an Avalon component, then you need to implement the
compose() method in your component; something like:

    public void compose(ComponentManager componentManager) 
	throws ComponentException {
	sourceSelector = (DataSourceSelector) componentManager
	    .lookup("com.pindad.james.services.DataSourceSelector");
	// then you'd have a reference to the DataSourceSelector object -
	// which is a block - from your component
    }

But you have to make sure that your newly component is initialized (and/or
the compose() method got invoked) by the blocks that loaded by Phoenix. 
The components you can get from the (running) Avalon component manager are
those blocks (SMTP server, POP server, etc), or your own blocks (Avalon
Block is also Component). To have your own blocks get run by Phoenix,
you'd have to create ones, and setup the dependency rules; which is put
int the <classname>.xinfo, assembly.xml, server.xml (for defining the
blocks' log files). And also something you need to edit in the Manifest.mf
file; the names of the blocks Phoenix should load.

I think it would be helpful if you write more completely about what you
want with the "POP3 automation"; do you want to do it by time schedule,
remote admin, or something else.

Oki



---------------------------------------------------------------------
To unsubscribe, e-mail: james-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-user-help@jakarta.apache.org