Skip to content

Commit

Permalink
Add Weld-OSGi SPI bundle files
Browse files Browse the repository at this point in the history
  • Loading branch information
arcane86 authored and jharting committed Jul 4, 2013
1 parent e98eea2 commit d771816
Show file tree
Hide file tree
Showing 40 changed files with 1,376 additions and 852 deletions.
14 changes: 7 additions & 7 deletions environments/osgi/core/api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
</plugin>
</plugins>
</build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
</plugin>
</plugins>
</build>

</project>
2 changes: 1 addition & 1 deletion environments/osgi/core/api/src/etc/header.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
JBoss, Home of Professional Open Source
Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
Copyright 20011, Red Hat, Inc. and/or its affiliates, and individual
contributors by the @authors tag. See the copyright.txt in the
distribution for a full listing of individual contributors.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
* @see org.jboss.weld.environment.osgi.api.events.Valid
* @see org.jboss.weld.environment.osgi.api.events.Invalid
*/
public enum BundleState {
VALID, INVALID
public enum BundleState
{
VALID,
INVALID
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,36 +54,37 @@
* @see Service
* @see RegistrationHolder
*/
public interface Registration<T> extends Iterable<Registration<T>> {
public interface Registration<T> extends Iterable<Registration<T>>
{

/**
* Unregister all the service implementations in this registration.
*/
void unregister();
/**
* Unregister all the service implementations in this registration.
*/
void unregister();

/**
* Get all the service implementation in this registration.
*
* @param <T> the type of the concerned service.
* @return all the service implementations as a {@link Service}.
*/
<T> Service<T> getServiceReference();
/**
* Get all the service implementation in this registration.
*
* @param <T> the type of the concerned service.
* @return all the service implementations as a {@link Service}.
*/
<T> Service<T> getServiceReference();

/**
* Get a subset of this registration with particular service implementations.
*
* @param qualifiers the {@link javax.inject.Qualifier} annotations that filter the requested implementation.
* @return a {@link Registration} that is a subset of this registration with the matching service implementations.
*/
Registration<T> select(Annotation... qualifiers);
/**
* Get a subset of this registration with particular service implementations.
*
* @param qualifiers the {@link javax.inject.Qualifier} annotations that filter the requested implementation.
* @return a {@link Registration} that is a subset of this registration with the matching service implementations.
*/
Registration<T> select(Annotation... qualifiers);

/**
* Get a subset of this registration with particular service implementations.
*
* @param filter the LDAP filter that filters the requested implementation.
* @return a {@link Registration} that is a subset of this registration with the matching service implementations.
*/
Registration<T> select(String filter);
/**
* Get a subset of this registration with particular service implementations.
*
* @param filter the LDAP filter that filters the requested implementation.
* @return a {@link Registration} that is a subset of this registration with the matching service implementations.
*/
Registration<T> select(String filter);

int size();
int size();
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,38 +41,39 @@
* @see Registration
* @see ServiceRegistration
*/
public interface RegistrationHolder {
public interface RegistrationHolder
{

/**
* Get all service registration in this registration holder.
*
* @return the list of {@link ServiceRegistration} in this holder.
*/
List<ServiceRegistration> getRegistrations();
/**
* Get all service registration in this registration holder.
*
* @return the list of {@link ServiceRegistration} in this holder.
*/
List<ServiceRegistration> getRegistrations();

/**
* Add a service registration in this registration holder.
*
* @param registration the {@link ServiceRegistration} to add to this holder.
*/
void addRegistration(ServiceRegistration registration);
/**
* Add a service registration in this registration holder.
*
* @param registration the {@link ServiceRegistration} to add to this holder.
*/
void addRegistration(ServiceRegistration registration);

/**
* Remove a service registration from this registration holder.
*
* @param registration the {@link ServiceRegistration} to remove from this holder.
*/
void removeRegistration(ServiceRegistration registration);
/**
* Remove a service registration from this registration holder.
*
* @param registration the {@link ServiceRegistration} to remove from this holder.
*/
void removeRegistration(ServiceRegistration registration);

/**
* Clear this registration holder, removing all its contained {@link ServiceRegistration}s.
*/
void clear();
/**
* Clear this registration holder, removing all its contained {@link ServiceRegistration}s.
*/
void clear();

/**
* Get the number of service registrations in this registration holder.
*
* @return the number of {@link ServiceRegistration} in this holder.
*/
int size();
/**
* Get the number of service registrations in this registration holder.
*
* @return the number of {@link ServiceRegistration} in this holder.
*/
int size();
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,49 +54,57 @@
* @see ServiceRegistry
* @see Registration
*/
public interface Service<T> extends Iterable<T> {
public interface Service<T> extends Iterable<T>
{

/**
* Obtain the first service instance.
* @return an instance of the service.
*/
T get();

/**
* Obtain a subset of the service implementations containing the first implementation found.
* @return a subset of the service implementations as another {@link Service}.
*/
Iterable<T> first();
/**
* Obtain the first service instance.
*
* @return an instance of the service.
*/
T get();

/**
* Obtain a subset of the service implementations that matches the given {@link javax.inject.Qualifier}
* @param qualifiers the filtering {@link javax.inject.Qualifier}s.
* @return a subset of the service implementations as another {@link Service}.
*/
Service<T> select(Annotation... qualifiers);
/**
* Obtain a subset of the service implementations containing the first implementation found.
*
* @return a subset of the service implementations as another {@link Service}.
*/
Iterable<T> first();

/**
* Obtain a subset of the service implementations that matches the given {@link javax.inject.Qualifier}
* @param filter the filtering LDAP {@link String}.
* @return a subset of the service implementations as another {@link Service}.
*/
Service<T> select(String filter);
/**
* Obtain a subset of the service implementations that matches the given {@link javax.inject.Qualifier}
*
* @param qualifiers the filtering {@link javax.inject.Qualifier}s.
* @return a subset of the service implementations as another {@link Service}.
*/
Service<T> select(Annotation... qualifiers);

/**
* Test if there is no available implementation.
* @return true if there is no implementation, false otherwise.
*/
boolean isUnsatisfied();
/**
* Obtain a subset of the service implementations that matches the given {@link javax.inject.Qualifier}
*
* @param filter the filtering LDAP {@link String}.
* @return a subset of the service implementations as another {@link Service}.
*/
Service<T> select(String filter);

/**
* Test if there are multiple implementations.
* @return true if there are multiple implementations, false otherwise.
*/
boolean isAmbiguous();
/**
* Test if there is no available implementation.
*
* @return true if there is no implementation, false otherwise.
*/
boolean isUnsatisfied();

/**
* Obtain the number of available implementations
* @return the number of available implementations.
*/
int size();
/**
* Test if there are multiple implementations.
*
* @return true if there are multiple implementations, false otherwise.
*/
boolean isAmbiguous();

/**
* Obtain the number of available implementations
*
* @return the number of available implementations.
*/
int size();
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,35 +36,36 @@
* @see Service
* @see Registration
*/
public interface ServiceRegistry {
public interface ServiceRegistry
{

/**
* Register a service implementation.
*
* @param contract the service contract interface.
* @param implementation the service implementation class.
* @param <T> the service type.
* @return the new service {@link Registration} or null if the registration goes wrong.
*/
<T> Registration<T> registerService(Class<T> contract, Class<? extends T> implementation);
/**
* Register a service implementation.
*
* @param contract the service contract interface.
* @param implementation the service implementation class.
* @param <T> the service type.
* @return the new service {@link Registration} or null if the registration goes wrong.
*/
<T> Registration<T> registerService(Class<T> contract, Class<? extends T> implementation);

/**
* Register a service implementation.
*
* @param contract the service contract interface.
* @param implementation the service implementation class.
* @param <T> the service type.
* @param <U> the service implementation type.
* @return the new service {@link Registration} or null if the registration goes wrong.
*/
<T, U extends T> Registration<T> registerService(Class<T> contract, U implementation);
/**
* Register a service implementation.
*
* @param contract the service contract interface.
* @param implementation the service implementation class.
* @param <T> the service type.
* @param <U> the service implementation type.
* @return the new service {@link Registration} or null if the registration goes wrong.
*/
<T, U extends T> Registration<T> registerService(Class<T> contract, U implementation);

/**
* Get available service implementations of a service.
*
* @param contract the service contract interface that implementations are requested.
* @param <T> the service type.
* @return the available service implementations as a {@link Service} or null if there is no such implementation.
*/
<T> Service<T> getServiceReferences(Class<T> contract);
/**
* Get available service implementations of a service.
*
* @param contract the service contract interface that implementations are requested.
* @param <T> the service type.
* @return the available service implementations as a {@link Service} or null if there is no such implementation.
*/
<T> Service<T> getServiceReferences(Class<T> contract);
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,17 @@
* @see BundleName
* @see BundleVersion
*/
@Target({ METHOD, PARAMETER, FIELD })
@Target({METHOD, PARAMETER, FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Qualifier
public @interface BundleDataFile {
public @interface BundleDataFile
{

/**
* The data file that should be injected. Nondiscriminatory value for the typesafe resolution algorithm.
*
* @return the relative path of the data file in the current bundle.
*/
@Nonbinding String value();
/**
* The data file that should be injected. Nondiscriminatory value for the typesafe resolution algorithm.
*
* @return the relative path of the data file in the current bundle.
*/
@Nonbinding String value();
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,17 @@
* @see BundleVersion
* @see BundleHeaders
*/
@Target({ METHOD, PARAMETER, FIELD })
@Target({METHOD, PARAMETER, FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Qualifier
public @interface BundleHeader {
public @interface BundleHeader
{

/**
* The name of the specific bundle header. Nondiscriminatory value for the typesafe resolution algorithm.
*
* @return the name of the bundle header.
*/
@Nonbinding String value();
/**
* The name of the specific bundle header. Nondiscriminatory value for the typesafe resolution algorithm.
*
* @return the name of the bundle header.
*/
@Nonbinding String value();
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@
* @see BundleVersion
* @see BundleHeader
*/
@Target({ METHOD, PARAMETER, FIELD })
@Target({METHOD, PARAMETER, FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Qualifier
public @interface BundleHeaders {
public @interface BundleHeaders
{
}
Loading

0 comments on commit d771816

Please sign in to comment.