How to start appium servier programatically?

How can i start appium server programmatically in java using some specified proxy and port?
And also to kill that started server at the end of the class.

Jitender