Package: com.multiversesocial.hyperview
Class: com.multiversesocial.hyperview.HyperNBInputHandler
Source: src/com/multiversesocial/hyperview/HyperNBInputHandler.java

HyperNBInputHandler

HyperView V3.2 — class
version V3.2 class

Summary

HyperNBInputHandler.class by Tony Swain ie: NB = non blocking This class runs in a Thread and shares an interleaved Selector with HyperNBOutputHandler.class It also delegates IO to the various HyperChannel IOReply interfaces. There are 2 levels of IO. Base and Channel. Base IO uses HyperNodeReadVector.class In the demo server this is set to simply requeue itself. Input Handler calls Base IO -> HyperNodeReadVector.function(); / or -| The Input Handler accrues a channel InputVector list \ and h...

Source file: HyperNBInputHandler.java

Hierarchy

Extends: none

Implements: Runnable, HyperNodeConstants, ThreadReport

Referenced HyperView classes

Media files used

Declaration & members

public class HyperNBInputHandler implements Runnable, HyperNodeConstants, ThreadReport

Declared in src/com/multiversesocial/hyperview/HyperNBInputHandler.java, lines 27–912. 35 field(s), 1 constructor(s), 9 method(s). Every member has an anchor you can link to (e.g. HyperNBInputHandler.html#<id>).

Fields (35)

DeclarationValue / initializerDescriptionSource
int accruedTimeoutSeconds= 0No comment in source; assigned in HyperNBInputHandler().line 34
HyperChannel[] channelNo comment in source; assigned in run().line 60
volatile HyperLinkedList[] channelInputVectorListNo comment in source; used in run().line 66
volatile HyperLinkedList channelIOListNo comment in source; used in run().line 65
HyperDisconnectHandler disconnectHandlerNo comment in source; assigned in HyperNBInputHandler().line 49
HyperChannelRegistry hyperChannelRegistryNo comment in source; name appears in 3 other source file(s): HyperChannel, HyperConnectionHandler, HyperNBOutputHandler.line 59
boolean[] impendingChannelIONo comment in source; assigned in run().line 62
boolean[] impendingI0No comment in source; name appears in 3 other source file(s): HyperChannel, HyperChannelRegistry, HyperNBOutputHandler.line 61
Iterator ioIteratorNo comment in source; assigned in run().line 44
Set ioReadyKeysNo comment in source; assigned in run().line 45
SelectionKey ioSelectionKeyNo comment in source; assigned in run().line 47
Selector ioSelectorNo comment in source; assigned in run(), channelCleanUp().line 46
int iteration= 0No comment in source; assigned in HyperNBInputHandler(), run(), getRunInfo().line 37
long lastRun= 0No comment in source; assigned in HyperNBInputHandler(), start(), run(), getRunInfo().line 42
Object masterSocketChannelLockNo comment in source; assigned in HyperNBInputHandler(); used in run().line 52
long now= 0No comment in source; assigned in HyperNBInputHandler(), start(), getRunInfo(); used in run().line 40
HyperConnectionHandler parentHandlerNo comment in source; assigned in HyperNBInputHandler(); used in start(), stop().line 48
int processCount= 0hmm 27 years and this wraps :)line 38
static volatile HyperLinkedList readAddList= new HyperLinkedList("HyperNBInputHandler.readAddList")No comment in source; used in run(); name appears in 2 other source file(s): HyperChannel, HyperConnectionNode.line 55
volatile HyperLinkedList readExceptionListNo comment in source; assigned in HyperNBInputHandler(); used in run().line 56
int readFlags= 0main flagsline 33
volatile HyperLinkedList readListNo comment in source; assigned in HyperNBInputHandler(); used in run().line 53
volatile HyperLinkedList readReadyListNo comment in source; assigned in HyperNBInputHandler(); used in run().line 54
volatile HyperLinkedList readRegistrationWaitListNo comment in source; assigned in HyperNBInputHandler(); used in run().line 57
Thread readTaskNo comment in source; assigned in start(), stop(); used in run().line 51
RunInfo runInfo= new RunInfo(this)No comment in source; assigned in HyperNBInputHandler(); used in start(), stop(), run(), getRunInfo().line 29
static int selectWait= 1000No comment in source; used in run().line 30
long startTime= 0No comment in source; assigned in HyperNBInputHandler(), start(), getRunInfo().line 41
int timeoutCheckSeconds= 1No comment in source; assigned in HyperNBInputHandler().line 35
public int totalChannelsNo comment in source; name appears in 5 other source file(s): ChannelControlPane, HyperChannel, HyperChannelRegistry, HyperNBOutputHandler ….line 63
int totalInputs= 0No comment in source; assigned in HyperNBInputHandler().line 50
int totalKeys= 0No comment in source; assigned in HyperNBInputHandler(), run().line 36
long totalReadBytes= 0No comment in source; assigned in HyperNBInputHandler(), run().line 43
static int waitTime= 20No comment in source; assigned in HyperNBInputHandler(), getRunInfo(); used in run(); name appears in 14 other source file(s): CollisionManager, Dispatch, HyperChannel, HyperConnectionHandler ….line 31

Constructors (1)

SignatureDescriptionSource
HyperNBInputHandler(HyperConnectionHandler tHandler)23 statement(s); calls super(), HyperChannelRegistry.synch(); creates HyperLinkedList, RunInfo.line 68

Methods (9)

SignatureDescriptionSource
static { … }Implicit default constructor generated by the compiler (not written in the source).implicit
void anyKey()2 statement(s); calls System.in.read(), wait().line 835
public void channelCleanUp()Cont CloseNetXecChannel / ContShutdownDisplay ordered teardown analog.line 893
public RunInfo getRunInfo()7 statement(s).
Implements ThreadReport.getRunInfo()
line 882
void pause(int pauseTime)1 statement(s); calls wait(), notifyAll().line 865
public void run()16 statement(s); calls Thread.currentThread(), HyperConnectionHandler.waitIOExec(), SelectorProvider.provider().openSelector(), SelectorProvider.provider(), ioex1.printStackTrace() ….
Implements Runnable.run()
line 137
public synchronized void start()9 statement(s); calls System.currentTimeMillis(), readTask.setName(), readTask.start(), parentHandler.parentView.hyperExec.addThread(), notifyAll(); creates Thread.line 103
public synchronized void stop()6 statement(s); calls parentHandler.parentView.hyperExec.remThread(), tTask.interrupt(), notifyAll().line 120
public String toString()Returns "HyperNBInputHandler(" + super.toString() + ')'.
Overrides Object.toString()
line 859

Examples

Real usage taken from elsewhere in the HyperView 3.2 source (file and line shown; source path src/com/multiversesocial/hyperview/).

instantiation — HyperConnectionHandler.java, line 155

  155  inputHandler               = new HyperNBInputHandler(this);

declaration — DisconnectTimer.java, line 13

   13  HyperNBInputHandler inputHandler;

declaration — HyperChannel.java, line 52

   52  HyperNBInputHandler parentInputHandler;
Hits--