Implement web socket local server in Swing application - java

I am not able to find any implementation of a WS or WSS web socket server created in a Java Swing desktop application.
I am planning to govern multiple clients using a local server, imagine chat room on a local LAN, but I do not wish to host/run Tomcat or Jetty etc to host the server, I want it to be a Java Swing application that I can copy paste on any machine to make it the server and it can have the same chat features.
UPDATE:
Found some very useful topic : Java - Send Message to all Clients
Will follow this.

I am no expert in this realm, but this might help…
Wikipedia maintains a list of WebSocket implementations, both client and server.
You may be interested in the open-source Atmosphere Framework. It supports working with WebSocket but I am not clear if it actually is a server implementation.
Perhaps check open-source projects like Tomcat or Jetty or WildFly to see if their WebSocket implementation might be modularized sufficiently to plug into your app.

Related

Post JMS message to Weblogic throught PHP

I have a web application that has communicate with other Java web application throught JMS in Weblogic.
I read this answer:
How to connect Jms from PHP ?
I installed ActiveMQ and tried to use it.
But in the Weblogic we need "JMS_FACTORY" and "QUEUE_NAME".
I think it use t3 protocol.
When I want to use is ActiveMQ, it needs tcp protocol.
for example:
$stomp = new \Stomp('tcp://10.x.x.x:9700');
Is that possible to push messages in the Weblogic queue?
I think you mix API, wire protocol and client vs server in your question.
WebLogic JMS builds on java constructs all the way from Client to Server. If you really really need queue support I guess you need to create a PHP extension (in C/C++) that uses WebLogic C API (which in turn is a Java bridge). Maybe not smooth or bug free.
The easy way is to write a small WebLogic app that receives messages over HTTP and posts them to a queue. Or, if you can't touch the WebLogic installation, create a Standalone java app that you connect to your PHP in whatever way (HTTP, STOMP, MQTT, memory grid, files, whatever)

Java Chat (Messaging) between eclipse and enterprise web application

Scenario:
I want to add messaging feature to an eclipse plugin and a web application. Clients are eclipse users, and web application users. Whenever a client posts a message to the server with a specific topic, the web application users browsing that topic should immediately be aware of the incoming message.
What are the current java technologies that handle this scenario? I am searching a clean API, solution.
PS. The system has already spring dependencies, the server is Tomcat 7
You can use XMPP via Smack on the Eclipse client and use an existing web based chat client, or browser friendly XMPP client library for your web interface.
Since you are posting to a topic, I would suggest using either the multi user chat or pubsub extensions of XMPP.
You might want to have a look at the Eclipse Communication Framework: http://www.eclipse.org/ecf/

Web Server for existing Java application

I have an existing Java application running on a linux box that monitors the state of relays and network information. This is a stand-alone device currently.
What I would like to further develop is a web server for the device to remotely monitor, configure, and control the device via an Ethernet connection. To achieve this, I need some way to interface between the web server, which could be configured as enabled/disabled, and the master device, which is always running.
Is there a good way to do this? I have looked at apache w/ tomcat and similar web servers but not sure if this is what I need. The key here is that the web server needs to be able to access the existing java application without interfering with its always running services.
You either develop a webapp, use your Java application's API inside the webapp, and deploy this webapp inside a web container. Or you can do the reverse and embed a web server inside your application (see here for documentation to embed Jetty).
If you want to keep the webapp and the original application in two separate JVMs, you'll need some wey to communicate between both, like sockets, RMI, or even files, but it will be more complex.
You might want to take a look at JMX http://docs.oracle.com/javase/tutorial/jmx/overview/index.html

Implementing chat application with Java EE

I have developed my web application by using Java EE framework EJB 3, at front using JSF.
Now I plan to add chat tool to my web application. All online users can chat with each other.
Can you please guide me which tool I should use to Integrate it with Java EE to develop my chat application? I also appreciate if you provide code or any link.
1- You have to install a pre developed Chat server. There is many available solutions I advice you to choose Ejabberd ( http://www.ejabberd.im/ ). It's a chat server implemented using Erlang and is considered as a highly scalable server. It's the same as facebook chat server, note that facebook used at the beginning only one server to handle all its chat traffic all over the world.
2- You have to integrate a js chat client that will communicate with the chat server. There is also a cool open source solution for that called ijab ( http://code.google.com/p/ijab/ ). You have just to configure it to connect with your server.
3- To add friends and manage interactions between users, you can use a java jabber library and there are many. This library will be used to connect to ejabberd server. You can choose one of the java clients but there are many.
You'll encounter many problems in the configuration of chat so don't under estimate it
Link: Building a centralized connection-oriented Java Chat Server. This tutorial also provides a good overview on socket/network programming.

jboss client-server app. concurrent user

I have a client-server application. Client app. is a swing application. Server app. is ejb3 based Java EE application and working on JBoss AS 4.2.1.GA. Client and server are communicating with RMI. I want to monitor, how many user is using the application and active clients that are requesting information from server. Is there any monitoring tool in JBoss AS i can use, for example by using web/jmx console etc.
Thanks,
Deger
Simplest solution is to install the Embedded JOPR solution, it means copy a file on the deploy directory and configure JMX security if needed.
More info:
Quick and dirt page with installation guide
Main page of the project

Categories