jadex.micro.examples.remoteservice
Class MathService

java.lang.Object
  extended by jadex.commons.service.BasicService
      extended by jadex.micro.examples.remoteservice.MathService
All Implemented Interfaces:
IRemotable, IInternalService, IService, IMathService

public class MathService
extends BasicService
implements IMathService

Simple implementation of the math interface.


Field Summary
 
Fields inherited from class jadex.commons.service.BasicService
idcnt, properties, shutdowned, sid, started, startfutures
 
Fields inherited from interface jadex.commons.service.IService
EMPTY_SERVICES
 
Constructor Summary
MathService(IServiceProvider provider)
          Create a new add service.
 
Method Summary
 int addB(int a, int b)
          Tests a blocking call (should be avoided!).
 IFuture addNB(int a, int b)
          Tests a non-blocking call.
 IFuture divZero()
          Tests a method that throws an exception.
 double getPi()
          Tests a constant call, i.e. call without parameters are assumed to be constant so that their value can be cached on local side.
 void printMessage(String message)
          Print out some message.
 
Methods inherited from class jadex.commons.service.BasicService
createServiceIdentifier, generateServiceName, getPropertyMap, getServiceIdentifier, isValid, setPropertyMap, shutdownService, signalStarted, startService
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface jadex.commons.service.IService
getPropertyMap, getServiceIdentifier, signalStarted
 

Constructor Detail

MathService

public MathService(IServiceProvider provider)
Create a new add service.

Method Detail

addNB

public IFuture addNB(int a,
                     int b)
Tests a non-blocking call. Add two numbers.

Specified by:
addNB in interface IMathService
Parameters:
a - First number.
b - Second number.
Returns:
Future that will deliver the sum of a and b.

addB

public int addB(int a,
                int b)
Tests a blocking call (should be avoided!). Add two numbers.

Specified by:
addB in interface IMathService
Parameters:
a - First number.
b - Second number.
Returns:
The sum of a and b.

getPi

public double getPi()
Tests a constant call, i.e. call without parameters are assumed to be constant so that their value can be cached on local side. Get the PI value.

Specified by:
getPi in interface IMathService

printMessage

public void printMessage(String message)
Print out some message.

Specified by:
printMessage in interface IMathService
Parameters:
message - The message.

divZero

public IFuture divZero()
Tests a method that throws an exception. Does a divide by zero operation and causes an exception.

Specified by:
divZero in interface IMathService


Copyright © 2010. All Rights Reserved.