(1) By express agreement, e. g. where a port agent is expressly appointed by a shipowner or time charterer;
(2) by implication or conduct, e. g. where, by the act of appointing an officer to command of its ship, the master is made the agent of the shipowner for purposes of procuring stores, bunkers, pilots, tugs, etc.; and (in rare cases) (3) of necessity, e. g. where a shipmaster, acting on his own initiative, takes emergency action to save his ship and its cargo when they are in immediate peril.