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 Oki DZ <ok...@pindad.com> on 2001/07/16 10:36:54 UTC

Selecting services

Hi,

I'd like to turn off nntp and imap servers; how am I supposed to do it?
Removing the elements in config.xml seems to prevent James from starting.
BTW, I'm going to use James 1.3-dev (the one in the CVS).

TIA,
Oki





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


Re: Selecting services

Posted by Charles Benett <ch...@benett1.demon.co.uk>.
Oki DZ wrote:
> 
> On Wed, 18 Jul 2001, Gabriel Bucher wrote:
> > I think we should ask the avalon guys about turn on/off blocks... Avalon manage
> > all the services and I think it should enough to specify in the manifest.mf if
> > it is a service (block) or not. I think it is maybe a bug in the current version
> > of avalon we use!
> 
> initialize() in James.java:
>                 imapSystem = new SimpleSystem();
>                 imapSystem.configure(conf.getChild("imapHost"));
>                 imapSystem.contextualize(context);
>                 imapSystem.compose(compMgr);
>                 if (imapSystem instanceof Initializable) {
>                     ((Initializable)imapSystem).initialize();
>                 }
>                 compMgr.put("org.apache.james.imapserver.IMAPSystem",
> (Component)imapSystem);
>                 getLogger().info("Using SimpleSystem.");
>                 imapHost = (Host)
> Class.forName(imapHostClass).newInstance();
>                 //imapHost = new JamesHost();
>                 imapHost.configure(conf.getChild("imapHost"));
>                 imapHost.contextualize(context);
>                 imapHost.compose(compMgr);
>                 if (imapHost instanceof Initializable) {
>                     ((Initializable)imapHost).initialize();
>                 }
>                 compMgr.put("org.apache.james.imapserver.Host",
> (Component)imapHost);
>                 getLogger().info("Using: " + imapHostClass);
> 
> As I understand it, the snippet code above sets up the IMAP server and
> it's storage. So I think, it would be possible to select which service to
> be run during James start-up; to prevent a service to be started, just
> bypass its initialize() (and compose() if any), in James.java. And the
> flags to init can be defined in the config.xml;
> 
> I'm not so clear (yet) how Phoenix working though; I defined my Block in
> James' assembly.xml, my Block got loaded (meaning: its initialize() got
> invoked) during Phoenix start-up. Could it be some differences between
> blocks and components in Avalon parlance? ie: blocks got automatically
> initialized and composed, but components' initialize() and compose()
> should be invoked by some other entities.
> 

Yes - blocks get automatically run by Phoenix. Before we split James
into multiple blocks it was straightforward to specify what services
were run. I haven't had time to play with current set-up for that.
The IMAP code generally needs some attention, so I wouldn't rely on it
for examples.
And, yes, components within blocks should be set up by their block, I
think.

Charles

> Well, I don't know... quickly looking up the POP3Server.java, it's not a
> block, but an AbstractService....
> 
> Oki
> 
> ---------------------------------------------------------------------
> 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: Selecting services

Posted by Oki DZ <ok...@pindad.com>.
On Wed, 18 Jul 2001, Gabriel Bucher wrote:
> I think we should ask the avalon guys about turn on/off blocks... Avalon manage 
> all the services and I think it should enough to specify in the manifest.mf if 
> it is a service (block) or not. I think it is maybe a bug in the current version 
> of avalon we use!

initialize() in James.java:
                imapSystem = new SimpleSystem();
                imapSystem.configure(conf.getChild("imapHost"));
                imapSystem.contextualize(context);
                imapSystem.compose(compMgr);
                if (imapSystem instanceof Initializable) {
                    ((Initializable)imapSystem).initialize();
                }
                compMgr.put("org.apache.james.imapserver.IMAPSystem",
(Component)imapSystem);
                getLogger().info("Using SimpleSystem.");
                imapHost = (Host)
Class.forName(imapHostClass).newInstance();
                //imapHost = new JamesHost();
                imapHost.configure(conf.getChild("imapHost"));
                imapHost.contextualize(context);
                imapHost.compose(compMgr);
                if (imapHost instanceof Initializable) {
                    ((Initializable)imapHost).initialize();
                }
                compMgr.put("org.apache.james.imapserver.Host",
(Component)imapHost);
                getLogger().info("Using: " + imapHostClass);

As I understand it, the snippet code above sets up the IMAP server and
it's storage. So I think, it would be possible to select which service to
be run during James start-up; to prevent a service to be started, just
bypass its initialize() (and compose() if any), in James.java. And the
flags to init can be defined in the config.xml;

I'm not so clear (yet) how Phoenix working though; I defined my Block in
James' assembly.xml, my Block got loaded (meaning: its initialize() got
invoked) during Phoenix start-up. Could it be some differences between
blocks and components in Avalon parlance? ie: blocks got automatically
initialized and composed, but components' initialize() and compose() 
should be invoked by some other entities. 

Well, I don't know... quickly looking up the POP3Server.java, it's not a
block, but an AbstractService....

Oki




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


Re: Selecting services

Posted by Gabriel Bucher <ga...@razor.ch>.
Hi Oki

Quoting Oki DZ <ok...@pindad.com>:

> On Tue, 17 Jul 2001, Gabriel Bucher wrote:
> > Ok, I see... I tried it out... and got an java.lang.OutOfMemoryError
> but found 
> > nothing in the log files! 
> > I played a little bit around and here my solution:
> > 
> > for the NNTP Service
> > --------------------
> > In the manifest.mf:
> > Name: org/apache/james/nntpserver/NNTPServer.class
> > Avalon-Block: false
> > 
> > Name:
> org/apache/james/nntpserver/repository/NNTPRepositoryImpl.class
> > Avalon-Block: false
> > 
> > Comment out or remove the 2 blocks in the assembly.xml and config.xml!
> 
> > This should work!
> > 
> Thanks a lot; I'll try it out.
>  
> > for the IMAP service... I'm not sure if this works also... try it
> out... take 
> > care about dependencies to the block James!  
> 
> Whoa, so many things to do just to turn on/off services; it's time to
> think about a "james-meta.xml" which (approx.) contains:
> <meta-james>
>   <smtp service="yes"/>
>   <pop service="yes"/>
>   <nntp service="yes"/>
>   <imap service="yes"/>
> </meta-james>
I think we should ask the avalon guys about turn on/off blocks... Avalon manage 
all the services and I think it should enough to specify in the manifest.mf if 
it is a service (block) or not. I think it is maybe a bug in the current version 
of avalon we use!

> 
> And then just put "no" if you don't want some services to be started. 
>  
> > If I understand avalon right... the path in the location are always
> realtive to 
> > the application home path! Use symbolic links for the log directory in
> your 
> > james app home.
> 
> Interesting... Is it a bug or a feature?
Ask the avalon guys... 

Buchi

> I see... symbolic links.
> 
> Oki
> 
> 
> 
> ---------------------------------------------------------------------
> 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: Selecting services

Posted by Oki DZ <ok...@pindad.com>.
On Tue, 17 Jul 2001, Gabriel Bucher wrote:
> Ok, I see... I tried it out... and got an java.lang.OutOfMemoryError but found 
> nothing in the log files! 
> I played a little bit around and here my solution:
> 
> for the NNTP Service
> --------------------
> In the manifest.mf:
> Name: org/apache/james/nntpserver/NNTPServer.class
> Avalon-Block: false
> 
> Name: org/apache/james/nntpserver/repository/NNTPRepositoryImpl.class
> Avalon-Block: false
> 
> Comment out or remove the 2 blocks in the assembly.xml and config.xml! 
> This should work!
> 
Thanks a lot; I'll try it out.
 
> for the IMAP service... I'm not sure if this works also... try it out... take 
> care about dependencies to the block James!  

Whoa, so many things to do just to turn on/off services; it's time to
think about a "james-meta.xml" which (approx.) contains:
<meta-james>
  <smtp service="yes"/>
  <pop service="yes"/>
  <nntp service="yes"/>
  <imap service="yes"/>
</meta-james>

And then just put "no" if you don't want some services to be started. 
 
> If I understand avalon right... the path in the location are always realtive to 
> the application home path! Use symbolic links for the log directory in your 
> james app home.

Interesting... Is it a bug or a feature?
I see... symbolic links.

Oki



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


Re: Selecting services

Posted by Gabriel Bucher <ga...@razor.ch>.
Hi Oki

Try this way...

Quoting Oki DZ <ok...@pindad.com>:

> On Mon, 16 Jul 2001, Gabriel Bucher wrote:
> 
> > Remove the Blocks in the manifest.mf File!
> 
> I tried that, but then James couldn't be started.
> Should I remove some of the elements in server.xml?
Ok, I see... I tried it out... and got an java.lang.OutOfMemoryError but found 
nothing in the log files! 
I played a little bit around and here my solution:

for the NNTP Service
--------------------
In the manifest.mf:
Name: org/apache/james/nntpserver/NNTPServer.class
Avalon-Block: false

Name: org/apache/james/nntpserver/repository/NNTPRepositoryImpl.class
Avalon-Block: false

Comment out or remove the 2 blocks in the assembly.xml and config.xml! 
This should work!


for the IMAP service... I'm not sure if this works also... try it out... take 
care about dependencies to the block James!  
> 
> BTW, I'd like to change the directory of the log files. I tried to
> change
> the "location" attributes in james-server.xml to /var/log/james/<log
> name>. But then, the log files didn't get placed in /var/log/james;
> they
> were still under the James intstallation directory.
If I understand avalon right... the path in the location are always realtive to 
the application home path! Use symbolic links for the log directory in your 
james app home.

I hope this help!
Buchi
> 
> Oki
>  
> 
> 
> 
> ---------------------------------------------------------------------
> 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: Selecting services

Posted by Oki DZ <ok...@pindad.com>.
On Mon, 16 Jul 2001, Gabriel Bucher wrote:

> Remove the Blocks in the manifest.mf File!

I tried that, but then James couldn't be started.
Should I remove some of the elements in server.xml?

BTW, I'd like to change the directory of the log files. I tried to change
the "location" attributes in james-server.xml to /var/log/james/<log
name>. But then, the log files didn't get placed in /var/log/james; they
were still under the James intstallation directory.

Oki
 



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


Re: Selecting services

Posted by Gabriel Bucher <bu...@email.com>.
Remove the Blocks in the manifest.mf File!

Buchi


Oki DZ wrote:
> 
> Hi,
> 
> I'd like to turn off nntp and imap servers; how am I supposed to do it?
> Removing the elements in config.xml seems to prevent James from starting.
> BTW, I'm going to use James 1.3-dev (the one in the CVS).
> 
> TIA,
> Oki
> 
> ---------------------------------------------------------------------
> 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