Getting list of session for different contexts

2017-05-22 Thread Daga, Harshit
Hi,

I am trying to do the following. As part of the tomcat startup I have added a 
listener. This listener starts a thread and that thread will open a socket 
connection. I am doing so to record the time taken to access and get the 
information from the tomcat server. If I use Jmx it is taking slightly more 
time, thus I am experimenting using direct socket connection.

Now I want to get the list of sessions from different contexts. Kindly, let me 
know how can I get list of sessions for different contexts?
I guess I can get the list of sessions from StandarManager class but how to get 
the instant of this class for different contexts?


Thanks & Regards,
Harshit Daga


Re: Adding/Exposing a custom module/service as part of the tomcat

2017-03-01 Thread Daga, Harshit
Hi,

Thanks Christopher for JMX option but it is taking more time.

Use case :
I have two tomcat servers (s1 and s2). I will call a method in s1 server from 
external source. On the method invocation s1 contacts s2 and passes on the 
information (example some in-memory data stored for the s1 is passed on to s2).

If I use JMX, it is takes time to connect to server1 and fetch the information 
and then connects to server2 and update the information.

What I am looking for is to create light service and expose to some port (let 
say 8100). Now if I call this service on s1 (from outside) the s1 should 
connect the s2 and pass on the information.

Kindly provide me some suggestion on how I can do this.


Thanks & Regards,
HD


On February 19, 2017 at 8:50:46 AM, Christopher Schultz 
(ch...@christopherschultz.net<mailto:ch...@christopherschultz.net>) wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Harshit,

On 2/18/17 8:12 PM, Daga, Harshit wrote:
> Hi,
>
> I want to add a custom service/module as part of the tomcat server
> which should start as part of tomcat startup.
>
> Service : I want to expose a service as part of tomcat startup
> which can store all the active sessions for the application
> running on the server and when I call this service via RMI or HTTP
> (can expose anyhow) I get this information. This service will be
> used by other tomcat servers to know the information. Usage :
> tomcat_1 calls tomcat_2 (on a specific port at which service is
> exposed) for the given end point, let say, getListOfSessions and
> this will return the list.
>
> I want to know suggestion for implementing/exposing/configuring
> such a service/module.
>
> PS : I want to do this as part of tomcat service to keep changes
> transparent of application.

Why not just use the existing JMX beans to get that information? I
don't think you have to write anything new.

- -chris
-BEGIN PGP SIGNATURE-
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJYqaKjAAoJEBzwKT+lPKRYny8P/30C0NKWPClWwO9nYEM450OP
WtWYqqSv6REwNyS5DArGBa1WzTPKAZyqu4Ae5CE4PqlXxRwiWyUkwDBxQU7YwXXi
6YA3sThhWxNPzB03CFExEUsupKG76Td+RaiZ9T9fCsvYMKbLWBcrGTL2ZM53wnzb
XiKuOGcTb3IpmZlBDYcY/top4yvx1gF1bGvOmODKvDU8AuS7mMXqVhtcABB5BVPC
1yyeQ+AkdFveR+rq7tC7HlGUj4CD11zunGKIk/biNxfQFhGW0Xr+KA4fTabARZJd
Unnpo3PF23L/QWsc+Ibv6hna117z19KFnEzuy3NSgdHJLLXDGTWodactuj1EhJ0+
qKu3y8apIEEvyNoOLH9aMM4KhIK5HDACzF+LEqpivVMQ1yj5jhNs39RNfFjXjXgr
yAStlm8CWfEdEUiEo/QNODMarK71eKdYQPCU20qGls37SaauPJKerAf/FCtLp39/
ogLTMxQFTpI+b8ScO1XUE60Gq7m1uWz6HvTH4TZFO7xX7PBAPNau7+ovfsrQAbRC
PZUpC/G4SZv8tDxptsn845b3cMe2+mJYA37wDQI2OyXSf5qd/ZaE1vgQNktqToCg
mB+rN8cTFkaXlLulCLE2xIZXGrecy4/UkwHCR9g/OPKJWS7LrsRA5B+xiafNp/an
oAgaj1r/5qM8DxHAz6Fh
=ox2w
-END PGP SIGNATURE-

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



Adding/Exposing a custom module/service as part of the tomcat

2017-02-18 Thread Daga, Harshit
 Hi,

I want to add a custom service/module as part of the tomcat server which should 
start as part of tomcat startup.

Service : I want to expose a service as part of tomcat startup which can store 
all the active sessions for the application running on the server and when I 
call this service via RMI or HTTP (can expose anyhow) I get this information. 
This service will be used by other tomcat servers to know the information.
Usage :  tomcat_1 calls tomcat_2 (on a specific port at which service is 
exposed) for the given end point, let say, getListOfSessions and this will 
return the list.

I want to know suggestion for implementing/exposing/configuring such a 
service/module.

PS : I want to do this as part of tomcat service to keep changes transparent of 
application.


Thanks & Regards,
HD