org.yestech.event.multicaster
Class BaseEventMulticaster<EVENT extends IEvent,RESULT>

java.lang.Object
  extended by org.yestech.event.multicaster.BaseEventMulticaster<EVENT,RESULT>
Type Parameters:
EVENT - An implementation of IEvent, The event type the multicaster will handle.
RESULT - A serializable result that result type can handle.
All Implemented Interfaces:
IEventMulticaster<EVENT,RESULT>
Direct Known Subclasses:
AggregatingEventMulticaster, CamelEventMulticaster, DefaultEventMulticaster

public abstract class BaseEventMulticaster<EVENT extends IEvent,RESULT>
extends Object
implements IEventMulticaster<EVENT,RESULT>

Base Class for IEventMulticaster


Constructor Summary
BaseEventMulticaster()
           
 
Method Summary
<L extends IListener>
void
deregisterListener(L listener)
          DeRegisters a listener from and event it can handle.
 void destroy()
           
 int getCorePoolSize()
           
 long getKeepAliveTime()
           
 int getMaximumPoolSize()
           
 ExecutorService getPool()
           
 void init()
           
protected  void initializeThreadPool()
           
 boolean isCheckResultType()
          Return is the result type should be checked.
protected  void processAsync(EVENT event, ResultReference<RESULT> ref, IListener listener)
           
<L extends IListener>
void
registerListener(L listener)
          Registers a listener with an event it can handle.
 void setCheckResultType(boolean resultTypeCheck)
          Sets whether the type of result is checked or not.
 void setCorePoolSize(int corePoolSize)
           
 void setKeepAliveTime(long keepAliveTime)
           
 void setMaximumPoolSize(int maximumPoolSize)
           
 void setPool(ExecutorService pool)
           
protected  void validate(EVENT event, Object result)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.yestech.event.multicaster.IEventMulticaster
process
 

Constructor Detail

BaseEventMulticaster

public BaseEventMulticaster()
Method Detail

deregisterListener

public <L extends IListener> void deregisterListener(L listener)
Description copied from interface: IEventMulticaster
DeRegisters a listener from and event it can handle.

Specified by:
deregisterListener in interface IEventMulticaster<EVENT extends IEvent,RESULT>
Parameters:
listener - Listener to deregister

registerListener

public <L extends IListener> void registerListener(L listener)
Description copied from interface: IEventMulticaster
Registers a listener with an event it can handle.

Specified by:
registerListener in interface IEventMulticaster<EVENT extends IEvent,RESULT>
Parameters:
listener - Listener to register

getPool

public ExecutorService getPool()

setPool

public void setPool(ExecutorService pool)

getCorePoolSize

public int getCorePoolSize()

setCorePoolSize

public void setCorePoolSize(int corePoolSize)

getMaximumPoolSize

public int getMaximumPoolSize()

setMaximumPoolSize

public void setMaximumPoolSize(int maximumPoolSize)

getKeepAliveTime

public long getKeepAliveTime()

setKeepAliveTime

public void setKeepAliveTime(long keepAliveTime)

isCheckResultType

public boolean isCheckResultType()
Description copied from interface: IEventMulticaster
Return is the result type should be checked.

Specified by:
isCheckResultType in interface IEventMulticaster<EVENT extends IEvent,RESULT>
Returns:

setCheckResultType

public void setCheckResultType(boolean resultTypeCheck)
Description copied from interface: IEventMulticaster
Sets whether the type of result is checked or not.

Specified by:
setCheckResultType in interface IEventMulticaster<EVENT extends IEvent,RESULT>

destroy

@PreDestroy
public void destroy()

init

@PostConstruct
public void init()

initializeThreadPool

protected void initializeThreadPool()

processAsync

protected void processAsync(EVENT event,
                            ResultReference<RESULT> ref,
                            IListener listener)

validate

protected void validate(EVENT event,
                        Object result)


Copyright © 2010 YES Technology Association. All Rights Reserved.