Section 5. If the commissioner is satisfied, upon examination or other evidence submitted to him, that any foreign company is insolvent or is in an unsound financial condition, or that its business policies or methods are unsound or improper, or that its condition or management is such as to render its further transaction of business hazardous to the public or its policyholders, or that it is transacting business fraudulently, or that its officers or agents have refused to submit to an examination under section four or to perform any legal obligation relative thereto or that the amount of its funds, net cash or contingent assets is deficient or that its capital stock or deposit or guaranty capital or guaranty fund is impaired, as set forth in section twenty-three A, or that such capital stock, deposit or guaranty capital or guaranty fund has been reduced below the amount required by section one hundred and fifty-one, he shall revoke the license issued to said company under section one hundred and fifty-one and the licenses issued to all of its agents under this chapter; or, if he is satisfied, as aforesaid, that any foreign company has violated any provision of law or has failed to comply with its charter, he may revoke such licenses or suspend them for a period not exceeding the unexpired terms thereof. He shall give written notice to the company specifying the date on which such revocation or suspension shall be effective, the term of any such suspension and the ground for such revocation or suspension; provided, that if the ground for revocation or suspension is that the company has violated any provision of law or has failed to comply with its charter, the effective date of such revocation or suspension shall be not less than ten days from the date of issue of said notice, and the particulars of such violation or failure to comply with its charter shall be specified in said notice. Such notice may be served by registered mail, sent postage prepaid, addressed to the company at its last home office address or, in the case of a company described in section one hundred and fifty-five, to its resident manager in the United States at his last address, appearing on the records of the commissioner. An affidavit of the commissioner, in such form as he may prescribe, or of anyone authorized by him to give such notice, appended to a copy thereof, that such notice has been mailed as aforesaid shall be prima facie evidence that such notice has been duly given. He shall also cause notice of such revocation or suspension to be published in such manner as he may deem necessary for the protection of the public. A company aggrieved by a revocation or suspension of its license hereunder, may within ten days from the effective date of such revocation or suspension file a petition in the supreme judicial court for the county of Suffolk for a review of such action of the commissioner. The court shall summarily hear and determine the question whether the ground for revocation or suspension specified in the notice of the commissioner exists and may make any appropriate order or decree. If the order or decree is adverse to the petitioning company it may within ten days therefrom appeal to the full court; and in case of such an appeal the revocation or suspension of the license of the said company shall continue in full force until the final determination of the question by the full court, unless vacated by the commissioner during the pendency of such appeal.