Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 7. The persistence bundle > Bundle’s storage area

7.1. Bundle’s storage area

The OSGi framework provides an isolated persistent storage area for each bundle. This area can be manipulated through the usual java.io.File abstraction. Through this interface, a bundle can read and write files and manipulate directories. In listing 7.1, you can see how to use the bundle’s storage area to persist a LoginEvent, which was defined in the previous chapter. As you go through this listing, keep in mind that we’ll look into simpler and more efficient ways of persisting data later on in this chapter.

Listing 7.1. Storing data using the bundle’s storage area


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint