RE: How to get the container within an instance event?

2003-07-03 Thread Angus Mezick
Cool! That is exactly what I needed!  I was getting miffed because
valves got the nice catalina request object while InstanceEvent had to
deal with the dumbed down HttpRequest.  Now onto a design question:

I am implementing a JdbcSessionManager for dealing with non-sticky
clusters.  We wish to use the DB to store all of our session data when
it is not in use.  Thanks to Craig's help I was able to figure out how
to do the updating of the session data in an InstanceEventListener that
catches the AFTER_SERVICE_EVENT.  In talking to Filip Hank about his
Clustered session manager I was also able to do the database updates in
a valve.  Which way is preferable?  In the InstanceEvent I can just
filter out all queries that make this true:
default.equals(event.getServlet().getServletConfig().getServletName())
.  Filip used the file extensions to create an exclusion list.

Other notes:
I have had to create my own JdbcSession object instead of subclassing
StandardSession because the attributes HashMap is private and I need
access to it.  (I think)  I am serializing the HashMap and storing only
that in its own column.  My other columns are expire_time,
creation_time, app_name, and session_id.  I am currently limited to
sessions with 8k of data because of the DB limits on VARBINARY but that
can change at a later date.

--Angus

 -Original Message-
 From: Craig R. McClanahan [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, July 02, 2003 11:50 PM
 On Wed, 2 Jul 2003, Angus Mezick wrote:
 
  Date: Wed, 2 Jul 2003 15:08:33 -0400
  From: Angus Mezick [EMAIL PROTECTED]
  Does anyone know how to access the container object from an instance
  event?  Are there any specs that say an instance event can have no
  internal access to the server?
 
 
 I presume you're talking about 
 org.apache.catalina.InstanceEvent, right?
 If so, the wrapper property that is accessible via 
 getWrapper() is the
 org.apache.catalina.Container instance for this particular 
 servlet.  If
 you want the Context element for the webapp, for example, you'd say
 something like:
 
   Context context = (Context) event.getWrapper().getParent();
 
 or, to get the Host for this virtual host:
 
   Host host = (Host) event.getWrapper().getParent().getParent();
 
 and so on.
 
  Sorry for the cross post but I am deep into the internals 
 of tomcat here
  and I don't know which list is appropriate.  The list with how do I
  change the default port type q's or the one that debates 
 how features
  should be implemented.
 
 
 The TOMCAT-USER list probably won't have many folks that 
 understand the
 internals well enough to answer a question like this :-).
 
  Angus Mezick
  GuideStar - Philanthropic Research Inc.
 Craig McClanahan

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



How to get the container within an instance event?

2003-07-02 Thread Angus Mezick
Does anyone know how to access the container object from an instance
event?  Are there any specs that say an instance event can have no
internal access to the server? 

Sorry for the cross post but I am deep into the internals of tomcat here
and I don't know which list is appropriate.  The list with how do I
change the default port type q's or the one that debates how features
should be implemented.

Angus Mezick
GuideStar - Philanthropic Research Inc.
427 Scotland St.
Williamsburg, Virginia 23185
PHONE: (757)299-4631 x35  FAX:(757)229-8912
[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
www.guidestar.org http://www.guidestar.org

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to get the container within an instance event?

2003-07-02 Thread Craig R. McClanahan


On Wed, 2 Jul 2003, Angus Mezick wrote:

 Date: Wed, 2 Jul 2003 15:08:33 -0400
 From: Angus Mezick [EMAIL PROTECTED]
 Reply-To: Tomcat Developers List [EMAIL PROTECTED]
 To: [EMAIL PROTECTED], [EMAIL PROTECTED]
 Subject: How to get the container within an instance event?

 Does anyone know how to access the container object from an instance
 event?  Are there any specs that say an instance event can have no
 internal access to the server?


I presume you're talking about org.apache.catalina.InstanceEvent, right?
If so, the wrapper property that is accessible via getWrapper() is the
org.apache.catalina.Container instance for this particular servlet.  If
you want the Context element for the webapp, for example, you'd say
something like:

  Context context = (Context) event.getWrapper().getParent();

or, to get the Host for this virtual host:

  Host host = (Host) event.getWrapper().getParent().getParent();

and so on.

 Sorry for the cross post but I am deep into the internals of tomcat here
 and I don't know which list is appropriate.  The list with how do I
 change the default port type q's or the one that debates how features
 should be implemented.


The TOMCAT-USER list probably won't have many folks that understand the
internals well enough to answer a question like this :-).

 Angus Mezick
 GuideStar - Philanthropic Research Inc.
 427 Scotland St.
 Williamsburg, Virginia 23185
 PHONE: (757)299-4631 x35  FAX:(757)229-8912
 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
 www.guidestar.org http://www.guidestar.org


Craig McClanahan

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to get the container within an instance event?

2003-07-02 Thread dutta_kaushik

Hi All,


From where can I get complete class diagrams of Tomcat ?



Thanks,

Kaushik

This mail was scanned by Interscan Viruswall, CR ,TCS CHENNAI 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Re: How to get the container within an instance event?

2003-07-02 Thread Bill Barker
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/catalina/docs/api/index.html

- Original Message -
From: [EMAIL PROTECTED]
To: Tomcat Developers List [EMAIL PROTECTED]
Sent: Wednesday, July 02, 2003 9:33 PM
Subject: Re: How to get the container within an instance event?



 Hi All,


 From where can I get complete class diagrams of Tomcat ?



 Thanks,

 Kaushik








 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]

This message is intended only for the use of the person(s) listed above as the 
intended recipient(s), and may contain information that is PRIVILEGED and 
CONFIDENTIAL.  If you are not an intended recipient, you may not read, copy, or 
distribute this message or any attachment. If you received this communication in 
error, please notify us immediately by e-mail and then delete all copies of this 
message and any attachments.

In addition you should be aware that ordinary (unencrypted) e-mail sent through the 
Internet is not secure. Do not send confidential or sensitive information, such as 
social security numbers, account numbers, personal identification numbers and 
passwords, to us via ordinary (unencrypted) e-mail.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]