public class HttpNetwork extends StreamNetwork implements HttpNetworkMBean
Modifier and Type | Class and Description |
---|---|
(package private) class |
HttpNetwork.NetServerIn |
(package private) class |
HttpNetwork.NetServerOut |
(package private) class |
HttpNetwork.NetworkInputStream
Class used to read messages through a stream.
|
(package private) class |
HttpNetwork.NetworkOutputStream
Class used to send messages through a stream.
|
Network.NetworkAverageLoadTask
Modifier and Type | Field and Description |
---|---|
protected long |
activationPeriod
Period of time between two activation of NetServerOut, it matches to the
time between two requests from the client to the server when there is no
message to transmit from client to server.
|
(package private) Daemon[] |
dmon
Daemon component
|
(package private) int |
NbDaemon
Number of listening daemon, this value is only valid for the server
part of the HttpNetwork.
|
private InetAddress |
proxy
Network address of proxy server.
|
(package private) String |
proxyhost
Hostname (or IP dotted address) of proxy host, if not defined there
is a direct connection between the client and the server.
|
(package private) int |
proxyport
Port number of proxy if any.
|
(package private) ServerDesc |
server
Descriptor of the listen server, it is used only on the client side
(NetServerOut component).
|
backlog, CnxRetry, ConnectTimeout, inLocalAddr, outLocalAddr, outLocalPort, serverSocketFactory, socketFactory, SoLinger, SoTimeout, TcpNoDelay
ALREADY_DELIVERED, averageLoadTask, bootTSFN, DELIVER, domain, idxLS, logmon, name, nbMessageIn, nbMessageOut, port, qout, servers, serversFN, sid, WDActivationPeriod, WDNbRetryLevel1, WDNbRetryLevel2, WDRetryPeriod1, WDRetryPeriod2, WDRetryPeriod3
Constructor and Description |
---|
HttpNetwork()
Creates a new network component.
|
Modifier and Type | Method and Description |
---|---|
long |
getActivationPeriod()
Gets the activationPeriod value.
|
long |
getNbDaemon()
Gets the NbDaemon value.
|
String |
getProxyhost()
Gets the proxyhost value.
|
long |
getProxyport()
Gets the proxyport value.
|
protected void |
getReply(InputStream is,
HttpNetwork.NetworkInputStream nis,
byte[] buf) |
protected short |
getRequest(InputStream is,
HttpNetwork.NetworkInputStream nis,
byte[] buf) |
protected int |
handle(Message msgout,
HttpNetwork.NetworkInputStream nis) |
void |
init(String name,
int port,
short[] servers)
Initializes a new network component.
|
boolean |
isRunning()
Tests if the network component is alive.
|
(package private) String |
readLine(InputStream is,
byte[] buf) |
protected void |
sendReply(Message msg,
OutputStream os,
HttpNetwork.NetworkOutputStream nos,
int ack,
long currentTimeMillis) |
protected void |
sendRequest(Message msg,
OutputStream os,
HttpNetwork.NetworkOutputStream nos,
int ack,
long currentTimeMillis) |
void |
setActivationPeriod(long activationPeriod)
Sets the activationPeriod value.
|
void |
start()
Causes this network component to begin execution.
|
void |
stop()
Forces the network component to stop executing.
|
String |
toString()
Returns a string representation of this consumer, including the
daemon's name and status.
|
void |
wakeup()
Wakes up the watch-dog thread.
|
createServerSocket, createServerSocket, createSocket, createSocket, createSocket, setProperties, setSocketOption
addServer, channelPostAndValidate, checkActive, delete, deleteMessage, deliver, delServer, getAverageLoad1, getAverageLoad15, getAverageLoad5, getBootTS, getDomainName, getMessageDest, getMessageSource, getName, getNbMessageReceived, getNbMessageSent, getNbWaitingMessages, getPort, getQueue, getStamp, getWDActivationPeriod, getWDNbRetryLevel1, getWDNbRetryLevel2, getWDRetryPeriod1, getWDRetryPeriod2, getWDRetryPeriod3, index, insert, post, postAndValidate, postMessage, prepareMessage, prepareMessageWithoutStamp, resetServer, restore, save, saveChannel, setMessageSource, setPort, setStamp, setWDActivationPeriod, setWDNbRetryLevel1, setWDNbRetryLevel2, setWDRetryPeriod1, setWDRetryPeriod2, setWDRetryPeriod3, testBootTS, testRecvUpdate, validate, validateChannel
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getAverageLoad1, getAverageLoad15, getAverageLoad5, getName, getNbMessageReceived, getNbMessageSent, getNbWaitingMessages, getWDActivationPeriod, getWDNbRetryLevel1, getWDNbRetryLevel2, getWDRetryPeriod1, getWDRetryPeriod2, getWDRetryPeriod3, setWDActivationPeriod, setWDNbRetryLevel1, setWDNbRetryLevel2, setWDRetryPeriod1, setWDRetryPeriod2, setWDRetryPeriod3
private InetAddress proxy
String proxyhost
proxyhost
global property or for a particular
network by setting <DomainName>.proxyhost
specific property.
Theses properties can be fixed either from java
launching
command, or in a3servers.xml
configuration file.
int proxyport
proxyport
global property or for a particular
network by setting <DomainName>.proxyport
specific property.
Theses properties can be fixed either from java
launching
command, or in a3servers.xml
configuration file.
protected long activationPeriod
ActivationPeriod
global property or for a particular network by setting
<DomainName>.ActivationPeriod
specific property.
Theses properties can be fixed either from java
launching
command, or in a3servers.xml
configuration file. By default,
its value is 10000 (10s).
int NbDaemon
NbDaemon
global property or for a particular network by
setting <DomainName>.NbDaemon
specific property.
Theses properties can be fixed either from java
launching
command, or in a3servers.xml
configuration file.
ServerDesc server
Daemon[] dmon
public String getProxyhost()
getProxyhost
in interface HttpNetworkMBean
public long getProxyport()
getProxyport
in interface HttpNetworkMBean
public long getActivationPeriod()
getActivationPeriod
in interface HttpNetworkMBean
public void setActivationPeriod(long activationPeriod)
setActivationPeriod
in interface HttpNetworkMBean
activationPeriod
- the activationPeriod valuepublic long getNbDaemon()
getNbDaemon
in interface HttpNetworkMBean
public void init(String name, int port, short[] servers) throws Exception
Class.newInstance()
method for create
(whitout any parameter) the component, then we can initialize it with
this method.init
in class StreamNetwork
name
- The domain name.port
- The listen port.servers
- The list of servers directly accessible from this
network interface.Exception
- an error occurs.Network
public void start() throws Exception
start
in interface MessageConsumer
start
in interface NetworkMBean
Exception
- an error occurs.stop
public void wakeup()
public void stop()
stop
in interface MessageConsumer
stop
in interface NetworkMBean
start
public boolean isRunning()
isRunning
in interface MessageConsumer
isRunning
in interface NetworkMBean
MessageConsumer
is alive; false
otherwise.public String toString()
toString
in interface NetworkMBean
toString
in class Network
String readLine(InputStream is, byte[] buf) throws IOException
IOException
protected void sendRequest(Message msg, OutputStream os, HttpNetwork.NetworkOutputStream nos, int ack, long currentTimeMillis) throws Exception
Exception
protected final short getRequest(InputStream is, HttpNetwork.NetworkInputStream nis, byte[] buf) throws Exception
Exception
protected final void sendReply(Message msg, OutputStream os, HttpNetwork.NetworkOutputStream nos, int ack, long currentTimeMillis) throws Exception
Exception
protected void getReply(InputStream is, HttpNetwork.NetworkInputStream nis, byte[] buf) throws Exception
Exception
protected int handle(Message msgout, HttpNetwork.NetworkInputStream nis) throws Exception
Exception
Copyright © 2021 ScalAgent D.T.. All rights reserved.