First page Back Continue Last page Graphics
Continuation of Notes
Notes:
public class LegacyAppSessionBean implements SessionBean {
private SessionContext _ctxt;
private String _strIPAddr;
private int _iPort;
private transient Socket _socket;
//================================================
// Private helper methods
//================================================
// Same as before...
//================================================
// ejbCreate() method
//================================================
// Same as before...
//================================================
// Methods required by SessionBean interface
//================================================
public void ejbPassivate() throws EJBException {
try {
disconnect();
}
catch(IOException ie) {
throw new EJBException(ie);
}
}
public void ejbActivate throws EJBException {
try {
connect(_strIPAddr, _iPort);
}
catch(IOException ie) {
throw new EJBException(ie);
}
}
public void ejbRemove() throws EJBException {
try {
disconnect(); // Close before ending session.
}
catch(IOException ie) {
throw new EJBException(ie);
}
}
public void setSessionContext(SessionContext ctxt) {
_ctxt = ctxt;
}
}