I'm developing a GIS application with **java Srping Framework** and **GeoTools library**. I have some **vector** layer. I want to get this **layers** with **wms** and **wfs** protocols.  
I've downloaded geoserver code. It includes module as bellow:

 - Main Module
 - Core Platform Module
 - Web Map Service Module
 - Web Feature Service Module
 - and etc.

Can I use **Web Map Service Module** and **Web Feature Service Module** of **Geoserver** in my project?  
If yes, **How**?  
I want a sample code to use these modules **apart from geoserver**. Help me please.