blob: 851218a2f238195d4c4b91449bec918fe25d8486 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.5.0_06) on Wed Jul 19 14:45:49 EDT 2006 -->
<TITLE>
EventManager (Apache Cayenne API Documentation - v.2.0-incubating-SNAPSHOT)
</TITLE>
<META NAME="keywords" CONTENT="org.apache.cayenne.event.EventManager class">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../apache-javadoc.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
parent.document.title="EventManager (Apache Cayenne API Documentation - v.2.0-incubating-SNAPSHOT)";
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../org/apache/cayenne/event/EventBridgeFactory.html" title="interface in org.apache.cayenne.event"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../org/apache/cayenne/event/EventSubject.html" title="class in org.apache.cayenne.event"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?org/apache/cayenne/event/EventManager.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="EventManager.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.apache.cayenne.event</FONT>
<BR>
Class EventManager</H2>
<PRE>
java.lang.Object
<IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.cayenne.event.EventManager</B>
</PRE>
<HR>
<DL>
<DT><PRE>public class <B>EventManager</B><DT>extends java.lang.Object</DL>
</PRE>
<P>
This class acts as bridge between an Object that wants to inform others about its
current state or a change thereof (Publisher) and a list of objects interested in the
Subject (Listeners).
<P>
<P>
<DL>
<DT><B>Author:</B></DT>
<DD>Dirk Olmes, Holger Hoffstaette, Andrei Adamchik</DD>
</DL>
<HR>
<P>
<!-- =========== FIELD SUMMARY =========== -->
<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Field Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/cayenne/event/EventManager.html#DEFAULT_DISPATCH_THREAD_COUNT">DEFAULT_DISPATCH_THREAD_COUNT</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;java.util.List</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/cayenne/event/EventManager.html#eventQueue">eventQueue</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/cayenne/event/EventManager.html#singleThread">singleThread</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;java.util.Map</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/cayenne/event/EventManager.html#subjects">subjects</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
</TABLE>
&nbsp;
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../org/apache/cayenne/event/EventManager.html#EventManager()">EventManager</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a multithreaded EventManager using default thread count.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../org/apache/cayenne/event/EventManager.html#EventManager(int)">EventManager</A></B>(int&nbsp;dispatchThreadCount)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates an EventManager starting the specified number of threads for multithreaded
dispatching.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/cayenne/event/EventManager.html#addListener(java.lang.Object, java.lang.String, java.lang.Class, org.apache.cayenne.event.EventSubject)">addListener</A></B>(java.lang.Object&nbsp;listener,
java.lang.String&nbsp;methodName,
java.lang.Class&nbsp;eventParameterClass,
<A HREF="../../../../org/apache/cayenne/event/EventSubject.html" title="class in org.apache.cayenne.event">EventSubject</A>&nbsp;subject)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Register an <code>EventListener</code> for events sent by any sender.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/cayenne/event/EventManager.html#addListener(java.lang.Object, java.lang.String, java.lang.Class, org.apache.cayenne.event.EventSubject, java.lang.Object)">addListener</A></B>(java.lang.Object&nbsp;listener,
java.lang.String&nbsp;methodName,
java.lang.Class&nbsp;eventParameterClass,
<A HREF="../../../../org/apache/cayenne/event/EventSubject.html" title="class in org.apache.cayenne.event">EventSubject</A>&nbsp;subject,
java.lang.Object&nbsp;sender)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Register an <code>EventListener</code> for events sent by a specific sender.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/cayenne/event/EventManager.html#addListener(java.lang.Object, java.lang.String, java.lang.Class, org.apache.cayenne.event.EventSubject, java.lang.Object, boolean)">addListener</A></B>(java.lang.Object&nbsp;listener,
java.lang.String&nbsp;methodName,
java.lang.Class&nbsp;eventParameterClass,
<A HREF="../../../../org/apache/cayenne/event/EventSubject.html" title="class in org.apache.cayenne.event">EventSubject</A>&nbsp;subject,
java.lang.Object&nbsp;sender,
boolean&nbsp;blocking)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/cayenne/event/EventManager.html#addNonBlockingListener(java.lang.Object, java.lang.String, java.lang.Class, org.apache.cayenne.event.EventSubject)">addNonBlockingListener</A></B>(java.lang.Object&nbsp;listener,
java.lang.String&nbsp;methodName,
java.lang.Class&nbsp;eventParameterClass,
<A HREF="../../../../org/apache/cayenne/event/EventSubject.html" title="class in org.apache.cayenne.event">EventSubject</A>&nbsp;subject)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/cayenne/event/EventManager.html#addNonBlockingListener(java.lang.Object, java.lang.String, java.lang.Class, org.apache.cayenne.event.EventSubject, java.lang.Object)">addNonBlockingListener</A></B>(java.lang.Object&nbsp;listener,
java.lang.String&nbsp;methodName,
java.lang.Class&nbsp;eventParameterClass,
<A HREF="../../../../org/apache/cayenne/event/EventSubject.html" title="class in org.apache.cayenne.event">EventSubject</A>&nbsp;subject,
java.lang.Object&nbsp;sender)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;<A HREF="../../../../org/apache/cayenne/event/EventManager.html" title="class in org.apache.cayenne.event">EventManager</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/cayenne/event/EventManager.html#getDefaultManager()">getDefaultManager</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the shared EventManager.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.util.List</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/cayenne/event/EventManager.html#getEventQueue()">getEventQueue</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a list of currently queued events.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/cayenne/event/EventManager.html#isSingleThreaded()">isSingleThreaded</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns true if this EventManager is single-threaded.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/cayenne/event/EventManager.html#postEvent(java.util.EventObject, org.apache.cayenne.event.EventSubject)">postEvent</A></B>(java.util.EventObject&nbsp;event,
<A HREF="../../../../org/apache/cayenne/event/EventSubject.html" title="class in org.apache.cayenne.event">EventSubject</A>&nbsp;subject)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sends an event to all registered objects about a particular subject.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/cayenne/event/EventManager.html#postNonBlockingEvent(java.util.EventObject, org.apache.cayenne.event.EventSubject)">postNonBlockingEvent</A></B>(java.util.EventObject&nbsp;event,
<A HREF="../../../../org/apache/cayenne/event/EventSubject.html" title="class in org.apache.cayenne.event">EventSubject</A>&nbsp;subject)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sends an event to all registered objects about a particular subject.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/cayenne/event/EventManager.html#removeAllListeners(org.apache.cayenne.event.EventSubject)">removeAllListeners</A></B>(<A HREF="../../../../org/apache/cayenne/event/EventSubject.html" title="class in org.apache.cayenne.event">EventSubject</A>&nbsp;subject)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes all listeners for a given subject.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/cayenne/event/EventManager.html#removeListener(java.lang.Object)">removeListener</A></B>(java.lang.Object&nbsp;listener)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Unregister the specified listener from all event subjects handled by this
<code>EventManager</code> instance.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/cayenne/event/EventManager.html#removeListener(java.lang.Object, org.apache.cayenne.event.EventSubject)">removeListener</A></B>(java.lang.Object&nbsp;listener,
<A HREF="../../../../org/apache/cayenne/event/EventSubject.html" title="class in org.apache.cayenne.event">EventSubject</A>&nbsp;subject)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Unregister the specified listener for the events about the given subject.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/cayenne/event/EventManager.html#removeListener(java.lang.Object, org.apache.cayenne.event.EventSubject, java.lang.Object)">removeListener</A></B>(java.lang.Object&nbsp;listener,
<A HREF="../../../../org/apache/cayenne/event/EventSubject.html" title="class in org.apache.cayenne.event">EventSubject</A>&nbsp;subject,
java.lang.Object&nbsp;sender)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Unregister the specified listener for the events about the given subject and the
given sender.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>
<!-- ============ FIELD DETAIL =========== -->
<A NAME="field_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Field Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="DEFAULT_DISPATCH_THREAD_COUNT"><!-- --></A><H3>
DEFAULT_DISPATCH_THREAD_COUNT</H3>
<PRE>
public static final int <B>DEFAULT_DISPATCH_THREAD_COUNT</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.apache.cayenne.event.EventManager.DEFAULT_DISPATCH_THREAD_COUNT">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="subjects"><!-- --></A><H3>
subjects</H3>
<PRE>
protected java.util.Map <B>subjects</B></PRE>
<DL>
<DL>
</DL>
</DL>
<HR>
<A NAME="eventQueue"><!-- --></A><H3>
eventQueue</H3>
<PRE>
protected java.util.List <B>eventQueue</B></PRE>
<DL>
<DL>
</DL>
</DL>
<HR>
<A NAME="singleThread"><!-- --></A><H3>
singleThread</H3>
<PRE>
protected boolean <B>singleThread</B></PRE>
<DL>
<DL>
</DL>
</DL>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="EventManager()"><!-- --></A><H3>
EventManager</H3>
<PRE>
public <B>EventManager</B>()</PRE>
<DL>
<DD>Creates a multithreaded EventManager using default thread count.
<P>
</DL>
<HR>
<A NAME="EventManager(int)"><!-- --></A><H3>
EventManager</H3>
<PRE>
public <B>EventManager</B>(int&nbsp;dispatchThreadCount)</PRE>
<DL>
<DD>Creates an EventManager starting the specified number of threads for multithreaded
dispatching. To create a single-threaded EventManager, use thread count of zero or
less.
<P>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="getDefaultManager()"><!-- --></A><H3>
getDefaultManager</H3>
<PRE>
public static <A HREF="../../../../org/apache/cayenne/event/EventManager.html" title="class in org.apache.cayenne.event">EventManager</A> <B>getDefaultManager</B>()</PRE>
<DL>
<DD>Returns the shared EventManager. It is created on demand on the first call to this
method. Cayenne internally doesn't use default EventManager. Instead Configuration
EventManager is propagated to DataDomains and DataContexts.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>EventManager the shared EventManager instance</DL>
</DD>
</DL>
<HR>
<A NAME="isSingleThreaded()"><!-- --></A><H3>
isSingleThreaded</H3>
<PRE>
public boolean <B>isSingleThreaded</B>()</PRE>
<DL>
<DD>Returns true if this EventManager is single-threaded. If so it will throw an
exception on any attempt to register an unblocking listener or dispatch a
non-blocking event.
<P>
<DD><DL>
<DT><B>Since:</B></DT>
<DD>1.2</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="getEventQueue()"><!-- --></A><H3>
getEventQueue</H3>
<PRE>
public java.util.List <B>getEventQueue</B>()</PRE>
<DL>
<DD>Returns a list of currently queued events. Queue is returned by copy. This method
is useful for inspecting the state of the event queue at any particular moment, but
doesn't allow callers to alter the queue state.
<P>
<DD><DL>
<DT><B>Since:</B></DT>
<DD>1.1</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="addListener(java.lang.Object, java.lang.String, java.lang.Class, org.apache.cayenne.event.EventSubject)"><!-- --></A><H3>
addListener</H3>
<PRE>
public void <B>addListener</B>(java.lang.Object&nbsp;listener,
java.lang.String&nbsp;methodName,
java.lang.Class&nbsp;eventParameterClass,
<A HREF="../../../../org/apache/cayenne/event/EventSubject.html" title="class in org.apache.cayenne.event">EventSubject</A>&nbsp;subject)</PRE>
<DL>
<DD>Register an <code>EventListener</code> for events sent by any sender.
<P>
<DD><DL>
<DT><B>Throws:</B>
<DD><CODE>java.lang.RuntimeException</CODE> - if <code>methodName</code> is not found<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/cayenne/event/EventManager.html#addListener(java.lang.Object, java.lang.String, java.lang.Class, org.apache.cayenne.event.EventSubject, java.lang.Object)"><CODE>addListener(Object, String, Class, EventSubject, Object)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="addNonBlockingListener(java.lang.Object, java.lang.String, java.lang.Class, org.apache.cayenne.event.EventSubject)"><!-- --></A><H3>
addNonBlockingListener</H3>
<PRE>
public void <B>addNonBlockingListener</B>(java.lang.Object&nbsp;listener,
java.lang.String&nbsp;methodName,
java.lang.Class&nbsp;eventParameterClass,
<A HREF="../../../../org/apache/cayenne/event/EventSubject.html" title="class in org.apache.cayenne.event">EventSubject</A>&nbsp;subject)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="addListener(java.lang.Object, java.lang.String, java.lang.Class, org.apache.cayenne.event.EventSubject, java.lang.Object)"><!-- --></A><H3>
addListener</H3>
<PRE>
public void <B>addListener</B>(java.lang.Object&nbsp;listener,
java.lang.String&nbsp;methodName,
java.lang.Class&nbsp;eventParameterClass,
<A HREF="../../../../org/apache/cayenne/event/EventSubject.html" title="class in org.apache.cayenne.event">EventSubject</A>&nbsp;subject,
java.lang.Object&nbsp;sender)</PRE>
<DL>
<DD>Register an <code>EventListener</code> for events sent by a specific sender.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>listener</CODE> - the object to be notified about events<DD><CODE>methodName</CODE> - the name of the listener method to be invoked<DD><CODE>eventParameterClass</CODE> - the class of the single event argument passed to
<code>methodName</code><DD><CODE>subject</CODE> - the event subject that the listener is interested in<DD><CODE>sender</CODE> - the object whose events the listener is interested in;
<code>null</code> means 'any sender'.
<DT><B>Throws:</B>
<DD><CODE>java.lang.RuntimeException</CODE> - if <code>methodName</code> is not found</DL>
</DD>
</DL>
<HR>
<A NAME="addNonBlockingListener(java.lang.Object, java.lang.String, java.lang.Class, org.apache.cayenne.event.EventSubject, java.lang.Object)"><!-- --></A><H3>
addNonBlockingListener</H3>
<PRE>
public void <B>addNonBlockingListener</B>(java.lang.Object&nbsp;listener,
java.lang.String&nbsp;methodName,
java.lang.Class&nbsp;eventParameterClass,
<A HREF="../../../../org/apache/cayenne/event/EventSubject.html" title="class in org.apache.cayenne.event">EventSubject</A>&nbsp;subject,
java.lang.Object&nbsp;sender)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="addListener(java.lang.Object, java.lang.String, java.lang.Class, org.apache.cayenne.event.EventSubject, java.lang.Object, boolean)"><!-- --></A><H3>
addListener</H3>
<PRE>
protected void <B>addListener</B>(java.lang.Object&nbsp;listener,
java.lang.String&nbsp;methodName,
java.lang.Class&nbsp;eventParameterClass,
<A HREF="../../../../org/apache/cayenne/event/EventSubject.html" title="class in org.apache.cayenne.event">EventSubject</A>&nbsp;subject,
java.lang.Object&nbsp;sender,
boolean&nbsp;blocking)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="removeListener(java.lang.Object)"><!-- --></A><H3>
removeListener</H3>
<PRE>
public boolean <B>removeListener</B>(java.lang.Object&nbsp;listener)</PRE>
<DL>
<DD>Unregister the specified listener from all event subjects handled by this
<code>EventManager</code> instance.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>listener</CODE> - the object to be unregistered
<DT><B>Returns:</B><DD><code>true</code> if <code>listener</code> could be removed for any
existing subjects, else returns <code>false</code>.</DL>
</DD>
</DL>
<HR>
<A NAME="removeAllListeners(org.apache.cayenne.event.EventSubject)"><!-- --></A><H3>
removeAllListeners</H3>
<PRE>
public boolean <B>removeAllListeners</B>(<A HREF="../../../../org/apache/cayenne/event/EventSubject.html" title="class in org.apache.cayenne.event">EventSubject</A>&nbsp;subject)</PRE>
<DL>
<DD>Removes all listeners for a given subject.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="removeListener(java.lang.Object, org.apache.cayenne.event.EventSubject)"><!-- --></A><H3>
removeListener</H3>
<PRE>
public boolean <B>removeListener</B>(java.lang.Object&nbsp;listener,
<A HREF="../../../../org/apache/cayenne/event/EventSubject.html" title="class in org.apache.cayenne.event">EventSubject</A>&nbsp;subject)</PRE>
<DL>
<DD>Unregister the specified listener for the events about the given subject.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>listener</CODE> - the object to be unregistered<DD><CODE>subject</CODE> - the subject from which the listener is to be unregistered
<DT><B>Returns:</B><DD><code>true</code> if <code>listener</code> could be removed for the
given subject, else returns <code>false</code>.</DL>
</DD>
</DL>
<HR>
<A NAME="removeListener(java.lang.Object, org.apache.cayenne.event.EventSubject, java.lang.Object)"><!-- --></A><H3>
removeListener</H3>
<PRE>
public boolean <B>removeListener</B>(java.lang.Object&nbsp;listener,
<A HREF="../../../../org/apache/cayenne/event/EventSubject.html" title="class in org.apache.cayenne.event">EventSubject</A>&nbsp;subject,
java.lang.Object&nbsp;sender)</PRE>
<DL>
<DD>Unregister the specified listener for the events about the given subject and the
given sender.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>listener</CODE> - the object to be unregistered<DD><CODE>subject</CODE> - the subject from which the listener is to be unregistered<DD><CODE>sender</CODE> - the object whose events the listener was interested in;
<code>null</code> means 'any sender'.
<DT><B>Returns:</B><DD><code>true</code> if <code>listener</code> could be removed for the
given subject, else returns <code>false</code>.</DL>
</DD>
</DL>
<HR>
<A NAME="postEvent(java.util.EventObject, org.apache.cayenne.event.EventSubject)"><!-- --></A><H3>
postEvent</H3>
<PRE>
public void <B>postEvent</B>(java.util.EventObject&nbsp;event,
<A HREF="../../../../org/apache/cayenne/event/EventSubject.html" title="class in org.apache.cayenne.event">EventSubject</A>&nbsp;subject)</PRE>
<DL>
<DD>Sends an event to all registered objects about a particular subject. Event is sent
synchronously, so the sender thread is blocked until all the listeners finish
processing the event.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>event</CODE> - the event to be posted to the observers<DD><CODE>subject</CODE> - the subject about which observers will be notified
<DT><B>Throws:</B>
<DD><CODE>java.lang.IllegalArgumentException</CODE> - if event or subject are null</DL>
</DD>
</DL>
<HR>
<A NAME="postNonBlockingEvent(java.util.EventObject, org.apache.cayenne.event.EventSubject)"><!-- --></A><H3>
postNonBlockingEvent</H3>
<PRE>
public void <B>postNonBlockingEvent</B>(java.util.EventObject&nbsp;event,
<A HREF="../../../../org/apache/cayenne/event/EventSubject.html" title="class in org.apache.cayenne.event">EventSubject</A>&nbsp;subject)</PRE>
<DL>
<DD>Sends an event to all registered objects about a particular subject. Event is
queued by EventManager, releasing the sender thread, and is later dispatched in a
separate thread.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>event</CODE> - the event to be posted to the observers<DD><CODE>subject</CODE> - the subject about which observers will be notified
<DT><B>Throws:</B>
<DD><CODE>java.lang.IllegalArgumentException</CODE> - if event or subject are null<DT><B>Since:</B></DT>
<DD>1.1</DD>
</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../org/apache/cayenne/event/EventBridgeFactory.html" title="interface in org.apache.cayenne.event"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../org/apache/cayenne/event/EventSubject.html" title="class in org.apache.cayenne.event"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?org/apache/cayenne/event/EventManager.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="EventManager.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
<i>Copyright &#169; 2001-2006 <a href=
"http://apache.org" target="_top">Apache.org</a> All Rights Reserved.</i>
</BODY>
</HTML>