How to write this Java Abstract class in JRuby

Hi everybody,

Can someone help me to rewrite this Java following code in JRuby.
I also want to get fields inheritance in my “VIHFClientHandler” class
because “VIHFClientHandler” class has got some other subclasses.
Also this class overrides the “handleMessage” method in which only the
type of the parameters are differents. So how can i manage this in my
JRuby class?

public abstract class VIHFClientHandler extends VIHFHandler implements
SOAPHandler {

protected boolean disableSignature = true;

protected X509Certificate signatureCertificate;
protected PrivateKey privateKey;
protected Certificate[] signatureCertificationChain;

/**

  • Constructeur
    */
    protected VIHFClientHandler(boolean disableSignature) {
    this.disableSignature = disableSignature;
    }

private boolean handleMessage(VIHF vihf) {
//some code
}

public boolean handleMessage(SOAPMessageContext smc) {
//some code
return true;
}

   public abstract KeyStore getKeyStore();

}

One subclass of the “VIHFClientHandler” class

public class SoftwareCertificateClientHandler extends VIHFClientHandler
{
private Pkcs12Impl softwareCertificate;

public SoftwareCertificateClientHandler(
Pkcs12Impl signatureSoftwareCertificate) {
super(false);

this.signatureCertificate=signatureSoftwareCertificate.getCertificate();
this.privateKey = signatureSoftwareCertificate.getKey();

this.signatureCertificationChain=
signatureSoftwareCertificate.getCertificateChain();
this.softwareCertificate = signatureSoftwareCertificate;
}

@Override
public KeyStore getKeyStore() {
return this.softwareCertificate.getCaKs();
}
}

Thanks in advance for your help.

Hi all,

Can someone give me a help to write this following code in Ruby

public abstract class VIHFClientHandler extends VIHFHandler implements
SOAPHandler {}

I am using this Jruby code, but i don’t know if it’s correct or not

class VIHFClientHandler < VIHFHandler
java_implements ‘SOAPHandler’

#....

end

Also in my getters and setters and my JRuby initialize methods, should i
use the variable with “self” or with “@” ?
Please can you give me some example from my first post ?

thanks for your help.

might be helpful, also “Implementing Java Interfaces in JRuby” here: