This report presents our work on behavioral types for OSGi component systems. It extends previously published work and presents features and details that have not yet been published. In particular, we cover a discussion on behavioral types in general, and Eclipse based implementation work on behavioral types . The implementation work covers: editors, means for comparing types at development and runtime, a tool connection to resolve incompatibilities, and an AspectJ based infrastructure to ensure behavioral type correctness at runtime of a system. Furthermore, the implementation comprises various auxiliary operations. We present some evaluation work based on examples.
Consistency of component software is a crucial condition required for correct program execution. The existing consistency controls of OSGi at build time or in runtime cannot prevent type mismatch failures caused by independent client and server bundle development. This paper describes our solution to this problem using automated versioning of components. Version identifiers are generated from results of subtype-based comparison of component representations, thus achieving a consistent and formally backed interpretation of the version numbering scheme. The implementation of the approach allows its integration into standard OSGi bundle development and build cycle. Formal component models have been subject to research for decades, but current component frameworks hardly reflect their capabilities with respect to composition, dependency management and interaction modeling. Thus the frameworks don’t exploit the benefits of formal component models like understandability and ease of maintenance, which are enabled when software is composed of hierarchical and reusable components that are loosely coupled, self-describing and self-contained. In this contribution, we try to examine the discrepancies between the state of research and the capabilities of an existing module framework, the widely-used OSGi bundle management framework for the Java platform. Based on this we propose modifications and enhancements to the OSGi framework that allow to exploit the benefits of formal component models in OSGi-based applications.  The natural business model of OSGi is dynamic loading and removal of bundles or services on an OSGi platform. If bundles can come from different stakeholders, how do we make sure that one’s services will only be invoked by the authorized bundles? A simple solution is to interweave functional and security logic within each bundle, but this decreases the benefits of using a common platform for service deployment and is a well-known source of errors. Our solution is to use the Security-by-Contract methodology (SxC) for loading time security verification to separate the security from the business logic while controlling access to applications. The basic idea is that each bundle has a contract embedded into its manifest, that contains details on functional requirements and permissions for access by other bundles on the platform. During bundle installation the contract is matched with the platform security policy (aggregating the contracts of the installed bundles). We illustrate the SxC methodology on a concrete case study for home gateways and discuss how it can help to overcome the OSGi security management shortcomings. We present a formalization of the OSGi component framework. Our formalization is intended to be used as a basis for describing behavior of OSGi based systems. Furthermore, we describe specification formalisms for describing properties of OSGi based systems. One application is its use for behavioral types. Potential uses comprise the derivation of runtime monitors, checking compatibility of component composition, discovering components using brokerage services and checking the compatibility of implementation artifacts towards a specification.