NetRexx RMI

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

NetRexx RMI

gpatrick
I have been able to create an RMI application using NetRexx, but when trying to convert a Java example I found into NetRexx I have an error.

# cat Adder.nrx
import java.rmi.

class Adder interface implements Remote

method add(x=int,y=int) public signals RemoteException


# cat AdderRemote.nrx
import java.rmi.
import java.rmi.server.

class AdderRemote public extends UnicastRemoteObject implements Adder

method AdderRemote() signals RemoteException
super()

method add(x=int,y=int) public returns int
return (x+y)

# nrc AdderRemote.nrx
NetRexx portable processor, version NetRexx 3.02, build 172-20130625-1742
Copyright (c) RexxLA, 2011,2013.  All rights reserved.
Parts Copyright (c) IBM Corporation, 1995,2008.
Program AdderRemote.nrx
  === class AdderRemote ===
    constructor AdderRemote()
      overrides UnicastRemoteObject()
    method add(int,int)
      implements Adder.add(int,int)
  9 +++ method add(x=int,y=int) public returns int
    +++        ^^^
    +++ Error: Method has return type 'int', so cannot override or implement method with no return type in class 'Adder'
  4 +++ class AdderRemote public extends UnicastRemoteObject implements Adder
    +++       ^^^^^^^^^^^
    +++ Error: Class is not abstract, yet it does not implement method 'add(int,int)' from abstract class 'Adder'
Compilation of 'AdderRemote.nrx' failed [2 errors]

If I don't use "returns int" in the method add:
# nrc AdderRemote.nrx
NetRexx portable processor, version NetRexx 3.02, build 172-20130625-1742
Copyright (c) RexxLA, 2011,2013.  All rights reserved.
Parts Copyright (c) IBM Corporation, 1995,2008.
Program AdderRemote.nrx
  === class AdderRemote ===
    constructor AdderRemote()
      overrides UnicastRemoteObject()
    method add(int,int)
      implements Adder.add(int,int)
  9 +++ method add(x=int,y=int) public
    +++        ^^^
    +++ Error: Method has return type 'netrexx.lang.Rexx', so cannot override or implement method with no return type in class 'Adder'
  4 +++ class AdderRemote public extends UnicastRemoteObject implements Adder
    +++       ^^^^^^^^^^^
    +++ Error: Class is not abstract, yet it does not implement method 'add(int,int)' from abstract class 'Adder'
Compilation of 'AdderRemote.nrx' failed [2 errors]
Reply | Threaded
Open this post in threaded view
|

Re: NetRexx RMI

Tom Maynard
* class Adder interface implements Remote

Your declaration does not indicate any return type, yet your instantiation
returns an int.  Mismatch.  Do over.


_______________________________________________
Ibm-netrexx mailing list
[hidden email]
Online Archive : http://ibm-netrexx.215625.n3.nabble.com/

Reply | Threaded
Open this post in threaded view
|

Re: NetRexx RMI

gpatrick
Thank you.  That solved it.