org.freecompany.util.multicaster
Class DefaultMulticaster

java.lang.Object
  extended by org.freecompany.util.multicaster.DefaultMulticaster

public class DefaultMulticaster
extends Object

Default multicaster implementation using dynamic proxy instances. Since method invocations on a dynamic proxy have a small but measurable performance penalty, this implementation is not recommended for use in hot-path code.


Nested Class Summary
static class DefaultMulticaster.Handler<T>
           
 
Field Summary
static InvocationHandler NULL
           
 
Constructor Summary
DefaultMulticaster()
           
 
Method Summary
static
<T> T
add(Class<T> clazz, T a, T b)
          Uses the current classloader as the passed class may well be a core JVM interface, in which case it's classloader can not see the Multicaster class.
static
<T> T
empty(Class<T> clazz)
          Uses the current classloader as the passed class may well be a core JVM interface, in which case the default classloader would not be able to see the Multicaster class.
static
<T> T
remove(Class<T> clazz, T a, T b)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NULL

public static InvocationHandler NULL
Constructor Detail

DefaultMulticaster

public DefaultMulticaster()
Method Detail

empty

public static <T> T empty(Class<T> clazz)
Uses the current classloader as the passed class may well be a core JVM interface, in which case the default classloader would not be able to see the Multicaster class.


add

public static <T> T add(Class<T> clazz,
                        T a,
                        T b)
Uses the current classloader as the passed class may well be a core JVM interface, in which case it's classloader can not see the Multicaster class.


remove

public static <T> T remove(Class<T> clazz,
                           T a,
                           T b)