Newbie to Baratine (and used as a service under 0.11.3)

59 views
Skip to first unread message

Andrew Davis

unread,
Apr 22, 2016, 4:16:56 AM4/22/16
to Baratine
I Am new to Baratine and have downloaded version 0.11.3 , and am intrested in using it as a service and generating this by the program , and using the below but it is not working, my IDE (NETBEANS and java 1.7) cannot find ServiceManaher class , am i missing something, or does any one have a very basic example (i.e hello world), of using Baratine as a service, in side another program in 0.11.3.

import io.baratine.service.ServiceManager;

void init()
{
  // create a new Baratine manager
  ServiceManager manager = ServiceManager.newManager()
                                         .build();

  // create a ServiceRef and client proxy for the service
  MyApi myClient = manager.newService()
                          .service(new MyServiceImpl())
                          .build()
                          .as(MyClient.class));

  // my-client calls use application APIs
  myClient.mySend("my-message");
  String myResult = client.myCall("my-arg");
  myClient.myAsyncCall("my-arg", x-> { System.out.println(x); });
}

Alex Rojkov

unread,
Apr 22, 2016, 12:49:17 PM4/22/16
to Andrew Davis, Baratine
Hi Andrew,

Baratine requires Java 8.

ServiceManager was renamed to Services, so your could might look as so:

Services services = Services.newManager().get();

Hello hello = services.newService(Hello.class)
.as(Hello.class);

hello.hello((value,exn)-> System.out.println("Hello: " + value));

Please see the documentation and samples at : http://doc.baratine.io/v0.11/

Thanks for using Baratine.
Alex
> --
> You received this message because you are subscribed to the Google Groups
> "Baratine" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to baratine-io...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages