Which of the following statements about programmatic security are true? Each correct answer represents a complete solution. Choose all that apply.
A. The bean provider is responsible for writing code for programmatic security.
B. It is also called as instance level security.
C. It is implemented using methods of the EJBContext interface.
D. It is implemented using the methods of the UserTransaction interface.
Which of the following statements correctly describe the features of the singleton pattern? Each correct answer represents a complete solution. Choose all that apply.
A. Singletons are used to control object creation by limiting the number to one but allowing the flexibility to create more objects if the situation changes.
B. Singletons can only be stateless, providing utility functions that need no more information than their parameters.
C. A singleton class may disappear if no object holds a reference to the Singleton object, and it will be reloaded later when the singleton is needed again.
D. The behavior of a singleton can be obtained by static fields and methods such asjava.lang.Math.sin (double).
Which of the following methods must be implemented by each subclass of the Permission class to compare permissions?
A. hashcode
B. implies
C. newPermissionCollection
D. equals
Which of the following statements about a JAR file command are true? Each correct answer represents a complete solution. Choose all that apply.
A. A JAR file can be created without even using the f command.
B. The 0 command is used for no compression of a JAR file.
C. The t command of a JAR file is used to update the contents of a file.
D. A JAR file can be extracted using the e command.
You work as a Software Developer for NewTech Inc. You write a bean class called EmployeeBean. The class contains two methods, EmpSal() and EmpAttendance(). Both these methods can be accessed by the ADMIN role. The EmpSal() method can be accessed only by the HR role, while the EmpAttendance () method can be accessed only by the DBA role. You want the EmpAttendance() method to be accessed by the HR role also. However, no other roles in the class except ADMIN, DBA, and HR should be able to access the EmpAttendance() method. Which of the following steps will you take to accomplish the task? Each correct answer represents a complete solution. Choose all that apply.
A. Use the
B. Use the @RunAs("ADMIN") annotation to allow the HR the privileges as ADMIN.
C. Use the @RunAs("DBA") annotation to allow the HR the privileges as DBA.
D. Use the
E. Use the @PermitAll annotation with the EmpAttendance() method to allow the HR to access the EmpAttendance() method.
Which of the following is a valid constructor for the DataInputStream class?
A. DataInputStream(File file)
B. DataInputStream(FileInputStream fin)
C. DataInputStream(String str)
D. DataInputStream(FileInputStream fin, int size)
According to the EJB programming restrictions, which of the following should be used to access the files or directories?
A. A resource manager API
B. An output device such as screen display
C. An enterprise bean
D. An input device such as a keyboard
The deployment descriptor uses the __________ element to pass control to an error page when an exception is thrown.
A.
B.
C.
D.
Which of the following methods reinitializes the logging properties?
A. reset
B. addlogger
C. reinitialize
D. readConfiguration
Which of the following listeners causes an object of the implementing class to be notified when it is added to or removed from a session?
A. HttpSessionListener
B. HttpSessionActivationListener
C. HttpSessionAttributeListener
D. HttpSessionBindingListener