EjbConnection¶
-
public class
EjbConnection
¶ An EjbConnection represents a connection to the initial context by which the specified EJBHome can be looked up. The URL connection string for an EJBConnection should comply the following format: PROVIDER_URL@INITIAL_CONTEXT_FACTORY {@SECURITY_PROTOCOL}
Author: Hugo Y. K. Lam
Constructors¶
Methods¶
close¶
-
public synchronized void
close
()¶ Closes this connection and releases any resources associated.
Throws: - EjbConnectionException – if errors occurred during closing the connection or, the connection has not yet been connected or has been closed already.
connect¶
-
public synchronized void
connect
()¶ Connects to the destination URL using the username and password stored in this connection.
Throws: - EjbConnectionException – if errors occurred during the establishment of connection.
connect¶
-
public synchronized void
connect
(String username, String password)¶ Connects to the destination URL using the specified username and password.
Parameters: - username – the username used to connect. null if authentication is not required.
- password – the password used to connect. null if authentication is not required.
Throws: - EjbConnectionException – if errors occurred during the establishment of connection or, the connection has been connected or closed already.
finalize¶
-
protected void
finalize
()¶ Closes this connection in finalization.
See also:
java.lang.Object.finalize()
getUrl¶
getUsername¶
lookupHome¶
-
public Object
lookupHome
(String jndiName, Class narrowTo)¶ Retrieves the EJBHome by looking it up using the specified JNDI name. The EJBHome will be narrowed to the specified class if it is a remote interface.
Parameters: - jndiName – the JNDI name for the EJBHome to be looked up.
- narrowTo – the class to which the EJBHome should be narrowed.
Throws: - EjbConnectionException – if there is a naming or narrowing error.
- NullPointerException – if
narrowTo is null.
Returns: the EJBHome bound to the specified JNDI name.
toString¶
-
public String
toString
()¶ Returns a string representation of this object, which is the URL.
See also:
java.lang.Object.toString()