请帮我创建这个代理设计模式的主类?
//文件名:Payment.java
import java.math.*; import java.rmi.*;
public interface Payment extends Remote{
public void purchase(PaymentVO payInfo, BigDecimal price)
throws PaymentException, RemoteException; }
//文件名:PaymentException.java
`public class PaymentException extends Exception{
public PaymentException(String m){
super(m);
}
public PaymentException(String m, Throwable c){
super(m, c);
}
}`
//文件名:PaymentImpl.java
`import java.math.*;
import java.net.*;
import java.rmi.*;
import java.rmi.server.*;
public class PaymentImpl implements Payment{
private static final String PAYMENT_SERVICE_NAME = "paymentService";
public PaymentImpl() throws RemoteException, MalformedURLException{
UnicastRemoteObject.exportObject(this);
Naming.rebind(PAYMENT_SERVICE_NAME, this);
}
public void purchase(PaymentVO payInfo, BigDecimal price)
throws PaymentException{
}
}`
//文件名:PaymentService.java
import java.math.*;
public interface PaymentService{
public void purchase(PaymentVO payInfo, BigDecimal price)
throws PaymentException, ServiceUnavailableException;
}
//文件名:PaymentVO.java
public class PaymentVO{
}
//文件名:ServiceUnavailableException.java
public class ServiceUnavailableException extends Exception{
public ServiceUnavailableException(String m){
super(m);
}
public ServiceUnavailableException(String m, Throwable c){
super(m, c);
}
}