Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Test and Performance Tools Platform (TPTP) » Multiple instances of Agent connected to a client
Multiple instances of Agent connected to a client [message #10707] Sun, 20 March 2005 11:45 Go to next message
Eclipse User
Originally posted by: lars.nospam.nix_ohlenDOT.se

Hi,

I have created a HCE Agent using Java. The Agent produces CBEs (by
connecting to a network device and transform the log entries in to CBE)
All works well when one client uses one instance of the Agent.

But we have a need to monitor more that one network device at a time. But
this fails with my current configuration.

The effect (from what I can tell from the HCE daemon log) that the first
session (e.g. connection between client and my agent) drops when I starts
the second instance. It seams that my client code has some "singleton"
behavour and that only one instance can be active.

A couple of questions here:

* Is multi instance of the same agent connected from one client feasable. Is
what I'm trying to do possible?
* Any suggestions what to change in my code?

BR

Lars
Re: Multiple instances of Agent connected to a client [message #11466 is a reply to message #10707] Mon, 21 March 2005 15:48 Go to previous messageGo to next message
Paul Slauenwhite is currently offline Paul Slauenwhite
Messages: 970
Registered: July 2009
Senior Member
Hi Lars,
This problem is a result of creating multiple like-named Logging Agents.
As a solution, create a Logging Agent with a different name for each network
device. As such, you will be able to attach to one/multiple/all of the
Logging Agents using the workbench with problems. However, once a workbench
is monitoring an agent, no other workbench may attach to that named agent
(e.g. unicast communication).

Paul

"Lars Ohl
Re: Multiple instances of Agent connected to a client [message #11540 is a reply to message #11466] Mon, 21 March 2005 19:07 Go to previous messageGo to next message
Eclipse User
Originally posted by: lars.nospam.nix_ohlenDOT.se

Hi Paul,



Actually I found another solution myself. The problem was in the client code
sample that I used as a base for my code.



if (agent == null) {

node.getConnection().disconnect();

mode.connect (port);



When the node is disconnected all processes associated with the node are
terminated. And therefore all previously started agents were killed. I
replaced the "re-connect" code part with a short timer delay. And now all my
agents are active concurrently. Perhaps my "solution" breaks some design
constraint?



I'm really puzzled by the agent lifecycle mechanism. Is it possible to have
a dedicated Agent instance for a client? And the other way around: Is it
possible to share on Agent instance between many clients. If have read the
HLD Specification for the Data Collection & Commnunication Component, but I
guess that

the document describes future implementation.





BR



Lars







"Paul Slauenwhite" <paules@ca.ibm.com> skrev i meddelandet
news:d1mv43$lh7$1@news.eclipse.org...
> Hi Lars,
> This problem is a result of creating multiple like-named Logging
Agents.
> As a solution, create a Logging Agent with a different name for each
network
> device. As such, you will be able to attach to one/multiple/all of the
> Logging Agents using the workbench with problems. However, once a
workbench
> is monitoring an agent, no other workbench may attach to that named agent
> (e.g. unicast communication).
>
> Paul
>
> "Lars Ohl
Re: Multiple instances of Agent connected to a client [message #11577 is a reply to message #11540] Tue, 22 March 2005 12:28 Go to previous messageGo to next message
Paul Slauenwhite is currently offline Paul Slauenwhite
Messages: 970
Registered: July 2009
Senior Member
Hi Lars,
Unfortunately, without seeing more of the client code, I do not know why
there is a reconnection. In theory, if an agent is null, the client code
should attach and starting the remote agent. The connection to the host or
node need only be established once. As such, adding a sleep or delay
certainly does not break any design constraint (other an a performance
degradation) but I question its necessity.

The Agent Controller is undergoing a major rewrite by the folks at Intel
for TPTP v4.0. As such, the architecture will change. The HLD
Specification for the Data Collection & Communication Component document
describes the new architecture.

In short, agents and clients are only tightly coupled after the client
is attached to an agent. The client may detach, which frees the agent to be
reattached or attached by another client. However, agents cannot be
associated with a particular client when not attached and one agent cannot
be attached and monitored by more than one client at one time.

Paul

"Lars Ohl
Re: Multiple instances of Agent connected to a client [message #11613 is a reply to message #11577] Tue, 22 March 2005 14:49 Go to previous messageGo to next message
Eclipse User
Originally posted by: lars._ohlen_nospm.se

Hi Paul,

Thanks for clearing things out. I will try and see if I can remove my sleep
statement, but I'm pretty sure that I did not
get any agent otherwise.

The client code sample I used as a base, was the code that you and Miguel
handed out during tutorial 22 @ eclipsecon.
So I guess that you had altered the code to make it as simple/informative as
possible. BTW your tutorial gave me
the TPTP start I needed. Next I will jump on the TPTP 4.0 train a.s.a.p

Lars



"Paul Slauenwhite" <paules@ca.ibm.com> wrote in message
news:d1p7o5$h1i$1@news.eclipse.org...
> Hi Lars,
> Unfortunately, without seeing more of the client code, I do not know
why
> there is a reconnection. In theory, if an agent is null, the client code
> should attach and starting the remote agent. The connection to the host
or
> node need only be established once. As such, adding a sleep or delay
> certainly does not break any design constraint (other an a performance
> degradation) but I question its necessity.
>
> The Agent Controller is undergoing a major rewrite by the folks at
Intel
> for TPTP v4.0. As such, the architecture will change. The HLD
> Specification for the Data Collection & Communication Component document
> describes the new architecture.
>
> In short, agents and clients are only tightly coupled after the client
> is attached to an agent. The client may detach, which frees the agent to
be
> reattached or attached by another client. However, agents cannot be
> associated with a particular client when not attached and one agent cannot
> be attached and monitored by more than one client at one time.
>
> Paul
>
> "Lars Ohl
Re: Multiple instances of Agent connected to a client [message #11648 is a reply to message #11540] Thu, 24 March 2005 00:44 Go to previous message
Andy Kaylor is currently offline Andy Kaylor
Messages: 23
Registered: July 2009
Junior Member
We do intend for it to be possible to have multiple clients monitoring a
single agent when the new protocol is rolled out, but it will still be up to
the agent implementation to decide whether or not it wants to support that.
So if an agent wants to enable sharing, it can do that, but if it wants to
declare itself as unshareable, it can do that instead.

As you seem to have discovered, the lifecycle management described in the
HLD applies only to the new protocol implementation (and isn't implemented
even there yet). I don't believe the HCE gets involved in trying to control
the lifecycle in the 3.x releases.

-Andy
Previous Topic:Run JUnit Test on Remote Machine
Next Topic:How can I start?
Goto Forum:
  


Current Time: Tue Sep 02 23:48:15 GMT 2014

Powered by FUDForum. Page generated in 0.02241 seconds