The embedded APIs have traditionally been used a lot to build customizations that run inside the same JVM as the Alfresco Repository. There are both a Public Java API and a Repository JavaScript API. For more information on Public Java API, see Java Foundation API.
Before using the embedded APIs a thorough investigation should be done to rule out the possibility of building the extension with a remote API. It is not recommended to build embedded extensions unless it is absolutely necessary. They make it difficult during upgrades and can quite easily have unintended side effects on core repository functionality, such as file upload.