📄 pkgenerator.java
字号:
import java.rmi.RemoteException;
/**
* The remote object which generates primary keys
*/
public class PKGenerator implements IPKGenerator {
/*
* Our remote object's constructor
*/
public PKGenerator() throws Exception, RemoteException {
/*
* Since we extend PortableRemoteObject, the super
* class will export our remote object here.
*/
super();
}
/*
* Generates a unique primary key
*/
public synchronized long generate() throws RemoteException {
return i++;
}
private static long i = System.currentTimeMillis();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -