Search in sources :

Example 1 with RPCProxyGenerator

use of inputport.rpc.RPCProxyGenerator in project GIPC by pdewan.

the class GIPCComparableCounterClient method main.

public static void main(String[] args) {
    try {
        (new ADuplexRPCInputPortLauncherSupport()).init();
        DuplexRPCClientInputPort aClientInputPort = DuplexRPCInputPortSelector.createDuplexRPCClientInputPort("localhost", SERVER_PORT, SERVER_NAME, "counter client");
        RPCProxyGenerator rpcProxyGenerator = aClientInputPort.getRPCProxyGenerator();
        ComparableCounter counter11 = (ComparableCounter) rpcProxyGenerator.generateRPCProxy(ComparableCounter.class, COUNTER1);
        ComparableCounter counter12 = (ComparableCounter) rpcProxyGenerator.generateRPCProxy(ComparableCounter.class, COUNTER1);
        ComparableCounter counter2 = (ComparableCounter) rpcProxyGenerator.generateRPCProxy(ComparableCounter.class, COUNTER2);
        aClientInputPort.connect();
        ComparableCounter greaterCounter = counter11.greater(counter11);
        System.out.println(greaterCounter == counter11);
        System.out.println(greaterCounter.equals(counter11));
        System.out.println(counter12 == counter11);
        System.out.println(counter12.equals(counter11));
        System.out.println(counter11.hashCode() == counter12.hashCode());
        System.out.println(greaterCounter.hashCode() == counter11.hashCode());
        System.out.println(counter11.equals(counter2));
    } catch (Exception e) {
        e.printStackTrace();
    }
}
Also used : ADuplexRPCInputPortLauncherSupport(inputport.rpc.duplex.ADuplexRPCInputPortLauncherSupport) DuplexRPCClientInputPort(inputport.rpc.duplex.DuplexRPCClientInputPort) RPCProxyGenerator(inputport.rpc.RPCProxyGenerator)

Example 2 with RPCProxyGenerator

use of inputport.rpc.RPCProxyGenerator in project GIPC by pdewan.

the class ASimplexRPCClientInputPortLauncher method createProxies.

@Override
protected void createProxies() {
    RPCProxyGenerator rpcProxyGenerator = ((SimplexRPCClientInputPort) mainPort).getRPCProxyGenerator();
    upperCaseProxy = (UpperCasePrinter) rpcProxyGenerator.generateRPCProxy(null, AnUpperCasePrinter.class, null);
}
Also used : SimplexRPCClientInputPort(inputport.rpc.simplex.SimplexRPCClientInputPort) RPCProxyGenerator(inputport.rpc.RPCProxyGenerator)

Aggregations

RPCProxyGenerator (inputport.rpc.RPCProxyGenerator)2 ADuplexRPCInputPortLauncherSupport (inputport.rpc.duplex.ADuplexRPCInputPortLauncherSupport)1 DuplexRPCClientInputPort (inputport.rpc.duplex.DuplexRPCClientInputPort)1 SimplexRPCClientInputPort (inputport.rpc.simplex.SimplexRPCClientInputPort)1