Section 19D. The first justice of a district court may appoint, subject to appropriation, and subject to the approval of the chief justice of the district court department, such number of housing specialists as the first justice of said department may from time to time determine. The first justice may designate one of them as chief housing specialist for the court. All housing specialists shall hold office at the pleasure of the first justice of the district court, subject, however, to retirement under the provisions of any applicable general or special law relative to retirement systems. All housing specialists shall be knowledgeable in the maintenance, repair, and rehabilitation of dwelling units; the problems of landlord and tenant as they pertain to dwelling units; the types of funds and services available to assist landlords and tenants in the financing and resolution of such problems; the federal and state laws, rules and regulations pertaining to the maintenance, repair and rehabilitation of such units; and the financing and resolution of such problems. The housing specialists shall have such powers and perform such duties as the first justice of the district court shall from time to time prescribe with regard to actions pending before the court under chapter two hundred and thirty-nine. Every housing specialist shall be sworn by the first justice of the district court, who shall, upon administering the oath, forthwith make return of such act with the date thereof to the state secretary.