Review each question and reveal answers to strengthen your understanding
1To create services and have those automatically installed in the registry.
✅ Correct Answer: 1
2Element to export the bean as an OSGi service, classified by the interface we specify.
✅ Correct Answer: 2
3 These beans are proxies, some may load asynchronously or take a longer time to register.
<osgi:service
interface="com.apress.springrecipes.
osgi.helloworld.service.GreeterService">
<bean class="com.apress.springrecipes.osgi.helloworld.
service.GreeterServiceImpl"/>
</osgi:service>
✅ Correct Answer: 1
4An anonymous bean specified inside of the osgi:service element allows you to avoid cluttering the namespace.
✅ Correct Answer: 1
5The first, most direct connection to OSGi is the bean that’s created on your behalf when you export a service. This bean, an instance of:-
✅ Correct Answer: 1
6By default, beans created in a Spring application context are global to the entire OSGi runtime.
✅ Correct Answer: 1
7Sometimes, you may want to limit the visibility of a service so that multiple clients each get their own instance of the bean.
✅ Correct Answer: 2
8Spring Dynamic Modules also supports injection and manipulation of bundles themselves. An injected bundle is of type:-
✅ Correct Answer: 2
9Once acquired, the Bundle can be interrogated to introspect information about the bundle itself, including any entries, its current state.
✅ Correct Answer: 1
10OSGi will let you maintain multiple versions of a service in your registry at the same time.
✅ Correct Answer: 1
11Multiple services of the same interface may be registered inside of an OSGi environment, which necessitates a conflict-resolution process.
✅ Correct Answer: 1
12When specified on a service element, allows the ascription of a rank relative to other beans with the same interface.
✅ Correct Answer: 1
13A more robust solution to service discrimination is service attributes.
✅ Correct Answer: 1
14 There are frequently situations where OSGi will return more than one instance of a service that satisfies the interface.
✅ Correct Answer: 1
15Attribute, which, is the symbolic name of another bundle.
✅ Correct Answer: 2
16Support for deployment of traditional .war artifacts, enable use of some of the standard Java EE libraries, provide useful defaults for many de facto standard libraries, and provide fully integrated support for Spring Dynamic Modules.
✅ Correct Answer: 2
17OSGi doesn’t solve framework concerns, instead focusing on infrastructure requirements for Java applications.
✅ Correct Answer: 1
18Spring Dynamic Modules was, while powerful for those already invested in an OSGi platform, not the most natural accommodations for those trying to migrate large code into the OSGi environment, SpringSource created.
✅ Correct Answer: 2
19SpringSource dm Server many advances focus on delivering a solution, and not just a framework, for delivering:-
✅ Correct Answer: 3
20SpringSource dm Server provides value above and beyond a regular OSGi solution.
✅ Correct Answer: 1
21OSGi–enabling all of these interwoven dependencies via the granular use of the Import-Package header would be tedious.
✅ Correct Answer: 1
22SpringSource dm Server also allows you to bend the rules where necessary.
✅ Correct Answer: 1
23SpringSource dm Server works with several types of deployment formats:-
✅ Correct Answer: 4
24Application isolation is critical because it allows you to solve the issue of reconciliation of two services whose interfaces collide. You can use:-
✅ Correct Answer: 3
25SpringSource dm Server provides the robustness needed to commoditize enterprise application development in an OSGi environment.
✅ Correct Answer: 1
26To begin with SpringSource dm Server but need a way to rapidly turnaround development.
✅ Correct Answer: 3
27SpringSource has provided solid tooling for Eclipse, called :-
✅ Correct Answer: 2
28These tools—part of the broader SpringSource Tool Suite—are available as :-
✅ Correct Answer: 3
29 Java provides a mechanism, where an object can be represented as a sequence of bytes:-
✅ Correct Answer: 1
30After a serialized object has been written into a file, it can be read from the file and deserialized.
✅ Correct Answer: 1
31Serialization is JVM independent.
✅ Correct Answer: 1
32The ObjectOutputStream class contains methods for writing various data types.
✅ Correct Answer: 1
33The ObjectInputStream class contains methods for writing various data types.
✅ Correct Answer: 1
34 For a class to be serialized successfully:
✅ Correct Answer: 1
35 When serializing an object to a file, the standard convention in Java is to give the file a:
✅ Correct Answer: 3
36 What will be the value of transient field after deserialization:-
✅ Correct Answer: 3
37If the class implements java.io.Serializable, then it is serializable; otherwise, it’s not.
✅ Correct Answer: 1
38 To send an email using your Java Application:-
✅ Correct Answer: 3
39If you want to send an email to multiple recipients:-
✅ Correct Answer: 1
40void addRecipients(Message.RecipientType type, Address[] addresses)
Parameter:-
type: This would be set to:-
✅ Correct Answer: 4
41 void addRecipients(Message.RecipientType type, Address[] addresses)
Parameter:- addresses: This is the array of email ID, the method used while specifying email IDs
✅ Correct Answer: 2
42To set content whose second argument is “text/html†to specify that the HTML content is included in the message.
✅ Correct Answer: 1
43If it is required to provide user ID and Password to the email server for authentication purpose then you can set properties:
✅ Correct Answer: 3
44It is assumed that your localhost is connected to the internet and capable enough to send an email.