Two Laptop Bag*
The moose likes Java in General and the fly likes Mbean Vs Webservices Vs EJB Vs RMI Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Mbean Vs Webservices Vs EJB Vs RMI" Watch "Mbean Vs Webservices Vs EJB Vs RMI" New topic
Author

Mbean Vs Webservices Vs EJB Vs RMI

Chandra shekar M
Ranch Hand

Joined: Dec 20, 2006
Posts: 135
Hi All,

We have

1. MBean - Which is part of JMX hosted by the Java Standard Server client being JCONSOLE
2. Webservice - any client can communicate to the service using SOAP or REST protocol
3. EJB - Again a way of exposing the service
4. RMI - Again a way of exposing the service

I am bit confused between them.
1. What is the actual difference between them?
2. When do we use what? what to choose?

Thanks
Chandra
Chandra shekar M
Ranch Hand

Joined: Dec 20, 2006
Posts: 135
Hi All,

Here are some of my findings.

1. EJB's : Both service and client should be of Java code. Needs to be hosted on Application container eg: Jboss, weblogic
- This is heavy weight and not scalable
- Uses RMI protocol


2. Webservices : Service and client can be of code written in any language. Needs to be hosted on not sure if it needs Web or App container. Please clarify?
- Makes use of SOAP, Rest Protocl on HTTP
- highly scalable

3. RMI : Is a protocl used for remote communication both EJB and webservices (internally) uses RMI for the remote communication. JDK
comes with RMI shiped with it
- It is a protocl
- EJB uses this Protcol to publish the service, EJB as a frame work also provides various other functionalities
- JDK readly comes with this protocl. by implementing the RMI interface we can do remote communication but we wont get all those functionalities provided by EJB
JDK hosts this on its standard server like Mbean server

4. Mbeans : Again both service and client should be of Java Type. Doesnt need App or Web servers rather gets hosted on Java Standard Server (also called Mbeanserver)
if we want to expose a service to a small group say internally we can expose it using Mbean without any App or webserver. If we want to extend it to
outside world we can establish an interaction between webservice and Mbean.
- Not sure what protocl maybe RMI. Please clarify?
- makes use of JMX infrastructure.

Please correct and add more details.

Thanks
Chandra
Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4646
    
    5

I will argue that there are rarely good engineering justifications for using RMI any more. Just use REST.
 
 
subject: Mbean Vs Webservices Vs EJB Vs RMI