Author: remy.maucherat(a)jboss.com
Date: 2009-06-02 12:17:09 -0400 (Tue, 02 Jun 2009)
New Revision: 1074
Modified:
trunk/PATCHES.txt
trunk/java/org/apache/catalina/Container.java
trunk/java/org/apache/catalina/core/ContainerBase.java
trunk/java/org/apache/catalina/session/StandardSession.java
trunk/webapps/docs/changelog.xml
Log:
- Expose Container.fireContainerEvent, since it is used, and became public a while ago.
Modified: trunk/PATCHES.txt
===================================================================
--- trunk/PATCHES.txt 2009-06-02 14:12:44 UTC (rev 1073)
+++ trunk/PATCHES.txt 2009-06-02 16:17:09 UTC (rev 1074)
@@ -71,3 +71,6 @@
770876
Windows 64 bit stuff ... Zzzzz
+
+781036
+Some configBase creation flag
Modified: trunk/java/org/apache/catalina/Container.java
===================================================================
--- trunk/java/org/apache/catalina/Container.java 2009-06-02 14:12:44 UTC (rev 1073)
+++ trunk/java/org/apache/catalina/Container.java 2009-06-02 16:17:09 UTC (rev 1074)
@@ -424,6 +424,17 @@
/**
+ * Notify all container event listeners that a particular event has
+ * occurred for this Container. The default implementation performs
+ * this notification synchronously using the calling thread.
+ *
+ * @param type Event type
+ * @param data Event data
+ */
+ public void fireContainerEvent(String type, Object data);
+
+
+ /**
* Process the specified Request, and generate the corresponding Response,
* according to the design of this particular Container.
*
Modified: trunk/java/org/apache/catalina/core/ContainerBase.java
===================================================================
--- trunk/java/org/apache/catalina/core/ContainerBase.java 2009-06-02 14:12:44 UTC (rev
1073)
+++ trunk/java/org/apache/catalina/core/ContainerBase.java 2009-06-02 16:17:09 UTC (rev
1074)
@@ -1413,9 +1413,6 @@
}
- // ------------------------------------------------------ Protected Methods
-
-
/**
* Notify all container event listeners that a particular event has
* occurred for this Container. The default implementation performs
@@ -1439,6 +1436,9 @@
}
+ // ------------------------------------------------------ Protected Methods
+
+
/**
* Return the abbreviated name of this container for logging messsages
*/
Modified: trunk/java/org/apache/catalina/session/StandardSession.java
===================================================================
--- trunk/java/org/apache/catalina/session/StandardSession.java 2009-06-02 14:12:44 UTC
(rev 1073)
+++ trunk/java/org/apache/catalina/session/StandardSession.java 2009-06-02 16:17:09 UTC
(rev 1074)
@@ -24,7 +24,6 @@
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
-import java.lang.reflect.Method;
import java.security.AccessController;
import java.security.Principal;
import java.security.PrivilegedAction;
@@ -140,24 +139,6 @@
/**
- * The <code>java.lang.Method</code> for the
- * <code>fireContainerEvent()</code> method of the
- * <code>org.apache.catalina.core.StandardContext</code> method,
- * if our Context implementation is of this class. This value is
- * computed dynamically the first time it is needed, or after
- * a session reload (since it is declared transient).
- */
- protected transient Method containerEventMethod = null;
-
-
- /**
- * The method signature for the <code>fireContainerEvent</code> method.
- */
- protected static final Class containerEventTypes[] =
- { String.class, Object.class };
-
-
- /**
* The time this session was created, in milliseconds since midnight,
* January 1, 1970 GMT.
*/
@@ -379,18 +360,12 @@
HttpSessionListener listener =
(HttpSessionListener) listeners[i];
try {
- fireContainerEvent(context,
- "beforeSessionCreated",
- listener);
+ context.fireContainerEvent("beforeSessionCreated",
listener);
listener.sessionCreated(event);
- fireContainerEvent(context,
- "afterSessionCreated",
- listener);
+ context.fireContainerEvent("afterSessionCreated",
listener);
} catch (Throwable t) {
try {
- fireContainerEvent(context,
- "afterSessionCreated",
- listener);
+ context.fireContainerEvent("afterSessionCreated",
listener);
} catch (Exception e) {
;
}
@@ -682,18 +657,12 @@
HttpSessionListener listener =
(HttpSessionListener) listeners[j];
try {
- fireContainerEvent(context,
- "beforeSessionDestroyed",
- listener);
+ context.fireContainerEvent("beforeSessionDestroyed",
listener);
listener.sessionDestroyed(event);
- fireContainerEvent(context,
- "afterSessionDestroyed",
- listener);
+ context.fireContainerEvent("afterSessionDestroyed",
listener);
} catch (Throwable t) {
try {
- fireContainerEvent(context,
- "afterSessionDestroyed",
- listener);
+ context.fireContainerEvent("afterSessionDestroyed",
listener);
} catch (Exception e) {
;
}
@@ -1330,39 +1299,33 @@
(HttpSessionAttributeListener) listeners[i];
try {
if (unbound != null) {
- fireContainerEvent(context,
- "beforeSessionAttributeReplaced",
+
context.fireContainerEvent("beforeSessionAttributeReplaced",
listener);
if (event == null) {
event = new HttpSessionBindingEvent
(getSession(), name, unbound);
}
listener.attributeReplaced(event);
- fireContainerEvent(context,
- "afterSessionAttributeReplaced",
+
context.fireContainerEvent("afterSessionAttributeReplaced",
listener);
} else {
- fireContainerEvent(context,
- "beforeSessionAttributeAdded",
+ context.fireContainerEvent("beforeSessionAttributeAdded",
listener);
if (event == null) {
event = new HttpSessionBindingEvent
(getSession(), name, value);
}
listener.attributeAdded(event);
- fireContainerEvent(context,
- "afterSessionAttributeAdded",
+ context.fireContainerEvent("afterSessionAttributeAdded",
listener);
}
} catch (Throwable t) {
try {
if (unbound != null) {
- fireContainerEvent(context,
- "afterSessionAttributeReplaced",
+
context.fireContainerEvent("afterSessionAttributeReplaced",
listener);
} else {
- fireContainerEvent(context,
- "afterSessionAttributeAdded",
+
context.fireContainerEvent("afterSessionAttributeAdded",
listener);
}
} catch (Exception e) {
@@ -1534,39 +1497,6 @@
/**
- * Fire container events if the Context implementation is the
- * <code>org.apache.catalina.core.StandardContext</code>.
- *
- * @param context Context for which to fire events
- * @param type Event type
- * @param data Event data
- *
- * @exception Exception occurred during event firing
- */
- protected void fireContainerEvent(Context context,
- String type, Object data)
- throws Exception {
-
- if (!"org.apache.catalina.core.StandardContext".equals
- (context.getClass().getName())) {
- return; // Container events are not supported
- }
- // NOTE: Race condition is harmless, so do not synchronize
- if (containerEventMethod == null) {
- containerEventMethod =
- context.getClass().getMethod("fireContainerEvent",
- containerEventTypes);
- }
- Object containerEventParams[] = new Object[2];
- containerEventParams[0] = type;
- containerEventParams[1] = data;
- containerEventMethod.invoke(context, containerEventParams);
-
- }
-
-
-
- /**
* Notify all session event listeners that a particular event has
* occurred for this Session. The default implementation performs
* this notification synchronously using the calling thread.
@@ -1646,21 +1576,18 @@
HttpSessionAttributeListener listener =
(HttpSessionAttributeListener) listeners[i];
try {
- fireContainerEvent(context,
- "beforeSessionAttributeRemoved",
+ context.fireContainerEvent("beforeSessionAttributeRemoved",
listener);
if (event == null) {
event = new HttpSessionBindingEvent
(getSession(), name, value);
}
listener.attributeRemoved(event);
- fireContainerEvent(context,
- "afterSessionAttributeRemoved",
+ context.fireContainerEvent("afterSessionAttributeRemoved",
listener);
} catch (Throwable t) {
try {
- fireContainerEvent(context,
- "afterSessionAttributeRemoved",
+ context.fireContainerEvent("afterSessionAttributeRemoved",
listener);
} catch (Exception e) {
;
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2009-06-02 14:12:44 UTC (rev 1073)
+++ trunk/webapps/docs/changelog.xml 2009-06-02 16:17:09 UTC (rev 1074)
@@ -93,6 +93,9 @@
<update>
Remove ServerFactory. (markt)
</update>
+ <fix>
+ <bug>47299</bug>: Expose Container.fireContainerEvent, which became
public long ago. (remm)
+ </fix>
</changelog>
</subsection>
<subsection name="Coyote">