Control
Enterprise Java Bean Control base interface
Control
, Control
, Serializable
EntityEJBControl
, EntityEJBControl
, SessionEJBControl
, SessionEJBControl
Method Summary |
public |
|
public |
|
public |
|
public |
|
public boolean |
|
public void |
|
Method Detail |
public Object
getEJBBeanInstance()
Returns the current target instance of the EJB business interface
used for business interface method invocations. This API is
provided for advanced use cases were direct access to the local/
remote interfaces outside of the control is required. It will
return null
if no target instance is currently
selected.
null
if no target instance is currently
selected.
public Throwable
getEJBException()
Returns the last EJB exception serviced by this control on the
developer's behalf. This can be used to discover or log additional
information, such as when a create or find method is unable to
locate a target bean instance.
public Object
getEJBHomeInstance()
Returns an instance of the home interface associated with
the target EJB.
public String
getJNDIName()
Returns the JNDI name associated with the EJB which this control
represents. If the control was defined using the jndi-home-name
attribute, the returned value will start with "jndi:" and will
start with "java:comp/env" if the control was defined using an ejb-link
attribute.
public boolean hasEJBBeanInstance()Returns
true
if this control currently has a target bean instance
upon which bean business interface methods may be invoked. This will
be true after successful execution of a create or single select find method,
or in cases where implicit creation or find has occurred
by the control on the control user's behalf. You can use this
method as a simple way to procedurally check the status of explicit or implicit
bean instance creation or find operations.
true
if this control is associated with a target bean instance;
otherwise, false
.
public void setJNDIName(String
jndiName)
Sets the JNDI name associated with this control; in other words, this method effectively sets which EJB is associated with the control. This method validates that jndiName is a valid JNDI name. The method then drops the EJB instance that was associated with the previous JNDI name and loads the EJB associated with the new JNDI name.
You can use this method to associate this control with an EJB that has the same interface as the previous EJB, but a different JNDI name.