|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfr.dyade.aaa.agent.Agent
fr.dyade.aaa.agent.ProxyAgent
Field Summary | |
protected boolean |
blockingCnx
true if connect may block |
static int |
DRIVER_IN
|
static int |
DRIVER_OUT
|
protected java.util.Hashtable |
driversTable
Table holding the DriverMonitor objects, each one holding a
connection set (a pair of drivers, a qout, ois, oos, ...). |
protected int |
inFlowControl
flow control in driver in |
protected boolean |
multiConn
true if the proxy manages multiple connections. |
protected boolean |
multipleCnx
true if proxy may handle multiple connection |
protected NotificationInputStream |
ois
input stream, created by subclass during connect |
protected NotificationOutputStream |
oos
output stream, created by subclass during connect |
protected Queue |
qout
communication with drvOut |
Fields inherited from class fr.dyade.aaa.agent.Agent |
fixed, logmon, name |
Constructor Summary | |
ProxyAgent()
|
|
ProxyAgent(short to,
java.lang.String n)
|
|
ProxyAgent(java.lang.String n)
|
|
ProxyAgent(java.lang.String name,
int stamp)
|
Method Summary | |
void |
agentFinalize(boolean lastime)
Finalizes this proxy agent execution. |
protected void |
agentInitialize(boolean firstTime)
Initializes the transient members of this agent. |
void |
cleanDriverOut()
Method cleaning DriverOut. |
void |
cleanDriverOut(int drvKey)
Method cleaning the DriverOut specified
by the key parameter (multi-connections mode). |
protected void |
closeAllConnections()
Closes all the connections. |
abstract void |
connect()
Initializes the connection with the outside, up to creating the input and output streams ois and oos . |
abstract void |
disconnect()
Closes the connection with the outside. |
protected void |
driverDone(DriverDone not)
Reacts to end of driver execution. |
protected void |
driverReact(int key,
Notification not)
Method called by the ProxyAgent DriverIn instances to
forward the notifications they got from their input streams. |
protected java.lang.String |
getLogTopic()
Returns default log topic for proxies. |
void |
react(AgentId from,
Notification not)
Method implementing the ProxyAgent reactions to
notifications. |
protected void |
reinitialize()
Reinitializes the agent, that is reconnects its input and output. |
protected void |
sendOut(int key,
Notification not)
Method called by subclasses to directly send their notifications to the right DriverOut . |
void |
setMultiConn()
Method setting the ProxyAgent in multiConn mode. |
protected void |
stop()
Stops all drivers (non multiConn mode). |
protected void |
stop(int drvKey)
Method stopping the specified connection set (multi-connections mode). |
java.lang.String |
toString()
Provides a string image for this object. |
Methods inherited from class fr.dyade.aaa.agent.Agent |
delete, delete, deploy, deploy, getId, getName, isDeployed, isFixed, needToBeCommited, save, sendTo, sendTo, sendTo, setNoSave |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int DRIVER_IN
public static final int DRIVER_OUT
protected boolean blockingCnx
protected boolean multipleCnx
protected int inFlowControl
protected transient Queue qout
protected boolean multiConn
true
if the proxy manages multiple connections.
protected transient java.util.Hashtable driversTable
DriverMonitor
objects, each one holding a
connection set (a pair of drivers, a qout, ois, oos, ...).
For multi-connections management.
DriverMonitor
protected transient NotificationInputStream ois
protected transient NotificationOutputStream oos
Constructor Detail |
public ProxyAgent()
public ProxyAgent(java.lang.String n)
public ProxyAgent(short to, java.lang.String n)
public ProxyAgent(java.lang.String name, int stamp)
Method Detail |
protected java.lang.String getLogTopic()
Debug.A3Proxy
dot the real classname.
getLogTopic
in class Agent
public java.lang.String toString()
toString
in interface AgentMBean
toString
in class Agent
public void setMultiConn()
ProxyAgent
in multiConn mode.
To be called immediately after the ProxyAgent
instanciation.
protected void agentInitialize(boolean firstTime) throws java.lang.Exception
This function is not declared final so that derived classes may change their reload policy.
agentInitialize
in class Agent
firstTime
- true when first called by the factory
java.lang.Exception
- unspecialized exceptionprotected void reinitialize() throws java.io.IOException
ProxyAgent
manages only one connection at a time.
Otherwise, a multiConn ProxyAgent
will reinitialize
even if the current drivers are not null.
java.io.IOException
public abstract void connect() throws java.lang.Exception
ois
and oos
.
java.lang.Exception
- unspecialized exceptionpublic abstract void disconnect() throws java.lang.Exception
java.lang.Exception
- unspecialized exceptionprotected void stop()
protected void stop(int drvKey)
drvKey
- key identifying the connection set to stop.public void cleanDriverOut()
public void cleanDriverOut(int drvKey)
DriverOut
specified
by the key parameter (multi-connections mode).
drvKey
- key identifying the connection set.protected void closeAllConnections()
protected void driverReact(int key, Notification not)
DriverIn
instances to
forward the notifications they got from their input streams.
May be overridden for specific behaviour as long as the proxy state is not modified by the method, because it does not occur within a transaction.
key
- Driver identifier.not
- Notification to forward.protected void sendOut(int key, Notification not) throws java.lang.Exception
DriverOut
.
key
- Driver identifier.not
- Notification to send out.
java.lang.Exception
- If the driver to pass the notification to can't
be retrieved from the key parameter.public void react(AgentId from, Notification not) throws java.lang.Exception
ProxyAgent
reactions to
notifications.
Forwards notifications coming from an identified agent onto the outgoing
connection.
react
in class Agent
from
- agent sending notificationnot
- notification to react to
java.lang.Exception
- unspecialized exceptionprotected void driverDone(DriverDone not) throws java.io.IOException
This is the end of the driver thread, however the thread resources
may not have been released. This is why close
is called
on the notification streams, which requires from the stream classes
to cope with a call to close
when some resources may have
been released.
java.io.IOException
public void agentFinalize(boolean lastime)
disconnect
to
close the open streams, and stop
to stop the drivers.
agentFinalize
in class Agent
lastime
- true when last called by the factory on agent deletion.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |