Time for action - cleaning up the bookshelf-service activator

Now that we have the search command working, we're about to implement the add command. Therefore, we will no longer need the part of the bookshelf-service activator that inserts books at startup.

Let's remove that call by using:

public class BookshelfServiceImplActivator implements BundleActivator
{
ServiceRegistration reg = null;
public void start(BundleContext context) throws Exception
{
this.reg = context.registerService(
BookshelfService.class.getName(),
new BookshelfServiceImpl(context), null);
// testService(context);
}
// ...

For now, I've just commented the call to testService(), but it can be removed.

Note

Don't forget to rebuild, package, and deploy the updated bookshelf-service bundle! This one will have version 1.8.0.

Implementing the book:add command

The next thing is to implement the book:add command, which is implementing the add() method in the BookshelfServiceProxy and including the function name in the commands list.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset