The term OSGi usually refers to two things -
1. the OSGi alliance
2. the OSGi service platform
The first one- the OSGi alliance is an organization of companies started in late March 1999. The initial companies involved in the alliance included Sun Microsystems, Ericsson, IBM and others. The idea was to create a standards organization for defining specifications for a Java-based service platform, which can be remotely managed. This platform would consist of multiple modules ( in the OSGi terms are called bundles) which can be installed, started, stopped, updated and uninstalled remotely and dynamically. The dynamically denotes those operations can be achieved without a reboot, at runtime.
The specifications, this alliance deals with is the OSGi service platform to define a component and service model. All of the implementations of the OSGi framework need to provide environment for the applications to run in. The applications are modulated into smaller components called bundle. A bundle is the smallest unit of modularization in OSGi - a collection of classes, resources and configuration files, in which the bundle declares its dependencies. The key mission of a bundle is to declare and use services. The OSGi service platform provides a context where all the running services are registered. This bundle context gets injected into every bundle during its startup.
lifecycle of a given OSGi service contain:
installed: the bundle has been installed to the OSGi container
resolved: all the package requirements are fulfilled and the bundle is ready to be started
starting: the bundle has been started and is still in the process of starting
active: the bundle has started
stopping: the bundle has been initiated to stop and is still in this process. After this the bundle will be in the state resolved
uninstalled: the bundle has been removed from the OSGi container