-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Jason,

On 10/28/14 9:06 AM, Jason Ricles wrote:
> Ok so here is the problem I have been spinning my wheels on for day
> let me just lay it out.
> 
> I have a daemon written in java running lets call it foo for
> simpleness on a linux machine that has the tomcat server running.
> On the tomcat server is a WAR file for a webapp called bar. In that
> webapp is a webpage with JavaScript websocket communication that
> connects to a websocket server that is also a part of the WAR file.
> So I have a webpage and a websocket server communicating with each
> other.
> 
> I want the foo daemon and the websocket server on bar (web
> application) to be able to communicate with each other. Is there
> any way outside of sockets to have foo and the websocket server on
> bar do this?

Dumb question: why can't foo just be a Websocket client? Make a ws://
connection to your web application in Tomcat and then two-way
communication is possible. Take whatever values from either side and
push them over the wire.

Use JSON or something dirt-simple as your data encapsulation language:
it's standard, well-understood, and has parsers and serializers
readily available for many different languages. It's also pretty much
backward- and forward-compatible since everything is pretty much a
named value map, so you can add/subtract fields at will without having
to rewrite the communication protocol or do a lot of extra work in
either the client or the server.

- -chris

> On Tue, Oct 28, 2014 at 8:59 AM, Martin Grigorov
> <martin.grigo...@gmail.com> wrote:
> 
>> On Tue, Oct 28, 2014 at 2:51 PM, Jose MarĂ­a Zaragoza
>> <demablo...@gmail.com
>>> 
>> wrote:
>> 
>>> 2014-10-28 13:44 GMT+01:00 Jason Ricles
>>> <jgr...@alum.lehigh.edu>:
>>>> 
>>>> Martin,
>>>> 
>>>> I can not use hazelcast due to regulations I have to abide
>>>> by, is where
>>> any
>>>> other built in way besides sockets that will allow me to
>>>> share data
>>> between
>>>> the two processes?
>>> 
>>> 
>>> You could use an embedded ( or not ) messaging broker ( like
>>> ActiveMQ ) . Or any kind of in-memory database
>>> 
>> 
>> But this will be again socket based communication.
>> 
>> 
>> Let's start from the beginning: What is your use case ? What
>> value will have a deserialized session in the second process ?
>> 
>> 
>>> 
>>> 
>>>> 
>>>> 
>>>> On Tue, Oct 28, 2014 at 8:24 AM, Martin Grigorov <
>>> martin.grigo...@gmail.com>
>>>> wrote:
>>>> 
>>>>> Hi,
>>>>> 
>>>>> In this case you will have to share the data between the
>>>>> processes. A simple and easy solution would be to use
>>>>> http://hazelcast.com/,
>> for
>>>>> example.
>>>>> 
>>>>> On Tue, Oct 28, 2014 at 2:06 PM, Jason Ricles <
>> jgr...@alum.lehigh.edu>
>>>>> wrote:
>>>>> 
>>>>>> No,
>>>>>> 
>>>>>> it is external as in it is running in a daemon on a linux
>>>>>> machine
>>> where
>>>>> the
>>>>>> tomcat server is also running.
>>>>>> 
>>>>>> On Tue, Oct 28, 2014 at 4:35 AM, Johan Compagner <
>>> jcompag...@servoy.com>
>>>>>> wrote:
>>>>>> 
>>>>>>>> 
>>>>>>>> 
>>>>>>>> I would like to be able to access my sessions from an
>>>>>>>> external
>>> java
>>>>>>> class,
>>>>>>>> however each time I do sessionList.getsize() it keeps
>>>>>>>> coming
>>> back as
>>>>> 0,
>>>>>>> but
>>>>>>>> there is an active sessions. Is there any way I can
>>>>>>>> access the
>>> active
>>>>>>>> sessions in tomcat from an external java class?
>>>>>>>> 
>>>>>>>> Jason
>>>>>>>> 
>>>>>>> 
>>>>>>> What is an external java class? Is it in the same class
>>>>>>> loader?
>> so
>>> it
>>>>> is
>>>>>>> just part of the webapplication? then the above
>>>>>>> approach should work fine
>>>>>>> 
>>>>>>> 
>>>>>>> -- Johan Compagner Servoy
>>>>>>> 
>>>>>> 
>>>>> 
>>> 
>>> ---------------------------------------------------------------------
>>>
>>> 
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>> 
>>> 
>> 
> 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJUT8KOAAoJEBzwKT+lPKRYb44P/iPtg+Y0SKMzyzOwrcM+dOuZ
jy2AqLPKRlUNQFVja+HxKfQcgKCrsOxvFHo2RrnUVTsgbjCNPJXR7eIWpBluTsgv
wyQKjC0m1q7hYoEE4us86wjQiAG4c+KAD/RwX9hljOoFqW4BSBVi0SHaaqgJV486
ACabJmaXdmfgkzkerEfHEbQmNR39C8jTVT0yrZg2kGLW8Y8BcbFjLQXFK0pTbgYT
zyiTWzF848Fw+KAg9w8H5s6EhvIcJtNkGmhq3wU9msdvF4mp9+mWnsPfdhGVIvQ8
T3FP+zsBH+mhz+/Y0Id6jr1nmH2a+qvaNe82V23dyAYB+xqPsOmjQ41exRrwo+ZU
PO4wnLSeAM1j96fav0DU5OEcBI4JM+r9uaZZX4dOaPAX3+NHEuB0ZYjqdbcrZtGC
535YMNLtDgylnRIY/pGzd8F7EcxUNGrZB82xbibPY45wvVj76x5CPwQ3lZNVUzTm
mZdTkcmrD51Ujpdsq+g8TtLuYzrMUklo/We6cuhVc7gLS3nEw/hiJqGuyWEhDf9c
4YXAeEaLAZQjznSAn2yJUF1DI8BRHaD5mpFCvb/N7W6/1G7GtjUY5zJgQ0XEHenn
MAwKbkssQr3BouACcQzDqlH1FYqBve8D0fyMZsq62xFrBg61nbZQVzzZoF0vWNH2
VWQ85hKZbLt+ew90h1mz
=seU1
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to