Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning Karaf Cellar

You're reading from   Learning Karaf Cellar Build and implement a complete clustering solution for the Apache Karaf OSGi container

Arrow left icon
Product type Paperback
Published in Jul 2014
Publisher
ISBN-13 9781783984602
Length 124 pages
Edition 1st Edition
Arrow right icon
Authors (2):
Arrow left icon
Jean Baptiste Onofre Jean Baptiste Onofre
Author Profile Icon Jean Baptiste Onofre
Jean Baptiste Onofre
Jean-Baptiste Onofré Jean-Baptiste Onofré
Author Profile Icon Jean-Baptiste Onofré
Jean-Baptiste Onofré
Arrow right icon
View More author details
Toc

The client bundle


The client bundle provides a dosgi-greeter:greet shell command. The shell command is part of the client bundle, and you can find the command code on the GitHub source repository. The command calls the following GreeterClient:

package org.apache.karaf.cellar.samples.dosgi.greeter.client;

import org.apache.karaf.cellar.samples.dosgi.greeter.api.Greet;
import org.apache.karaf.cellar.samples.dosgi.greeter.api.GreetResponse;
import org.apache.karaf.cellar.samples.dosgi.greeter.api.Greeter;

/**
 * Client that uses a remote Greeter service.
 */
public class GreeterClient {

  private Greeter greeter;
  private String greetMessage;
  private int count;

  public GreeterClient(Greeter greeter, String greetMessage, int count) {
      this.greeter = greeter;
      this.greetMessage = greetMessage;
      this.count = count;
  }

  public void start() {
      Greet greet  = new Greet(greetMessage);
      for (int i = 0; i < count; i++) {
          GreetResponse greetResponse = greeter...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image