NetKernel APIs


com.ten60.netkernel.transport
Class TransportManager

java.lang.Object
  extended bycom.ten60.netkernel.urii.representation.SimpleRepresentationImpl
      extended bycom.ten60.netkernel.container.ComponentImpl
          extended bycom.ten60.netkernel.transport.TransportManager
All Implemented Interfaces:
IAspectBinaryStream, IComponent, IURAspect, IURRepresentation, IURRequestor

public class TransportManager
extends ComponentImpl
implements IURRequestor

Transport Manager system component manages the startup and shutdown of all registered transports. It passes requests from transports through the throttle and into the scheduler


Field Summary
static String EX_SERVICE_UNAVAILABLE
          service overload exception
static String INTERNAL_TRANSPORT
          identifier for internal transport that Contain implements and exhibits as an API for JMX and Embedded request making
static URIdentifier URI
          our URI
 
Fields inherited from class com.ten60.netkernel.urii.representation.SimpleRepresentationImpl
mMeta
 
Constructor Summary
TransportManager()
          Creates a new instance of TransportManager
 
Method Summary
 void acceptRequests()
           
 void doPeriodicHouseKeeping()
          doPeriodicHouseKeeping method implemented with null body
 ITransport getInternalTransport()
           
 NetKernelException handleAsyncRequest(URRequest aRequest, ITransport aTransport)
          Called from a Transport this method processes an asynchronous request
 IURRepresentation handleRequest(URRequest aRequest, ITransport aTransport)
          Called from a Transport this method processes a synchronous request
 void holdRequests()
          All new requests will be held until a start()
 IURRepresentation innerHandleRequest(URRequest aRequest, ITransport aTransport)
          Separate method so that Container can call init process without worry of being blocked whilst all else is kept at bay
 void join()
          Wait for all unblocked requests to be completed
It will poll every quarter of a second and requires a clear period of half a second before declaring all-clear
 void receiveAsyncException(URResult aResult)
          We get told when synchronous requests complete
 void receiveAsyncResult(URResult aResult)
          We get told when synchronous requests complete
 void refresh(PairList aTransports)
          Loads current transport configuration from module manager and starts/stops what has changed
 void rejectRequests()
          All new requests will be rejected
 void start(Container aContainer)
          Start the transport manager.
 void stop()
          Stops all the transports
 void write(OutputStream aStream)
          write method implemented with null body
 
Methods inherited from class com.ten60.netkernel.container.ComponentImpl
getEncoding, getURI
 
Methods inherited from class com.ten60.netkernel.urii.representation.SimpleRepresentationImpl
getAspect, getAspects, getMeta, hasAspect
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ten60.netkernel.urii.IURRepresentation
getAspect, getAspects, getMeta, hasAspect
 

Field Detail

URI

public static final URIdentifier URI
our URI


INTERNAL_TRANSPORT

public static final String INTERNAL_TRANSPORT
identifier for internal transport that Contain implements and exhibits as an API for JMX and Embedded request making

See Also:
Constant Field Values

EX_SERVICE_UNAVAILABLE

public static final String EX_SERVICE_UNAVAILABLE
service overload exception

See Also:
Constant Field Values
Constructor Detail

TransportManager

public TransportManager()
Creates a new instance of TransportManager

Method Detail

getInternalTransport

public ITransport getInternalTransport()

start

public void start(Container aContainer)
           throws NetKernelException
Start the transport manager. Creates and starts all the transports

Specified by:
start in interface IComponent
Overrides:
start in class ComponentImpl
Throws:
NetKernelException

refresh

public void refresh(PairList aTransports)
Loads current transport configuration from module manager and starts/stops what has changed


holdRequests

public void holdRequests()
All new requests will be held until a start()


rejectRequests

public void rejectRequests()
All new requests will be rejected


acceptRequests

public void acceptRequests()

stop

public void stop()
          throws NetKernelException
Stops all the transports

Specified by:
stop in interface IComponent
Overrides:
stop in class ComponentImpl
Throws:
NetKernelException

handleRequest

public IURRepresentation handleRequest(URRequest aRequest,
                                       ITransport aTransport)
Called from a Transport this method processes a synchronous request

Parameters:
aRequest - the request to execute
Returns:
the result, exception or not

innerHandleRequest

public IURRepresentation innerHandleRequest(URRequest aRequest,
                                            ITransport aTransport)
                                     throws InterruptedException
Separate method so that Container can call init process without worry of being blocked whilst all else is kept at bay

Throws:
InterruptedException

handleAsyncRequest

public NetKernelException handleAsyncRequest(URRequest aRequest,
                                             ITransport aTransport)
Called from a Transport this method processes an asynchronous request

Parameters:
aRequest - the request to execute
Returns:
an exception caused by being interrupted or overload otherwise null

receiveAsyncResult

public void receiveAsyncResult(URResult aResult)
We get told when synchronous requests complete

Specified by:
receiveAsyncResult in interface IURRequestor
Parameters:
aResult - the result of a previous request

receiveAsyncException

public void receiveAsyncException(URResult aResult)
We get told when synchronous requests complete

Specified by:
receiveAsyncException in interface IURRequestor
Parameters:
aResult - the exception result of a previous request

join

public void join()
Wait for all unblocked requests to be completed
It will poll every quarter of a second and requires a clear period of half a second before declaring all-clear


doPeriodicHouseKeeping

public void doPeriodicHouseKeeping()
Description copied from class: ComponentImpl
doPeriodicHouseKeeping method implemented with null body

Specified by:
doPeriodicHouseKeeping in interface IComponent
Overrides:
doPeriodicHouseKeeping in class ComponentImpl

write

public void write(OutputStream aStream)
           throws IOException
Description copied from class: ComponentImpl
write method implemented with null body

Specified by:
write in interface IAspectBinaryStream
Overrides:
write in class ComponentImpl
Throws:
IOException

NetKernel APIs


Copyright © 2002-2004 1060 Research Ltd. All Rights Reserved.