Java Reference
In-Depth Information
private InitialContext ctx;
public YachtBean() {
try {
ctx = new InitialContext();
} catch (Exception e) {
System.out.println("Problem getting InitialContext!");
}
}
public void setEntityContext(EntityContext ctx) { this.context = ctx; }
public void unsetEntityContext() { }
public void ejbActivate() { }
public void ejbPassivate() { }
public void ejbLoad() { }
public void ejbStore() { }
public void ejbRemove() throws RemoveException { // nothing to code }
// Container managed fields
public abstract String getYachtName();
public abstract String getBuilder();
public abstract String getEngineType();
public abstract int getCapacity();
public abstract int getMaxVelocity();
public abstract void setYachtName(String s);
public abstract void setBuilder(String s);
public abstract void setEngineType(String s);
public abstract void setCapacity(int n);
public abstract void setMaxVelocity(int n);
public String ejbCreate(String yachtName, String builder, String
engineType,
int capacity, int maxVelocity)
throws CreateException {
// You have to call accessor methods here.
setYachtName(yachtName);
setBuilder(builder);
setEngineType(engineType);
setCapacity(capacity);
setMaxVelocity(maxVelocity);
// If int values passed in are zero, pull the value from the constant
file.
if(capacity <= 0) { setCapacity(YachtConstants.CAPACITY); }
if(maxVelocity <= 0) { setMaxVelocity(YachtConstants.MAX_VELOCITY); }
Search WWH ::




Custom Search