public void dispose(){
  lock.lock();
  try {
    close();
    clientPrivateKey=null;
    clientCertificate=null;
    serverCertificate=null;
    endpointConfiguration=null;
    endpointDescription=null;
    serializer=null;
    certificateValidator=null;
    setSocket(null);
    ctx=null;
    out=null;
    quotas=null;
    limits=null;
  }
  finally {
    lock.unlock();
  }
}

public void dispose ( ) { lock . lock ( ) ; try { close ( ) ; clientPrivateKey = null ; clientCertificate = null ; serverCertificate = null ; endpointConfiguration = null ; endpointDescription = null ; serializer = null ; certificateValidator = null ; setSocket ( null ) ; ctx = null ; out = null ; quotas = null ; limits = null ; } finally { lock . unlock ( ) ; } }
optional dispose closes connection and clears all variables
