Deck 6: JSP, EJB, and JMS
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/25
Play
Full screen (f)
Deck 6: JSP, EJB, and JMS
1
Which of the following is not an implicit object in JSP?
I. Request.
II. Session.
III. Vector.
IV. In.
A) Both (I) and (II) above
B) Both (II) and (III) above
C) Both (I) and (III) above
D) Both (III) and (IV) above.
I. Request.
II. Session.
III. Vector.
IV. In.
A) Both (I) and (II) above
B) Both (II) and (III) above
C) Both (I) and (III) above
D) Both (III) and (IV) above.
Both (III) and (IV) above.
2
Which is not a valid scope for Java bean in JSP?
A) Page
B) Session
C) Request
D) Global.
A) Page
B) Session
C) Request
D) Global.
Global.
3
Which two of the following is responsible to creates ejb-jar files?
1) The bean provider.
2) The application assembler.
3) The deployer.
4) The system administrator.
A) 1 and 2
B) 2 and 3
C) 3 and 4
D) 4 and 1
1) The bean provider.
2) The application assembler.
3) The deployer.
4) The system administrator.
A) 1 and 2
B) 2 and 3
C) 3 and 4
D) 4 and 1
1 and 2
4
Which two of the following must be included in every ejb-jar file?
1) Stubs for the EJBHome and EJBObject interface.
2) The JAR Manifest file.
3) A deployment descriptor.
4) The JNDI context.
5) The EJB's home interface.
A) 1 and 3
B) 2 and 5
C) 3 and 5
D) 4 and 2
1) Stubs for the EJBHome and EJBObject interface.
2) The JAR Manifest file.
3) A deployment descriptor.
4) The JNDI context.
5) The EJB's home interface.
A) 1 and 3
B) 2 and 5
C) 3 and 5
D) 4 and 2
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
5
Which statement about session beans is true?
A) In both stateless and statefull session classes, the bean provider must write the method public void remove()
B) The method << remove >> in the component interface can be accessed only by the remote clients
C) The bean's handle must be provided by the client, in order to ask the EJBHome for removing a session bean
D) None of the above
A) In both stateless and statefull session classes, the bean provider must write the method public void remove()
B) The method << remove >> in the component interface can be accessed only by the remote clients
C) The bean's handle must be provided by the client, in order to ask the EJBHome for removing a session bean
D) None of the above
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
6
Which of the following can be directly invoked by the client?
A) ejbPassivate
B) business methods
C) setSessionContext
D) newInstance
A) ejbPassivate
B) business methods
C) setSessionContext
D) newInstance
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
7
Which is the method available in SessionContext interface?
A) afterBegin()
B) getRollbackOnly()
C) setSessionCotext()
D) getUserTransaction()
A) afterBegin()
B) getRollbackOnly()
C) setSessionCotext()
D) getUserTransaction()
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
8
Which statements about a session bean class are true?
A) It is a final class
B) Overloaded constructors are supported
C) Their business methods can be 'private'
D) The ejbCreate() method must not be a final method
A) It is a final class
B) Overloaded constructors are supported
C) Their business methods can be 'private'
D) The ejbCreate() method must not be a final method
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
9
Upon invoking getRollbackOnly() method by a business method in an entity bean, which transaction attribute settings will lead the ejb container to throw an exception?
A) Required
B) RequiresNew
C) Never
D) Mandatory
A) Required
B) RequiresNew
C) Never
D) Mandatory
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
10
When a session bean has container-managed demarcation value of 'Supports', which three methods run in an unspecified transaction context?
1) ejbActivate
2) getRollbackOnly
3) getUserTransaction
4) ejbRemove
5) afterBegin
6) afterCompletion
A) 1,4,3
B) 4,2,6
C) 1,4,6
D) 2,5,6
1) ejbActivate
2) getRollbackOnly
3) getUserTransaction
4) ejbRemove
5) afterBegin
6) afterCompletion
A) 1,4,3
B) 4,2,6
C) 1,4,6
D) 2,5,6
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
11
EJB system's performance tuning is the responsibility of
A) Bean Provider
B) EJB Deployer
C) Application Assembler
D) Tool Vendor
A) Bean Provider
B) EJB Deployer
C) Application Assembler
D) Tool Vendor
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
12
The EJB Transaction Attribute that ensures the method call that always takes place in a transaction, either client started or container started' are
A) TX_SUPPORTS
B) TX_MANDATORY
C) TX_REQUIRED and TX_REQUIRES_NEW
D) Either A or B
A) TX_SUPPORTS
B) TX_MANDATORY
C) TX_REQUIRED and TX_REQUIRES_NEW
D) Either A or B
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
13
JMS is mainly used to send and receive message from one application to another.
A) True
B) False
C) none
D) all
A) True
B) False
C) none
D) all
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
14
Abbreviate the term JMS?
A) Java Message Service
B) Java Monitor Service
C) Java Message Session
D) Java Monitor Session
A) Java Message Service
B) Java Monitor Service
C) Java Message Session
D) Java Monitor Session
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
15
A message driven bean is like statefull session bean that encapsulates the business logic and doesn't maintain state.
A) True
B) False
C) none
D) all
A) True
B) False
C) none
D) all
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
16
EJB QL is a Query Language provided for navigation across a network of enterprise beans and dependent objects defined by means of container managed persistence.
A) True
B) False
C) none
D) all
A) True
B) False
C) none
D) all
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
17
Which case of a session bean obtains the UserTransaction object via the EJBContext using the getUserTransaction() method in EJB transaction management?
A) Bean-managed transactions
B) Container-managed transactions
C) Both A & B
D) None of the above
A) Bean-managed transactions
B) Container-managed transactions
C) Both A & B
D) None of the above
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
18
Which services are provided to EJB components by the EJB container?
A) Transaction support
B) Persistence support
C) Naming support
D) All mentioned above
A) Transaction support
B) Persistence support
C) Naming support
D) All mentioned above
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
19
Which EJB container must provide an implementation of Java Naming and Directory Interface (JNDI) API to provide naming services for EJB clients and components?
A) Transaction support
B) Persistence support
C) Naming support
D) All mentioned above
A) Transaction support
B) Persistence support
C) Naming support
D) All mentioned above
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
20
Which session bean maintain their state between client invocations but are not required to maintain their state across server crashes or shutdowns?
A) Stateful Session Bean
B) Stateless Session Bean
C) Singleton Session Bean
D) None of the above
A) Stateful Session Bean
B) Stateless Session Bean
C) Singleton Session Bean
D) None of the above
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
21
EJB is a specification for J2EE server, not a product; Java beans may be a graphical component in IDE.
A) True
B) False
C) none
D) all
A) True
B) False
C) none
D) all
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
22
A session bean represents a multiple clients inside the Application Server.
A) True
B) False
C) none
D) all
A) True
B) False
C) none
D) all
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
23
Which statement characterizes stateless session beans?
A) They allow the PostConstruct, PreDestroy, and PrePassivate life-cycle callbacks.
B) They require home interfaces.
C) When a client looks up a stateful session bean in the JNDI, the same bean is returned every time.
D) They are asynchronous message consumers.
A) They allow the PostConstruct, PreDestroy, and PrePassivate life-cycle callbacks.
B) They require home interfaces.
C) When a client looks up a stateful session bean in the JNDI, the same bean is returned every time.
D) They are asynchronous message consumers.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
24
A message-driven bean can have an instance of a MessageDrivenContext injected. Which method can be successfully invoked on this interface from a message-driven bean?
A) getEJBHome
B) getCallerPrincipal ()
C) isCallerInRole
D) getEJBLocalHome
A) getEJBHome
B) getCallerPrincipal ()
C) isCallerInRole
D) getEJBLocalHome
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
25
Which statement about entities is correct?
A) Entities must be annotated with the @Entity annotation.
B) Entities can be final classes.
C) Entities can have a single no-arg constructor with protected visibility.
D) Instance variables of an entity can have private, protected, public, or package visibility.
A) Entities must be annotated with the @Entity annotation.
B) Entities can be final classes.
C) Entities can have a single no-arg constructor with protected visibility.
D) Instance variables of an entity can have private, protected, public, or package visibility.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck