Shared Flashcard Set

Details

EJB
Multivision Week 6 Enterprise Java Beans
27
Software
Undergraduate 4
05/26/2013

Additional Software Flashcards

 


 

Cards

Term
What is an EJB?
Definition
Enterprise Java Beans are a server side component model for distributed applications.
Term
What are the advantages of using EJBS?
Definition

EJBs are distributed objects that can be accessed remotely. 

 

  • EJBs are supported by a rich set of implict and explicit  services. The application server provides that support. 
    • Implicit services- Tranactions, security, life cycle, concurrency, persistence and remote access
    • Explicit services- JDBC, JTS, JNDI, JCA, RMI, JMX, JAAS
  • Makes it easier to build business components
  • EJBs provide Reliability, Robustness and Scalability
Term
What are the different types of EJBs?
Definition

Session Entity and Message Driven Bean

  • Session Beans are extensions of the client application that manage processes or tasks
  • Entity Beans are an ORM component. 
  • Message Driven Beans are integration points for other application sinterested in working with the Java application. Java applications that need accesss to EJB applications can send MDB  messages via JMS.
Term

What code must be supplied to the client in order to acces a session bean?

 

Definition
  • Remote Home Interface extends javax.ejb.EjbHome
  • Remote Interface extends javax.ejb.EjbObject
Term
How would you make an interface remote?
Definition
  • It must extend java.rmi.Remote
  • Each method must declare an java.rmi.RemoteException
  • Arguments and return types must be shippable (Serializable, Primitive or Remote)
Term
Can stateless Session Beans contain multiple create() methods() in the Home Interface?
Definition
No. Stateless beans can only have one create() method and it cannot contain any arguments.
Term
Can stateful Session Beans contain multiple create() methods() in the Home Interface?
Definition
Stateful Session Beans can have multiple, overloaded create() and do not necessarilly have to have a no argument create() method
Term
What is the difference between Stateful and Stateless Session beans?
Definition
  • Conversational state is maintained (passivate) in the case of stateful session beans. 
  • State is not maintained in the case of Stateless Session Beans
Term
What is a Remote Interface?
Definition
  • It defines the bean's business methods which cab be accessed from applications outside of the EJB container:the business bean presents to the outside world.
  • It extends javax.ejb.EjbObject which in turns extends java.rmi.remote
Term
What is a remote home interface?
Definition
  • It defines the bean's life cycle methods that can be accessed form outside of the EJB container:life cycle methods for creating new beans, removing beans and finding beans.
  • the home interface extends  javax.ejb.EJBHome which extends java.rmi.Remote
Term
What is a local interface?
Definition
It defines the business methods  that can be used within the same EJB container.
Term
What is a local home interface?
Definition
It defines the life cycle methods that can be used by other EJBs in the same EJB container.
Term
What is a bean class?
Definition
The session and entity bean classes implement the bean business and life cycle methods. Note that the bean class usually does not implement the remote or local component interfaces, but it may implement the endpoint interface. However, the bean class must have methods matching the signatures of the methods defined in the remote, local, endpoint interfaces and must have methods corresponding to some of the methods in both the remote and local home interfaces. It extends javax.ejb.SessionBean, javax.ejb.EntityBean or javax.ejb.MessageDrivenBean
Term
What is an EJBObject
Definition
On the server side, an EJB object is aan object that implements the remote and/or local interfaces of the enterprise bean. The EJB OBject is generated by your EJB container and wraps the enterprise bean instance- that is and instance of the bean class you've created. This object works with the container to apply transactions , security and other system-level operations to the bean at runtime.
Term
What is an EJB Home
Definition
The Ejb home is a lot like the EJB object. It is another class that is genereated automatically when you install the enterprise bean in the container. It implementst all the methods defined by the home interfaces and is responsible  for helping the container  manage the bean's life cycle. The EJB home is responsible for locating, creating and removing enterprise beans. These tasks may involve working with the EJB  servers resource managers, instance pooling and persistence mechanisms. These details are hidden to the developer.
Term
What data types can be passed as parameters or returned from EJBs?
Definition
  • Primitives
  • Serializable types
  • Java RMI remote types
Term

What are the types of messages models for MDBs?

 

Definition
  • Topic - (Publish and Subscribe) - All MDBs in the pool can get the message simultaneously.
  • Queue- (point to point) Behaves like a first in first out (FIFO) queue. Only one MDB gets the message
Term
Are parameters to methods defined in EJB Remote interfaces passed by value or passed by reference?
Definition
  • Serializable objects are passed by value.
  • Objects taht implement java.rmi.Remote are passed as remote references. When a remote reference is passed as a parameter or returned from a method, the stub is sericalized  and passed by value. Not the object referenced by the stub.

 

Term
What is the difference between Local and Distributed  Transactions?
Definition
  • Local transaction only have one Resource Manger. In a local  transaction,  the transaction manager ans resource manager are often indistinguishable(Note: The transaction Manger is the supreme wuthority  in overseeing the transaction. There can only be one transaction manager per transaction. An example of a resource manager is the JDBC driver)
  • Distributed Transactions can span multiple resources enabling multiple resources to participate in the same transaction. To support a distributed transaction the transactionand resource manages communicate using the XA protocol. This protocol supports two phase commit process. 
Term
How do you manange transactions in EJBS?
Definition

Container Managed Transactions

Bean managed Transactions

 

Term
What are the carious Trasactional attributes in the case of CMT?
Definition
  • Not Supported
  • Supports
  • Required
  • RequiresNew
  • Mandatory
  • Never
Term
What are the transactional attributes supported by MDBs
Definition
  • NotSupported 
  • Required
Term
On what types if exceptions will the container rollback the transaction
Definition
System Exceptions cause the container to rollback a transactions. This can be a RuntimeException or RemoteException. Other application exceptions will be committed by the container unless specified.
Term
What API is used of Bean Managed Transactions?
Definition

The Java Transaction API (JTA). javax.transaction package.

 

Term
What are the transaction levels
Definition
[image]
Term
What are the essential characteristics of a transaction?
Definition
  • Atomic- Transaction must execute completely or not at all
  • Consistency refers to integrity of the data store
  • Isolated- transactions without interferrence
  • Durability- Data is not lost in the event of a crash of the system
Term
How do you manage the security of an ejb? What is the difference between authorization and authentication?
Definition
Authorization is the event of verifying a user or caller of the ejb si is who they claim to be. Authorization is where a user is authroized for a resource in this case the ejb/methods. The security realm is the mechanism for managing for managing the security pricnciples. These principles are individuals or groups that may be identified by user id and password. The calling EJB principle is identified by the user and password on the JNDI lookup. Security roles may be defined to simplfy ad define assignement security to groups. Method security can be applied to by the role. Method  permissions can apply to home, remote or local interface methods and are defined in the ejb-jar.xml file
Supporting users have an ad free experience!