Running a Service by Using SpeedLink
Almost any GridServer Service can be executed by using SpeedLink. You can use an existing ServiceType and its Grid Libraries. All you need to do to run a Service by using SpeedLink is, in the client code, replace the ServiceFactory class with SpeedLinkServiceFactory, and ServiceInvocationHandler with SpeedLinkInvocationHandler.
The factory class returns an object of type SpeedLinkService, which extends the Service interface. The most important feature of the new type is that it enables access to detailed reporting information. If you are not interested in this information but might to have interchangeability with standard Services, you can instead use the Service interface. This factory class also has all additional options needed for the Service declared as string constants.
This example creates a factory object and synchronously calls a Service implementation in Java:
// Create a Service instance of JavaAdderExample
Service s =
SpeedLinkServiceFactory.getInstance().createService(
"JavaAdderExample", initData, options, description,
condition);
..........
// Perform Synchronous add
Object[] arguments = new Object[] { new Double(5), new Double(6) };
Double sum = (Double)s.execute("add", arguments);
System.out.println("Result of add: " + sum);