jobbean.java
来自「21天精通Java,这是一本英文书」· Java 代码 · 共 57 行
JAVA
57 行
package web;
import java.rmi.*;
import javax.ejb.*;
import javax.naming.*;
import agency.*;
public class JobBean
{
private AdvertiseJobHome jobHome;
private AdvertiseJob job;
private String customer;
private String ref;
public void updateDetails (String description, String location, String[] skills) throws RemoteException {
if (skills == null)
skills = new String[0];
job.updateDetails(description, location, skills);
}
public void setRef(String ref) throws RemoteException, CreateException {
this.ref = ref;
job = jobHome.create(ref,customer);
}
public String getRef() throws RemoteException {
return ref;
}
public void setCustomer(String customer) throws RemoteException {
this.customer = customer;
}
public String getCustomer() throws RemoteException {
return customer;
}
public String getDescription() throws RemoteException {
return job.getDescription();
}
public String getLocation() throws RemoteException {
return job.getLocation();
}
public String[] getSkills() throws RemoteException {
return job.getSkills();
}
public JobBean() throws RemoteException, NamingException {
InitialContext ic = null;
ic = new InitialContext();
jobHome = (AdvertiseJobHome)ic.lookup("java:comp/env/ejb/AdvertiseJob");
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?