Showing posts with label Advanced Java. Show all posts
Showing posts with label Advanced Java. Show all posts

Which statement describe about Message-Driven Beans is correct? (Choose one)

Which statement describe about Message-Driven Beans is correct? (Choose one)



a. Message-Driven Beans are stateful
b. An EJB 3.0 message-driven beans can itself be the client of another message-driven beans
c. The bean mediates between the client and the other components of the application, presenting a simplified view to the client.





Answer: A

Which statement about an entity instance lifecycle is correct?

Which statement about an entity instance lifecycle is correct?



a. A new entity instance is an instance with a fully populated state.
b. A detached entity instance is an instance with no persistent identity.
c. A removed entity instance is NOT associated with a persistence context.
d. A managed entity instance is the instance associated with a persistence context.




Answer: D

Which is NOT a correct statement about entity beans?

Which is NOT a correct statement about entity beans?




a. They are used to store persistent data
b. They are used to share data among clients
c. They are used to implement business processes
d. They are used to represent data stored in a RDBMS



Answer: C

Which statement about entity manager is true?

Which statement about entity manager is true?



a. A container-managed entity manager must be a JTA entity manager.
b. An entity manager injected into session beans can use either JTA or resource-local transaction control.
c. An entity manager created by calling the EntityManagerFactory.createEntityManager method always uses JTA transaction control.




Answer: A

If you want to send an entity object as the pass by value through a remote interface, which of the following statements are valid? (Choose one)

If you want to send an entity object as the pass by value through a remote interface, which of the following statements are valid? (Choose one)



a. @Entity
a. public class Employees implements SessionSynchronization{
a. ...
a. }
b. @Entity
b. public class Employees implements Serializable{
b. ...
b. }
c. public class Employees implements Serializable{
c. ...
c. }
d. @entity
d. public class Employees implements Serializable{
d. ...
d. }





Answer: B

Which is NOT true about stateless session beans?

Which is NOT true about stateless session beans?



a. They are CANNOT hold client state
b. They are used to implement business logic
c. They are used to represent data stored in a RDBMS
d. They are an Enterprises Beans



Answer: C

Which statement is true about EJB 3.0 stateful session beans and stateless session beans?

Which statement is true about EJB 3.0 stateful session beans and stateless session beans?



a. Both can have multiple remote and local business interfaces
b. Only the stateful session bean class is required to implement java.io.Serializable interface
c. Both can be passivated by the EJB container to preserve resource
d. Only the stateless session bean class is required to implement java.io.Serializable interface





Answer: A

A developer is working on a project that includes both EJB 2.1 and EJB 3.0 session beans. A lot of business logic has been implemented and tested in these EJB 2.1 session beans. Some EJB 3.0 session beans need to access this business logic. Which design approach can achieve this requirement?

A developer is working on a project that includes both EJB 2.1 and EJB 3.0 session beans. A lot of business logic has been implemented and tested in these EJB 2.1 session beans. Some EJB 3.0 session beans need to access this business logic. Which design approach can achieve this requirement?



a. Add adapted home interfaces to EJB 3.0 session beans to make EJB 3.0 and EJB 2.1 session beans interoperable.
b. Add EJB 3.0 business interfaces to existing EJB 2.1 session beans and inject references to these business interfaces into EJB 3.0 session beans.
c. No need to modify existing EJB 2.1 session beans. Use the @EJB annotation to inject a reference to the EJB 2.1 home interface into the EJB 3.0 bean class.





Answer: A

Which statement is true about EJB 3.0 containers?

Which statement is true about EJB 3.0 containers?





a. javax.naming.initialContext is guaranteed to provide a JNDI name space
b. Java Telephony API is guaranteed to be available for session and message beans
c. The Java 2D API is guaranteed to be available for session beans



Answer: A

Which statements are BEST describe prefix attribute of <%@ taglib prefix=...%>directive of JSP file?

Which statements are BEST describe prefix attribute of <%@ taglib prefix=...%>directive of JSP file?




a. Specifies the relative or absolute URI of the tag library descriptor.
b. Specifies the required prefix that distinguishes custom tags from built-in tags. The prefix names jsp, jspx, java, javax, servlet, sun and sunw are reserved.
c. Allows programmers to include their own new tags in the form of tag libraries. These libraries can be used to encapsulate functionality and simplify the coding of a JSP.
d. The scripting language used in the JSP. Currently, the only valid value for this attribute is java.




Answer: A