|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ca.jcs.sdk.SDKConnectionManager
public class SDKConnectionManager
This class is a bit contrived as the SDK sample is not very realistic in the sense that no "connections" are really required for it to do its work (ie managing local files). However, for the purposes of explanation we implement the SDK's connection as a reference to the parent directory for the connector.
In realistic connectors connection would need to opened and closed, hopefully using to
a pool of some sort (for scalability) where it is possible / sensible to implement one
given the target technology for a connector. Refer to JNDIConnectionPool for
example source.
| Constructor Summary | |
|---|---|
SDKConnectionManager(File parentFile)
|
|
| Method Summary | |
|---|---|
void |
activate()
Does nothing in the SDK's case. |
Object |
borrowConnection()
Needs to be abstract for force implementers to very carefully review any exceptions that might be thrown and decide which ones are retriable soft failures (in which case should throw LdapServiceUnavailableException
with code ResultCodeEnum.UNAVAILABLE)
and which ones are hard failures (in which can throw LdapServiceUnavailableException
with any other code, or any other NamingException variety which implements
LdapException). |
void |
clearConnection()
Does nothing in the SDK's case. |
void |
deactivate()
Does nothing in the SDK's case. |
void |
returnConnection(Object connection)
Does nothing in the SDK's case. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SDKConnectionManager(File parentFile)
| Method Detail |
|---|
public void activate()
throws NamingException
activate in interface ActivatableNamingException
public Object borrowConnection()
throws NamingException
ConnectionManagerLdapServiceUnavailableException
with code ResultCodeEnum.UNAVAILABLE)
and which ones are hard failures (in which can throw LdapServiceUnavailableException
with any other code, or any other NamingException variety which implements
LdapException).
borrowConnection in interface ConnectionManagerNamingException - If connection can't be borrowed, can't return null.public void returnConnection(Object connection)
returnConnection in interface ConnectionManagerconnection - Connection to be returned / closed after it is no longer
required.public void deactivate()
deactivate in interface Activatable
public void clearConnection()
throws NamingException
clearConnection in interface ConnectionManagerNamingException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||