package examples.ejb.subclass; import javax.ejb.CreateException; import javax.ejb.SessionBean; import javax.ejb.SessionContext; import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; /** * ParentBean is a stateless SessionBean. This bean: *
ParentHome.create()
, the container allocates an instance of
* the EJBean and calls ejbCreate()
.
*
* @exception javax.ejb.CreateException if there is
* a problem creating the bean
* @see examples.ejb.subclass.parent.Parent
*/
public void ejbCreate() throws CreateException {
log("ejbCreate called");
}
/**
* Sends back a pre-defined message identifying the method.
* This method is inherited and overloaded by the Child bean.
*
* @return String Message
*/
public String sayHello() {
return "Hello from the ParentBean.";
}
/**
* Sends back a pre-defined message identifying the method.
* This method is inherited but not overloaded by the Child bean.
*
* @return String Message
*/
public String nonOverloadedMethod() {
return "ParentBean's nonOverloadedMethod called";
}
protected void log(String s) {
if(VERBOSE) {
System.out.println(s);
}
}
}