Re: [jade-develop] Communication between java program/JSP and agents


Subject: Re: [jade-develop] Communication between java program/JSP and agents
From: Kieran Greer (krc.greer@ulster.ac.uk)
Date: Fri Jan 17 2003 - 12:11:18 MET


Dear France,
    You could try something like to following, where the in-process
agent is a nested class in your main program:

class main {
boolean done;
Object contents;

    class agent {
        action method() {
            process action
            contents = returned contents
            done = true
        }
    }

    main method {
        while (!done) {Thread.sleep(1000)}
        process contents
    }
}

Kieran.

France Cheong wrote:

> Hi Kieran,
>
> Thanks for the reply. Once the agent is launched, is it able to send
> a message to
> the application that launched it? If so, how is that done?
>
> Thanks,
> France
>
>
>
> >>> Kieran Greer <krc.greer@ulster.ac.uk> 01/08/03 10:53pm >>>
> Dear France,
> I had this problem and did the following. I created an in process
> agent in my Java program, see the programmers guide and the inprocess
> example code. I created a message for this agent and then launched it on
> a distributed container from the main container (all inside my Java
> program). This agent was then able to look up another agent running on
> the main container. The agent running on the main container could be
> sent a message, process the message and then reply to the agent launched
> from my program. If there is a better way of doing this I would be
> interested to know what it is also.
>
> Thanks,
> Kieran.
>
> France Cheong wrote:
>
> >Hello everyone,
> >
> >Can someone explain to me how a Java program (or a JSP) running in a
> JVM can send messages to agents on a JADE platform running in another
> JVM on the same host?
> >
> >Similarly, how can the Java program receive messages from agents
> running on the JADE platform?
> >
> >Thanks for your help.
> >
> >France
> >
> >_______________________________________________
> >jade-develop mailing list
> >jade-develop@sharon.cselt.it
> >http://sharon.cselt.it/mailman/listinfo/jade-develop
> >UNSUBSCRIBE INSTRUCTIONS AT http://jade.cselt.it/mailing.htm#unsubscribe
> >
> >
> >
>
> --
> Kieran Greer, Research Officer,
> Tel: External +44 (0)28 9036 8209, Internal 68209,
> Email: krc.greer@ulster.ac.uk,
> Faculty of Informatics, UUJ.
>
>
>

-- 
Kieran Greer, Research Officer,           
Tel: External +44 (0)28 9036 8209, Internal 68209,
Email: krc.greer@ulster.ac.uk,
Faculty of Informatics, UUJ.      

Dear France,
    You could try something like to following, where the in-process agent is a nested class in your main program:

class main {
boolean done;
Object contents;

    class agent {
        action method() {
            process action
            contents = returned contents
            done = true
        }
    }

    main method {
        while (!done) {Thread.sleep(1000)}
        process contents
    }
}

Kieran.

France Cheong wrote:
Hi Kieran,

Thanks for the reply.  Once the agent is launched, is it able to send a message to
the application that launched it?  If so, how is that done?

Thanks,
France



>>> Kieran Greer <krc.greer@ulster.ac.uk> 01/08/03 10:53pm >>>
Dear France,
    I had this problem and did the following. I created an in process
agent in my Java program, see the programmers guide and the inprocess
example code. I created a message for this agent and then launched it on
a distributed container from the main container (all inside my Java
program). This agent was then able to look up another agent running on
the main container. The agent running on the main container could be
sent a message, process the message and then reply to the agent launched
from my program. If there is a better way of doing this I would be
interested to know what it is also.

Thanks,
Kieran.

France Cheong wrote:

>Hello everyone,
>
>Can someone explain to me how a Java program (or a JSP) running in a JVM can send messages to agents on a JADE platform running in another JVM on the same host?
>
>Similarly, how can the Java program receive messages from agents running on the JADE platform?
>
>Thanks for your help.
>
>France
>
>_______________________________________________
>jade-develop mailing list
>jade-develop@sharon.cselt.it
>http://sharon.cselt.it/mailman/listinfo/jade-develop
>UNSUBSCRIBE INSTRUCTIONS AT http://jade.cselt.it/mailing.htm#unsubscribe
>

>

--
Kieran Greer, Research Officer,          
Tel: External +44 (0)28 9036 8209, Internal 68209,
Email: krc.greer@ulster.ac.uk,
Faculty of Informatics, UUJ.     




-- 
Kieran Greer, Research Officer,           
Tel: External +44 (0)28 9036 8209, Internal 68209,
Email: krc.greer@ulster.ac.uk,
Faculty of Informatics, UUJ.      



This archive was generated by hypermail 2a22 : Fri Jan 17 2003 - 12:09:48 MET