fr.dyade.aaa.agent

Class NGNetwork

Implemented Interfaces:
MessageConsumer, NetworkMBean

public class NGNetwork
extends StreamNetwork

NGNetwork is a new implementation of Network class using nio package.

Field Summary

Fields inherited from class fr.dyade.aaa.agent.Network

bootTSFN, domain, idxLS, logmon, name, port, qout, servers, serversFN, sid

Constructor Summary

NGNetwork()
Creates a new network component.

Method Summary

void
init(String name, int port, short[] servers)
Initializes a new network component.
boolean
isRunning()
Tests if the network component is alive.
void
post(fr.dyade.aaa.agent.Message msg)
Adds a message in "ready to deliver" list.
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.

Methods inherited from class fr.dyade.aaa.agent.StreamNetwork

init

Methods inherited from class fr.dyade.aaa.agent.Network

delete, deliver, getDomainName, getName, getPort, getQueue, index, init, insert, post, restore, save, setPort, toString, validate

Constructor Details

NGNetwork

public NGNetwork()
Creates a new network component.

Method Details

init

public void init(String name,
                 int port,
                 short[] servers)
            throws Exception
Initializes a new network component. This method is used in order to easily creates and configure a Network component from a class name. So we can use the Class.newInstance() method for create (whitout any parameter) the component, then we can initialize it with this method.
This method initializes the logical clock for the domain.
Overrides:
init in interface StreamNetwork

Parameters:
name - The domain name.
port - The listen port.
servers - The list of servers directly accessible from this network interface.


isRunning

public boolean isRunning()
Tests if the network component is alive.
Specified by:
isRunning in interface MessageConsumer
isRunning in interface NetworkMBean

Returns:
true if this MessageConsumer is alive; false otherwise.


post

public void post(fr.dyade.aaa.agent.Message msg)
            throws Exception
Adds a message in "ready to deliver" list. This method allocates a new time stamp to the message ; be Careful, changing the stamp imply the filename change too.
Specified by:
post in interface MessageConsumer
Overrides:
post in interface Network


start

public void start()
            throws Exception
Causes this network component to begin execution.
Specified by:
start in interface MessageConsumer
start in interface NetworkMBean


stop

public void stop()
Forces the network component to stop executing.
Specified by:
stop in interface MessageConsumer
stop in interface NetworkMBean


toString

public String toString()
Returns a string representation of this consumer, including the daemon's name and status.
Overrides:
toString in interface Network

Returns:
A string representation of this consumer.


wakeup

public void wakeup()
Wakes up the watch-dog thread.


Copyright B) 2004 Scalagent - All rights reserved