* JBoss, Home of Professional Open Source
* Copyright 2010, Red Hat, Inc., and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
The portable extension integration SPI.
A portable extension may integrate with the container by:
Portable extensions sometimes interact directly with the container
via programmatic API call. The interface
for obtaining contextual references for beans, along with many other
operations of use to portable extensions.
During the application initialization process, the container fires a series of events, allowing portable extensions to integrate with the container initialization process. Observer methods of these events must belong to extensions declared in META-INF/services.
An instance of Bean exists for every
enabled bean. A portable
extension may add support for new kinds of beans by implementing
Bean, observing the event
registering beans with the container. An instance of
ObserverMethod exists for every
observer method of every
enabled bean. A portable extension may add observers by implementing
registering an instance with the container.
A portable extension may be notified of the existence of an
enabled bean by observing the container lifecycle event type
or one of its
or of the existence of an observer method of an enabled bean by
observing the event type
A portable extension may provide an alternative metadata source, such as configuration by XML.
and its subtypes allow a portable extension to specify
metadata that overrides the annotations that exist on a
bean class. The portable extension is responsible for
implementing the interfaces, thereby exposing the metadata
to the container. The container must use the operations of
Annotated and its subinterfaces to discover program
element types and annotations, instead of directly calling the
Java Reflection API.
abstract the basic lifecycle of (contextual or non-contextual) container managed objects, including instantiation and destruction, dependency injection and lifecycle callbacks.
Furthermore, a portable extension may replace the implementation
used by the container
with its own implementation by observing the events