The difference between 1.sleep () and Wait ()
Sleep is a threading class (thread) method that causes this thread to pause execution for a specified time, giving the execution opportunity to other threads, but the monitoring state remains and is automatically restored when it is finished. Calling sleep does not release the object lock.
Wait is a method of the object class that calls the wait method on this object to cause this thread to discard the object lock, enter the waiting lock pool waiting for the object, and then enter the object lock only after the Notify method (or Notifyall) is emitted against this object
Fixed pool ready to get object lock into run state
The difference between 2.javabean and EJB
JavaBean is a reusable component, and there is no strict specification for JavaBean, in theory, any Java A class can be a Bean. But typically, because JavaBean is created by a container (such as Tomcat),
so JavaBean should have an argument-free constructor, in addition, usually javabean to implement the Serializable interface used to implement the persistence of the bean. JavaBean is actually equivalent to a local in-process COM group in the Microsoft COM model
it cannot be accessed across processes. Enterprisejavabean is equivalent to DCOM, a distributed component. It is a Java-based remote method invocation (RMI) technology, so EJBS can be accessed remotely (across processes, across computers).
However, ejbs must be in containers such as Webspere, WebLogic, and EJB clients never directly access real EJB component, but is accessed through its container. The EJB container is the proxy for the EJB component, and the EJB component is created by the container
and management. Customers access real EJB components through containers
Java Trivia points