You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@james.apache.org by Muhammad Kashif <m_...@yahoo.com> on 2004/02/07 10:09:56 UTC

Max Connection Limit...

Hi,
 
I seem be having a petty issue regarding James Configuration. The "connectionLimit" parameter for the SMTP/POP3/NNTP block is not working for me. Is there a pre-requisite ? The documentation doesnt mention any !

However, the "max-connections" parameter in the "Connections Manager" block is working fine.

I want to limit the connections in a service-specific fashion instead of server-wide connections.

Can anybody help !

Regards
Kashif



---------------------------------
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online

Re: Delegation hides specialization

Posted by Niclas Hedhman <ni...@hedhman.org>.
On Tuesday 10 February 2004 15:06, Leo Simons wrote:
> Noel J. Bergman wrote:
> > Anyone have an idea for how to handle this?
>
> With merlin, that's not really
> an option I think (its not allowed). 

It is allowed (the feature exist) in Merlin as well, the question whether it 
is recommended :o)

Niclas

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


Re: Delegation hides specialization

Posted by Leo Simons <le...@apache.org>.
Stephen McConnell wrote:
> Just for reference - in Merlin it is possible to disable proxy 
> generation on a selective basis (i.e. this component, that component, 
> etc.).

sweet! I love pragmatism :D

-- 
cheers,

- Leo Simons

-----------------------------------------------------------------------
Weblog              -- http://leosimons.com/
IoC Component Glue  -- http://jicarilla.org/
Articles & Opinions -- http://articles.leosimons.com/
-----------------------------------------------------------------------
"We started off trying to set up a small anarchist community, but
  people wouldn't obey the rules."
                                                         -- Alan Bennett



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


Re: Delegation hides specialization

Posted by Stephen McConnell <mc...@apache.org>.
Leo Simons wrote:
> Noel J. Bergman wrote:
> 
>> Anyone have an idea for how to handle this?
> 
> 
> the answer used to be "disable proxying". With merlin, that's not really 
> an option I think (its not allowed). The answer becomes "you can only 
> cast to work interfaces". So define an extended work interface and use it.

Leo:

Just for reference - in Merlin it is possible to disable proxy 
generation on a selective basis (i.e. this component, that component, 
etc.).  Currently this isn't integrated into the meta-data layer so its 
not dead-simple - but that will change.  For example - running an ORB 
requires either wrapping the ORB or running the ORB as non-proxied.  As 
and ORB is basically a glorified proxy its handy to run it without a proxy.

Cheers, Steve.

-- 

|------------------------------------------------|
| Magic by Merlin                                |
| Production by Avalon                           |
|                                                |
| http://avalon.apache.org/merlin                |
| http://dpml.net/merlin/distributions/latest    |
|------------------------------------------------|

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


Re: Delegation hides specialization

Posted by Leo Simons <le...@apache.org>.
Noel J. Bergman wrote:
> Anyone have an idea for how to handle this?

the answer used to be "disable proxying". With merlin, that's not really 
an option I think (its not allowed). The answer becomes "you can only 
cast to work interfaces". So define an extended work interface and use it.

is that possible?

-- 
cheers,

- Leo Simons

-----------------------------------------------------------------------
Weblog              -- http://leosimons.com/
IoC Component Glue  -- http://jicarilla.org/
Articles & Opinions -- http://articles.leosimons.com/
-----------------------------------------------------------------------
"We started off trying to set up a small anarchist community, but
  people wouldn't obey the rules."
                                                         -- Alan Bennett



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


Re: Delegation hides specialization

Posted by Søren Hilmer <sh...@tefs.dk>.
As far as I can see the only way is to introduce a new JamesConnectionManager 
interface (extending ConnectionManager) which adds the methods we need.
Make SimpleConnectionManager implement that and finally use the new interface 
in assembly.xml.

Then in AbstractJamesService we can use instanceof against the new interface 
as the Proxy will certainly implement that, and we are home free.

--Søren


On Monday 09 February 2004 15:04, Noel J. Bergman wrote:
> > > Looks to me that if the connection manager is not our
> > > SimpleConnectionManager, we won't use the service-specific setting.
> >
> > the piece of offending code in AbstractJamesService is:
> >   if (connectionManager instanceof SimpleConnectionManager)
> > This is never true, as connectionManager is an instanceof Proxy!
>
> Anyone have an idea for how to handle this?
>
> See lines 408-430 of
> http://cvs.apache.org/viewcvs.cgi/james-server/src/java/org/apache/james/co
>r e/AbstractJamesService.java?annotate=1.12 and lines of 362-377
> http://cvs.apache.org/viewcvs.cgi/james-server/src/java/org/apache/james/co
>r e/AbstractJamesService.java?annotate=1.4.4.2&only_with_tag=branch_2_1_fcs
>
> Apparently, the Avalon container is blocking our visibility to our
> specialized and extended ConnectionManager:
> http://cvs.apache.org/viewcvs.cgi/james-server/src/java/org/apache/james/ut
>i l/connection/SimpleConnectionManager.java
>
> 	--- Noel
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
> For additional commands, e-mail: server-dev-help@james.apache.org

-- 
Søren Hilmer, M.Sc.
R&D manager		Phone:	+45 70 27 64 00
TietoEnator IT+		Fax:	+45 70 27 64 40
Ved Lunden 12		Direct:	+45 87 46 64 57
DK-8230 Åbyhøj		Email:	soren.hilmer <at> tietoenator.com



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


Re: Delegation hides specialization

Posted by Niclas Hedhman <ni...@hedhman.org>.
On Monday 09 February 2004 22:04, Noel J. Bergman wrote:
> Anyone have an idea for how to handle this?

It is "bad case" of FS, I think and Avalon is preventing yourself from 
shooting yourself in the foot. ;o)

Seriously, you are taking the wrong approach, and I doubt that there is anyone 
in Avalon who want to support downcasting services to implementation classes.

What you "should" do, is extend the service interface, and in the lookup check 
if you were handed back the super- or sub-interface, and act accordingly.

Niclas

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


Delegation hides specialization

Posted by "Noel J. Bergman" <no...@devtech.com>.
> > Looks to me that if the connection manager is not our
> > SimpleConnectionManager, we won't use the service-specific setting.

> the piece of offending code in AbstractJamesService is:
>   if (connectionManager instanceof SimpleConnectionManager)
> This is never true, as connectionManager is an instanceof Proxy!

Anyone have an idea for how to handle this?

See lines 408-430 of
http://cvs.apache.org/viewcvs.cgi/james-server/src/java/org/apache/james/cor
e/AbstractJamesService.java?annotate=1.12 and lines of 362-377
http://cvs.apache.org/viewcvs.cgi/james-server/src/java/org/apache/james/cor
e/AbstractJamesService.java?annotate=1.4.4.2&only_with_tag=branch_2_1_fcs

Apparently, the Avalon container is blocking our visibility to our
specialized and extended ConnectionManager:
http://cvs.apache.org/viewcvs.cgi/james-server/src/java/org/apache/james/uti
l/connection/SimpleConnectionManager.java

	--- Noel


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


Delegation hides specialization

Posted by "Noel J. Bergman" <no...@devtech.com>.
> > Looks to me that if the connection manager is not our
> > SimpleConnectionManager, we won't use the service-specific setting.

> the piece of offending code in AbstractJamesService is:
>   if (connectionManager instanceof SimpleConnectionManager)
> This is never true, as connectionManager is an instanceof Proxy!

Anyone have an idea for how to handle this?

See lines 408-430 of
http://cvs.apache.org/viewcvs.cgi/james-server/src/java/org/apache/james/cor
e/AbstractJamesService.java?annotate=1.12 and lines of 362-377
http://cvs.apache.org/viewcvs.cgi/james-server/src/java/org/apache/james/cor
e/AbstractJamesService.java?annotate=1.4.4.2&only_with_tag=branch_2_1_fcs

Apparently, the Avalon container is blocking our visibility to our
specialized and extended ConnectionManager:
http://cvs.apache.org/viewcvs.cgi/james-server/src/java/org/apache/james/uti
l/connection/SimpleConnectionManager.java

	--- Noel


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


Re: Max Connection Limit...

Posted by Soeren Hilmer <so...@tietoenator.com>.
Hi,

A co-worker of mine spotted this friday (talk about coincidence). 

We use our SimpleConnectionManager in assembly.xml but, the piece of offending 
code in AbstractJamesService is:

if (connectionManager instanceof SimpleConnectionManager)

This is never true, as connectionManager is an instanceof Proxy!

--Søren

On Saturday 07 February 2004 16:47, Noel J. Bergman wrote:
> > The "connectionLimit" parameter for the SMTP/POP3/NNTP block
> > is not working for me.
>
> What version of James?  I don't spot anything wrong at a quick glance in
> the code, but would have to look further.
>
> AbstractJamesService.configure() and AbstractJamesService.initialize() are
> the key routines.  The connectionLimit and max-connections use the same
> logic.  Looks to me that if the connection manager is not our
> SimpleConnectionManager, we won't use the service-specific setting.  If
> there is a log entry saying that the service "will allow a maximum of #
> connections" then we are using our connection manager.
>
> 	--- Noel
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org

-- 
Søren Hilmer, M.Sc.
R&D manager		Phone:	+45 70 27 64 00
TietoEnator IT+ A/S	Fax:	+45 70 27 64 40
Ved Lunden 12		Direct:	+45 87 46 64 57
DK-8230 Åbyhøj		Email:	soren.hilmer <at> tietoenator.com


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


RE: Max Connection Limit...

Posted by "Noel J. Bergman" <no...@devtech.com>.
> I want only 2 simultaneous connections to be opened to the SMTP service.

Looks like a bug in our configuration.  We'll fix it for the next release.

	--- Noel

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


RE: Max Connection Limit...

Posted by Muhammad Kashif <m_...@yahoo.com>.
Dear Noel!

Although I appreciate your spirit to take your time out for helping me , however, what you wrote is too Java-specific and I really dont want to go into those details. 
I have the following Software Configuration:
 
James  2.1.3
Pheonix 4.0.1
 
For your information, I m writing out the whole SMTP block here. As far as the documentation states, what I understand is that this Block controls the SMTP service, all in all. Though, the <connectionLimit> is an optional parameter, i didnt find any dependencies. I want only 2 simultaneous connections to be opened to the SMTP service. However, the <max-connections> parameter is set out to 10 and JAMES obeys the Connection Manager parameter. Are these two mutually exclusive of each other ? Does one override the other? Whats the preference rule (if any)? With both parameters in place; which one will JAMES obey to ? Does the placement of the tag matter, when it is a direct child of the SMTP block ? (I have even tried placing it into the <handler> tag)
 
And, last but not the least, HOW DOES IT WORK ????
 
I've tried using the parameter for the POP/NNTP as well. It doesnt work there, even.

 <smtpserver enabled="true">
        <!-- port 25 is the well-known/IANA registered port for SMTP -->
        <port>25</port>
        <!-- Uncomment this if you want to bind to a specific inetaddress -->
        <!--
      <bind> </bind>
      -->
        <!-- Uncomment this if you want to use TLS (SSL) on this port -->
        <!--
      <useTLS>true</useTLS>
      -->
        <handler>
            <!-- This is the name used by the server to identify itself in the SMTP -->
            <!-- protocol.  If autodetect is TRUE, the server will discover its -->
            <!-- own host name and use that in the protocol.  If discovery fails, -->
            <!-- the value of 'localhost' is used.  If autodetect is FALSE, James -->
            <!-- will use the specified value. -->
            <helloName autodetect="false">MailMatrix Test Server</helloName>
            <connectiontimeout>360000</connectiontimeout>
            <!--  Uncomment this if you want to require SMTP authentication. -->
         <!--<authRequired>true</authRequired>-->
            <!--  Uncomment this if you want to verify sender addresses, ensuring that -->
            <!--  the sender address matches the user who has authenticated. -->
            <!--  This prevents a user of your mail server from acting as someone else -->
            <!--
         <verifyIdentity>true</verifyIdentity>
         -->
            <!--  This sets the maximum allowed message size (in kilobytes) for this -->
            <!--  SMTP service. If unspecified, the value defaults to 0, which means no limit. -->
            <maxmessagesize>0</maxmessagesize>
        </handler>
        <connectionLimit>2</connectionLimit>
    </smtpserver>
 
Cheers and Peace to all
 
Kashif

"Noel J. Bergman" <no...@devtech.com> wrote:
> The "connectionLimit" parameter for the SMTP/POP3/NNTP block
> is not working for me.

What version of James? I don't spot anything wrong at a quick glance in the
code, but would have to look further.

AbstractJamesService.configure() and AbstractJamesService.initialize() are
the key routines. The connectionLimit and max-connections use the same
logic. Looks to me that if the connection manager is not our
SimpleConnectionManager, we won't use the service-specific setting. If
there is a log entry saying that the service "will allow a maximum of #
connections" then we are using our connection manager.

--- Noel


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



Muhammad Kashif

Information Technology Matrix.
(Your Network/Internet Security Partner)
Tel#: +966-3-8943748, 8961507
Fax#: +966-3-8640748
URL: www.itmatrix.com




---------------------------------
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online

RE: Max Connection Limit...

Posted by "Noel J. Bergman" <no...@devtech.com>.
> The "connectionLimit" parameter for the SMTP/POP3/NNTP block
> is not working for me.

What version of James?  I don't spot anything wrong at a quick glance in the
code, but would have to look further.

AbstractJamesService.configure() and AbstractJamesService.initialize() are
the key routines.  The connectionLimit and max-connections use the same
logic.  Looks to me that if the connection manager is not our
SimpleConnectionManager, we won't use the service-specific setting.  If
there is a log entry saying that the service "will allow a maximum of #
connections" then we are using our connection manager.

	--- Noel


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