Methods Summary |
---|
public boolean | isBlockingNotification()Return true if the invoker of notify() should block when
notifying Comet Handlers.
return blockingNotification;
|
public void | notify(CometEvent cometEvent, java.util.Iterator iteratorHandlers)Notify all CometHandler .
if (blockingNotification || pipeline == null){
notify0(cometEvent,iteratorHandlers);
} else {
pipeline.addTask(new TaskBase(){
public void doTask() throws IOException{
notify0(cometEvent,iteratorHandlers);
}
});
}
|
public void | notify(CometEvent cometEvent, CometHandler cometHandler)Notify a single CometHandler .
if (blockingNotification || pipeline == null){
notify0(cometEvent,cometHandler);
} else {
final ArrayList<Throwable> exceptions
= new ArrayList<Throwable>();
pipeline.addTask(new TaskBase(){
public void doTask() throws IOException{
try{
notify0(cometEvent,cometHandler);
} catch (Throwable ex){
exceptions.add(ex);
}
if (exceptions.size() > 0){
StringBuffer errorMsg = new StringBuffer();
for(Throwable t: exceptions){
errorMsg.append(t.getMessage());
}
throw new IOException(errorMsg.toString());
}
}
});
}
|
protected void | notify0(CometEvent cometEvent, java.util.Iterator iteratorHandlers)
ArrayList<Throwable> exceptions = null;
while(iteratorHandlers.hasNext()){
try{
notify0(cometEvent,iteratorHandlers.next());
} catch (Throwable ex){
if (exceptions == null){
exceptions = new ArrayList<Throwable>();
}
exceptions.add(ex);
}
}
if (exceptions != null){
StringBuffer errorMsg = new StringBuffer();
for(Throwable t: exceptions){
errorMsg.append(t.getMessage());
}
throw new IOException(errorMsg.toString());
}
|
protected void | notify0(CometEvent cometEvent, CometHandler cometHandler)Notify a CometHandler .
CometEvent.INTERRUPT -> CometHandler.onInterrupt
CometEvent.NOTIFY -> CometHandler.onEvent
CometEvent.INITIALIZE -> CometHandler.onInitialize
CometEvent.TERMINATE -> CometHandler.onTerminate
CometEvent.READ -> CometHandler.onEvent
CometEvent.WRITE -> CometHandler.onEvent
switch (cometEvent.getType()) {
case CometEvent.INTERRUPT:
cometHandler.onInterrupt(cometEvent);
break;
case CometEvent.NOTIFY:
cometHandler.onEvent(cometEvent);
break;
case CometEvent.READ:
cometHandler.onEvent(cometEvent);
break;
case CometEvent.WRITE:
cometHandler.onEvent(cometEvent);
break;
case CometEvent.INITIALIZE:
cometHandler.onInitialize(cometEvent);
break;
case CometEvent.TERMINATE:
cometHandler.onTerminate(cometEvent);
break;
default:
throw new IllegalStateException();
}
|
public void | setBlockingNotification(boolean blockingNotification)Set to true if the invoker of notify() should block when
notifying Comet Handlers.
this.blockingNotification = blockingNotification;
|
protected void | setPipeline(com.sun.enterprise.web.connector.grizzly.Pipeline pipeline)Set the Pipeline used for notifying the CometHandler.
this.pipeline = pipeline;
|