You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by ri...@apache.org on 2012/05/11 22:19:07 UTC
svn commit: r1337360 [2/7] - in /felix/trunk/framework: ./
src/main/java/org/apache/felix/framework/
src/main/java/org/apache/felix/framework/resolver/
src/main/java/org/apache/felix/framework/wiring/
src/main/java/org/osgi/framework/ src/main/java/org...
Modified: felix/trunk/framework/src/main/java/org/osgi/framework/BundleContext.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/osgi/framework/BundleContext.java?rev=1337360&r1=1337359&r2=1337360&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/osgi/framework/BundleContext.java (original)
+++ felix/trunk/framework/src/main/java/org/osgi/framework/BundleContext.java Fri May 11 20:19:02 2012
@@ -1,5 +1,5 @@
/*
- * Copyright (c) OSGi Alliance (2000, 2010). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2000, 2012). All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -47,11 +47,11 @@ import java.util.Dictionary;
*
* <p>
* The {@code BundleContext} object will be passed to the
- * {@link BundleActivator#start} method during activation of the context bundle.
- * The same {@code BundleContext} object will be passed to the
- * {@link BundleActivator#stop} method when the context bundle is stopped. A
- * {@code BundleContext} object is generally for the private use of its
- * associated bundle and is not meant to be shared with other bundles in the
+ * {@link BundleActivator#start(BundleContext)} method during activation of the
+ * context bundle. The same {@code BundleContext} object will be passed to the
+ * {@link BundleActivator#stop(BundleContext)} method when the context bundle is
+ * stopped. A {@code BundleContext} object is generally for the private use of
+ * its associated bundle and is not meant to be shared with other bundles in the
* OSGi environment.
*
* <p>
@@ -76,7 +76,7 @@ import java.util.Dictionary;
*
* @ThreadSafe
* @noimplement
- * @version $Id: 6d4b5967b9fe706b1dfbdd42b3d759028ed9826d $
+ * @version $Id: 4f166fd274f3965e48a7dbc239213d00e062b6d0 $
*/
public interface BundleContext extends BundleReference {
@@ -175,8 +175,7 @@ public interface BundleContext extends B
* Runtime Environment supports permissions.
* @throws IllegalStateException If this BundleContext is no longer valid.
*/
- Bundle installBundle(String location, InputStream input)
- throws BundleException;
+ Bundle installBundle(String location, InputStream input) throws BundleException;
/**
* Installs a bundle from the specified {@code location} identifier.
@@ -270,8 +269,7 @@ public interface BundleContext extends B
* @see ServiceListener
* @see ServicePermission
*/
- void addServiceListener(ServiceListener listener, String filter)
- throws InvalidSyntaxException;
+ void addServiceListener(ServiceListener listener, String filter) throws InvalidSyntaxException;
/**
* Adds the specified {@code ServiceListener} object to the context bundle's
@@ -374,8 +372,11 @@ public interface BundleContext extends B
* {@code ServiceRegistration} object is for the private use of the bundle
* registering the service and should not be shared with other bundles. The
* registering bundle is defined to be the context bundle. Other bundles can
- * locate the service by using either the {@link #getServiceReferences} or
- * {@link #getServiceReference} method.
+ * locate the service by using one of the
+ * {@link #getServiceReferences(Class, String)},
+ * {@link #getServiceReferences(String, String)},
+ * {@link #getServiceReference(Class)} or
+ * {@link #getServiceReference(String)} methods.
*
* <p>
* A bundle can register a service object that implements the
@@ -413,9 +414,9 @@ public interface BundleContext extends B
* {@link Constants} for a list of standard service property keys.
* Changes should not be made to this object after calling this
* method. To update the service's properties the
- * {@link ServiceRegistration#setProperties} method must be called.
- * The set of properties may be {@code null} if the service has no
- * properties.
+ * {@link ServiceRegistration#setProperties(Dictionary)} method must
+ * be called. The set of properties may be {@code null} if the
+ * service has no properties.
* @return A {@code ServiceRegistration} object for use by the bundle
* registering the service to update the service's properties or to
* unregister the service.
@@ -434,8 +435,7 @@ public interface BundleContext extends B
* @see ServiceRegistration
* @see ServiceFactory
*/
- ServiceRegistration< ? > registerService(String[] clazzes, Object service,
- Dictionary<String, ? > properties);
+ ServiceRegistration<?> registerService(String[] clazzes, Object service, Dictionary<String, ?> properties);
/**
* Registers the specified service object with the specified properties
@@ -458,34 +458,29 @@ public interface BundleContext extends B
* @throws IllegalStateException If this BundleContext is no longer valid.
* @see #registerService(String[], Object, Dictionary)
*/
- ServiceRegistration< ? > registerService(String clazz, Object service,
- Dictionary<String, ? > properties);
+ ServiceRegistration<?> registerService(String clazz, Object service, Dictionary<String, ?> properties);
/**
* Registers the specified service object with the specified properties
- * under the specified class name with the Framework.
+ * under the name of the specified class with the Framework.
*
* <p>
* This method is otherwise identical to
- * {@link #registerService(String[], Object, Dictionary)} and is provided as
- * a convenience when {@code service} will only be registered under a single
- * class name. Note that even in this case the value of the service's
- * {@link Constants#OBJECTCLASS} property will be an array of string, rather
- * than just a single string.
+ * {@link #registerService(String, Object, Dictionary)} and is provided to
+ * return a type safe {@code ServiceRegistration}.
*
* @param <S> Type of Service.
- * @param clazz The class name under which the service can be located.
+ * @param clazz The class under whose name the service can be located.
* @param service The service object or a {@code ServiceFactory} object.
* @param properties The properties for this service.
* @return A {@code ServiceRegistration} object for use by the bundle
* registering the service to update the service's properties or to
* unregister the service.
* @throws IllegalStateException If this BundleContext is no longer valid.
- * @see #registerService(String[], Object, Dictionary)
+ * @see #registerService(String, Object, Dictionary)
* @since 1.6
*/
- <S> ServiceRegistration<S> registerService(Class<S> clazz, S service,
- Dictionary<String, ? > properties);
+ <S> ServiceRegistration<S> registerService(Class<S> clazz, S service, Dictionary<String, ?> properties);
/**
* Returns an array of {@code ServiceReference} objects. The returned array
@@ -539,8 +534,7 @@ public interface BundleContext extends B
* an invalid filter expression that cannot be parsed.
* @throws IllegalStateException If this BundleContext is no longer valid.
*/
- ServiceReference< ? >[] getServiceReferences(String clazz, String filter)
- throws InvalidSyntaxException;
+ ServiceReference<?>[] getServiceReferences(String clazz, String filter) throws InvalidSyntaxException;
/**
* Returns an array of {@code ServiceReference} objects. The returned array
@@ -589,8 +583,7 @@ public interface BundleContext extends B
* @throws IllegalStateException If this BundleContext is no longer valid.
* @since 1.3
*/
- ServiceReference< ? >[] getAllServiceReferences(String clazz, String filter)
- throws InvalidSyntaxException;
+ ServiceReference<?>[] getAllServiceReferences(String clazz, String filter) throws InvalidSyntaxException;
/**
* Returns a {@code ServiceReference} object for a service that implements
@@ -623,11 +616,11 @@ public interface BundleContext extends B
* @throws IllegalStateException If this BundleContext is no longer valid.
* @see #getServiceReferences(String, String)
*/
- ServiceReference< ? > getServiceReference(String clazz);
+ ServiceReference<?> getServiceReference(String clazz);
/**
* Returns a {@code ServiceReference} object for a service that implements
- * and was registered under the specified class.
+ * and was registered under the name of the specified class.
*
* <p>
* The returned {@code ServiceReference} object is valid at the time of the
@@ -648,9 +641,10 @@ public interface BundleContext extends B
* service that was registered first is returned.
*
* @param <S> Type of Service.
- * @param clazz The class name with which the service was registered.
+ * @param clazz The class under whose name the service was registered. Must
+ * not be {@code null}.
* @return A {@code ServiceReference} object, or {@code null} if no services
- * are registered which implement the named class.
+ * are registered which implement the specified class.
* @throws IllegalStateException If this BundleContext is no longer valid.
* @see #getServiceReferences(Class, String)
* @since 1.6
@@ -660,10 +654,10 @@ public interface BundleContext extends B
/**
* Returns a collection of {@code ServiceReference} objects. The returned
* collection of {@code ServiceReference} objects contains services that
- * were registered under the specified class, match the specified filter
- * expression, and the packages for the class names under which the services
- * were registered match the context bundle's packages as defined in
- * {@link ServiceReference#isAssignableTo(Bundle, String)}.
+ * were registered under the name of the specified class, match the
+ * specified filter expression, and the packages for the class names under
+ * which the services were registered match the context bundle's packages as
+ * defined in {@link ServiceReference#isAssignableTo(Bundle, String)}.
*
* <p>
* The collection is valid at the time of the call to this method. However
@@ -684,11 +678,10 @@ public interface BundleContext extends B
* The result is a collection of {@code ServiceReference} objects for all
* services that meet all of the following conditions:
* <ul>
- * <li>If the specified class name, {@code clazz}, is not {@code null}, the
- * service must have been registered with the specified class name. The
- * complete list of class names with which a service was registered is
- * available from the service's {@link Constants#OBJECTCLASS objectClass}
- * property.
+ * <li>The service must have been registered with the name of the specified
+ * class. The complete list of class names with which a service was
+ * registered is available from the service's {@link Constants#OBJECTCLASS
+ * objectClass} property.
* <li>If the specified {@code filter} is not {@code null}, the filter
* expression must match the service.
* <li>If the Java Runtime Environment supports permissions, the caller must
@@ -701,7 +694,7 @@ public interface BundleContext extends B
* </ul>
*
* @param <S> Type of Service
- * @param clazz The class name with which the service was registered. Must
+ * @param clazz The class under whose name the service was registered. Must
* not be {@code null}.
* @param filter The filter expression or {@code null} for all services.
* @return A collection of {@code ServiceReference} objects. May be empty if
@@ -711,8 +704,7 @@ public interface BundleContext extends B
* @throws IllegalStateException If this BundleContext is no longer valid.
* @since 1.6
*/
- <S> Collection<ServiceReference<S>> getServiceReferences(Class<S> clazz,
- String filter) throws InvalidSyntaxException;
+ <S> Collection<ServiceReference<S>> getServiceReferences(Class<S> clazz, String filter) throws InvalidSyntaxException;
/**
* Returns the service object referenced by the specified
@@ -810,10 +802,10 @@ public interface BundleContext extends B
* @throws IllegalArgumentException If the specified
* {@code ServiceReference} was not created by the same framework
* instance as this {@code BundleContext}.
- * @see #getService
+ * @see #getService(ServiceReference)
* @see ServiceFactory
*/
- boolean ungetService(ServiceReference< ? > reference);
+ boolean ungetService(ServiceReference<?> reference);
/**
* Creates a {@code File} object for a file in the persistent storage area
Modified: felix/trunk/framework/src/main/java/org/osgi/framework/BundleEvent.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/osgi/framework/BundleEvent.java?rev=1337360&r1=1337359&r2=1337360&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/osgi/framework/BundleEvent.java (original)
+++ felix/trunk/framework/src/main/java/org/osgi/framework/BundleEvent.java Fri May 11 20:19:02 2012
@@ -1,5 +1,5 @@
/*
- * Copyright (c) OSGi Alliance (2000, 2010). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2000, 2012). All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,9 +22,9 @@ import java.util.EventObject;
* An event from the Framework describing a bundle lifecycle change.
* <p>
* {@code BundleEvent} objects are delivered to
- * {@code SynchronousBundleListener}s and {@code BundleListener}s
- * when a change occurs in a bundle's lifecycle. A type code is used to identify
- * the event type for future extendability.
+ * {@code SynchronousBundleListener}s and {@code BundleListener}s when a change
+ * occurs in a bundle's lifecycle. A type code is used to identify the event
+ * type for future extendability.
*
* <p>
* OSGi Alliance reserves the right to extend the set of types.
@@ -32,7 +32,7 @@ import java.util.EventObject;
* @Immutable
* @see BundleListener
* @see SynchronousBundleListener
- * @version $Id: ed3c40cd707bed45681cadce114a6cc5db27a844 $
+ * @version $Id: 9e2102212eb526b5f11fdde4b0fc5c171a0b39c8 $
*/
public class BundleEvent extends EventObject {
@@ -57,9 +57,9 @@ public class BundleEvent extends EventOb
/**
* The bundle has been started.
* <p>
- * The bundle's
- * {@link BundleActivator#start(BundleContext) BundleActivator start} method
- * has been executed if the bundle has a bundle activator class.
+ * The bundle's {@link BundleActivator#start(BundleContext) BundleActivator
+ * start} method has been executed if the bundle has a bundle activator
+ * class.
*
* @see Bundle#start()
*/
@@ -68,9 +68,9 @@ public class BundleEvent extends EventOb
/**
* The bundle has been stopped.
* <p>
- * The bundle's
- * {@link BundleActivator#stop(BundleContext) BundleActivator stop} method
- * has been executed if the bundle has a bundle activator class.
+ * The bundle's {@link BundleActivator#stop(BundleContext) BundleActivator
+ * stop} method has been executed if the bundle has a bundle activator
+ * class.
*
* @see Bundle#stop()
*/
@@ -86,7 +86,7 @@ public class BundleEvent extends EventOb
/**
* The bundle has been uninstalled.
*
- * @see Bundle#uninstall
+ * @see Bundle#uninstall()
*/
public final static int UNINSTALLED = 0x00000010;
@@ -109,11 +109,10 @@ public class BundleEvent extends EventOb
/**
* The bundle is about to be activated.
* <p>
- * The bundle's
- * {@link BundleActivator#start(BundleContext) BundleActivator start} method
- * is about to be called if the bundle has a bundle activator class. This
- * event is only delivered to {@link SynchronousBundleListener}s. It is not
- * delivered to {@code BundleListener}s.
+ * The bundle's {@link BundleActivator#start(BundleContext) BundleActivator
+ * start} method is about to be called if the bundle has a bundle activator
+ * class. This event is only delivered to {@link SynchronousBundleListener}
+ * s. It is not delivered to {@code BundleListener}s.
*
* @see Bundle#start()
* @since 1.3
@@ -123,11 +122,10 @@ public class BundleEvent extends EventOb
/**
* The bundle is about to deactivated.
* <p>
- * The bundle's
- * {@link BundleActivator#stop(BundleContext) BundleActivator stop} method
- * is about to be called if the bundle has a bundle activator class. This
- * event is only delivered to {@link SynchronousBundleListener}s. It is not
- * delivered to {@code BundleListener}s.
+ * The bundle's {@link BundleActivator#stop(BundleContext) BundleActivator
+ * stop} method is about to be called if the bundle has a bundle activator
+ * class. This event is only delivered to {@link SynchronousBundleListener}
+ * s. It is not delivered to {@code BundleListener}s.
*
* @see Bundle#stop()
* @since 1.3
@@ -138,10 +136,9 @@ public class BundleEvent extends EventOb
* The bundle will be lazily activated.
* <p>
* The bundle has a {@link Constants#ACTIVATION_LAZY lazy activation policy}
- * and is waiting to be activated. It is now in the
- * {@link Bundle#STARTING STARTING} state and has a valid
- * {@code BundleContext}. This event is only delivered to
- * {@link SynchronousBundleListener}s. It is not delivered to
+ * and is waiting to be activated. It is now in the {@link Bundle#STARTING
+ * STARTING} state and has a valid {@code BundleContext}. This event is only
+ * delivered to {@link SynchronousBundleListener}s. It is not delivered to
* {@code BundleListener}s.
*
* @since 1.4
Modified: felix/trunk/framework/src/main/java/org/osgi/framework/BundleException.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/osgi/framework/BundleException.java?rev=1337360&r1=1337359&r2=1337360&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/osgi/framework/BundleException.java (original)
+++ felix/trunk/framework/src/main/java/org/osgi/framework/BundleException.java Fri May 11 20:19:02 2012
@@ -1,5 +1,5 @@
/*
- * Copyright (c) OSGi Alliance (2000, 2010). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2000, 2012). All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,10 +21,10 @@ package org.osgi.framework;
* occurred.
*
* <p>
- * A {@code BundleException} object is created by the Framework to denote
- * an exception condition in the lifecycle of a bundle.
- * {@code BundleException}s should not be created by bundle developers.
- * A type code is used to identify the exception type for future extendability.
+ * A {@code BundleException} object is created by the Framework to denote an
+ * exception condition in the lifecycle of a bundle. {@code BundleException}s
+ * should not be created by bundle developers. A type code is used to identify
+ * the exception type for future extendability.
*
* <p>
* OSGi Alliance reserves the right to extend the set of types.
@@ -32,7 +32,7 @@ package org.osgi.framework;
* <p>
* This exception conforms to the general purpose exception chaining mechanism.
*
- * @version $Id: 9e117ec9667b040f7752e342aa07d6c7d5bf0275 $
+ * @version $Id: 0c97ed2696b4576d61440020922b1a97545beb1e $
*/
public class BundleException extends Exception {
@@ -51,7 +51,7 @@ public class BundleException extends Exc
*/
public static final int UNSPECIFIED = 0;
/**
- * The operation was unsupported. This type can be used anywhere a
+ * The operation was unsupported. This type can be used anywhere a
* BundleException can be thrown.
*
* @since 1.5
@@ -112,8 +112,8 @@ public class BundleException extends Exc
* @since 1.5
*/
public static final int DUPLICATE_BUNDLE_ERROR = 9;
-
- /**
+
+ /**
* The start transient operation failed because the start level of the
* bundle is greater than the current framework start level
*
@@ -157,8 +157,8 @@ public class BundleException extends Exc
}
/**
- * Creates a {@code BundleException} with the specified message, type
- * and exception cause.
+ * Creates a {@code BundleException} with the specified message, type and
+ * exception cause.
*
* @param msg The associated message.
* @param type The type for this exception.
@@ -171,8 +171,7 @@ public class BundleException extends Exc
}
/**
- * Creates a {@code BundleException} with the specified message and
- * type.
+ * Creates a {@code BundleException} with the specified message and type.
*
* @param msg The message.
* @param type The type for this exception.
@@ -189,8 +188,8 @@ public class BundleException extends Exc
*
* <p>
* This method predates the general purpose exception chaining mechanism.
- * The {@code getCause()} method is now the preferred means of
- * obtaining this information.
+ * The {@code getCause()} method is now the preferred means of obtaining
+ * this information.
*
* @return The result of calling {@code getCause()}.
*/
@@ -199,11 +198,9 @@ public class BundleException extends Exc
}
/**
- * Returns the cause of this exception or {@code null} if no cause was
- * set.
+ * Returns the cause of this exception or {@code null} if no cause was set.
*
- * @return The cause of this exception or {@code null} if no cause was
- * set.
+ * @return The cause of this exception or {@code null} if no cause was set.
* @since 1.3
*/
public Throwable getCause() {
@@ -226,8 +223,8 @@ public class BundleException extends Exc
}
/**
- * Returns the type for this exception or {@code UNSPECIFIED} if the
- * type was unspecified or unknown.
+ * Returns the type for this exception or {@code UNSPECIFIED} if the type
+ * was unspecified or unknown.
*
* @return The type of this exception.
* @since 1.5
Modified: felix/trunk/framework/src/main/java/org/osgi/framework/BundleListener.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/osgi/framework/BundleListener.java?rev=1337360&r1=1337359&r2=1337360&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/osgi/framework/BundleListener.java (original)
+++ felix/trunk/framework/src/main/java/org/osgi/framework/BundleListener.java Fri May 11 20:19:02 2012
@@ -1,5 +1,5 @@
/*
- * Copyright (c) OSGi Alliance (2000, 2010). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2000, 2011). All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,22 +19,22 @@ package org.osgi.framework;
import java.util.EventListener;
/**
- * A {@code BundleEvent} listener. {@code BundleListener} is a
- * listener interface that may be implemented by a bundle developer. When a
+ * A {@code BundleEvent} listener. {@code BundleListener} is a listener
+ * interface that may be implemented by a bundle developer. When a
* {@code BundleEvent} is fired, it is asynchronously delivered to a
- * {@code BundleListener}. The Framework delivers
- * {@code BundleEvent} objects to a {@code BundleListener} in
- * order and must not concurrently call a {@code BundleListener}.
+ * {@code BundleListener}. The Framework delivers {@code BundleEvent} objects to
+ * a {@code BundleListener} in order and must not concurrently call a
+ * {@code BundleListener}.
* <p>
- * A {@code BundleListener} object is registered with the Framework using
- * the {@link BundleContext#addBundleListener} method.
- * {@code BundleListener}s are called with a {@code BundleEvent}
- * object when a bundle has been installed, resolved, started, stopped, updated,
- * unresolved, or uninstalled.
+ * A {@code BundleListener} object is registered with the Framework using the
+ * {@link BundleContext#addBundleListener(BundleListener)} method.
+ * {@code BundleListener}s are called with a {@code BundleEvent} object when a
+ * bundle has been installed, resolved, started, stopped, updated, unresolved,
+ * or uninstalled.
*
* @see BundleEvent
* @NotThreadSafe
- * @version $Id: 77cdaebd3ac97c6798fc3043957abd1bd6d01ccb $
+ * @version $Id: d48b4a8a59c839466a3d749dde23980d236f58c6 $
*/
public interface BundleListener extends EventListener {
Modified: felix/trunk/framework/src/main/java/org/osgi/framework/BundlePermission.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/osgi/framework/BundlePermission.java?rev=1337360&r1=1337359&r2=1337360&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/osgi/framework/BundlePermission.java (original)
+++ felix/trunk/framework/src/main/java/org/osgi/framework/BundlePermission.java Fri May 11 20:19:02 2012
@@ -1,5 +1,5 @@
/*
- * Copyright (c) OSGi Alliance (2004, 2010). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2004, 2012). All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -52,13 +52,13 @@ import java.util.Map;
* </pre>
*
* <p>
- * {@code BundlePermission} has four actions: {@code provide},
- * {@code require},{@code host}, and {@code fragment}. The
- * {@code provide} action implies the {@code require} action.
+ * {@code BundlePermission} has four actions: {@code provide}, {@code require},
+ * {@code host}, and {@code fragment}. The {@code provide} action implies the
+ * {@code require} action.
*
* @since 1.3
* @ThreadSafe
- * @version $Id: d30c9c987cc13007ed19d3a9fdd11b00739591c0 $
+ * @version $Id: ccba905e3373800dfdb080118e97145abf778da2 $
*/
public final class BundlePermission extends BasicPermission {
@@ -66,14 +66,14 @@ public final class BundlePermission exte
private static final long serialVersionUID = 3257846601685873716L;
/**
- * The action string {@code provide}. The {@code provide} action
- * implies the {@code require} action.
+ * The action string {@code provide}. The {@code provide} action implies the
+ * {@code require} action.
*/
public final static String PROVIDE = "provide";
/**
- * The action string {@code require}. The {@code require} action
- * is implied by the {@code provide} action.
+ * The action string {@code require}. The {@code require} action is implied
+ * by the {@code provide} action.
*/
public final static String REQUIRE = "require";
@@ -91,10 +91,7 @@ public final class BundlePermission exte
private final static int ACTION_REQUIRE = 0x00000002;
private final static int ACTION_HOST = 0x00000004;
private final static int ACTION_FRAGMENT = 0x00000008;
- private final static int ACTION_ALL = ACTION_PROVIDE
- | ACTION_REQUIRE
- | ACTION_HOST
- | ACTION_FRAGMENT;
+ private final static int ACTION_ALL = ACTION_PROVIDE | ACTION_REQUIRE | ACTION_HOST | ACTION_FRAGMENT;
final static int ACTION_NONE = 0;
/**
* The actions mask.
@@ -115,14 +112,14 @@ public final class BundlePermission exte
* Bundle Permissions are granted over all possible versions of a bundle.
*
* A bundle that needs to provide a bundle must have the appropriate
- * {@code BundlePermission} for the symbolic name; a bundle that
- * requires a bundle must have the appropriate {@code BundlePermssion}
- * for that symbolic name; a bundle that specifies a fragment host must have
- * the appropriate {@code BundlePermission} for that symbolic name.
+ * {@code BundlePermission} for the symbolic name; a bundle that requires a
+ * bundle must have the appropriate {@code BundlePermssion} for that
+ * symbolic name; a bundle that specifies a fragment host must have the
+ * appropriate {@code BundlePermission} for that symbolic name.
*
* @param symbolicName The bundle symbolic name.
- * @param actions {@code provide},{@code require},
- * {@code host},{@code fragment} (canonical order).
+ * @param actions {@code provide},{@code require}, {@code host},
+ * {@code fragment} (canonical order).
*/
public BundlePermission(String symbolicName, String actions) {
this(symbolicName, parseActions(actions));
@@ -188,9 +185,7 @@ public final class BundlePermission exte
char c;
// skip whitespace
- while ((i != -1)
- && ((c = a[i]) == ' ' || c == '\r' || c == '\n'
- || c == '\f' || c == '\t'))
+ while ((i != -1) && ((c = a[i]) == ' ' || c == '\r' || c == '\n' || c == '\f' || c == '\t'))
i--;
// check for the known strings
@@ -205,8 +200,7 @@ public final class BundlePermission exte
&& (a[i] == 'e' || a[i] == 'E')) {
matchlen = 7;
mask |= ACTION_PROVIDE | ACTION_REQUIRE;
- }
- else
+ } else
if (i >= 6 && (a[i - 6] == 'r' || a[i - 6] == 'R')
&& (a[i - 5] == 'e' || a[i - 5] == 'E')
&& (a[i - 4] == 'q' || a[i - 4] == 'Q')
@@ -216,16 +210,14 @@ public final class BundlePermission exte
&& (a[i] == 'e' || a[i] == 'E')) {
matchlen = 7;
mask |= ACTION_REQUIRE;
- }
- else
+ } else
if (i >= 3 && (a[i - 3] == 'h' || a[i - 3] == 'H')
&& (a[i - 2] == 'o' || a[i - 2] == 'O')
&& (a[i - 1] == 's' || a[i - 1] == 'S')
&& (a[i] == 't' || a[i] == 'T')) {
matchlen = 4;
mask |= ACTION_HOST;
- }
- else
+ } else
if (i >= 7 && (a[i - 7] == 'f' || a[i - 7] == 'F')
&& (a[i - 6] == 'r' || a[i - 6] == 'R')
&& (a[i - 5] == 'a' || a[i - 5] == 'A')
@@ -236,11 +228,9 @@ public final class BundlePermission exte
&& (a[i] == 't' || a[i] == 'T')) {
matchlen = 8;
mask |= ACTION_FRAGMENT;
- }
- else {
+ } else {
// parse error
- throw new IllegalArgumentException(
- "invalid permission: " + actions);
+ throw new IllegalArgumentException("invalid permission: " + actions);
}
// make sure we didn't just match the tail of a word
@@ -258,8 +248,7 @@ public final class BundlePermission exte
case '\t' :
break;
default :
- throw new IllegalArgumentException(
- "invalid permission: " + actions);
+ throw new IllegalArgumentException("invalid permission: " + actions);
}
i--;
}
@@ -295,8 +284,8 @@ public final class BundlePermission exte
* </pre>
*
* @param p The requested permission.
- * @return {@code true} if the specified {@code BundlePermission}
- * action is implied by this object; {@code false} otherwise.
+ * @return {@code true} if the specified {@code BundlePermission} action is
+ * implied by this object; {@code false} otherwise.
*/
public boolean implies(Permission p) {
if (!(p instanceof BundlePermission)) {
@@ -306,8 +295,7 @@ public final class BundlePermission exte
final int effective = getActionsMask();
final int desired = requested.getActionsMask();
- return ((effective & desired) == desired)
- && super.implies(requested);
+ return ((effective & desired) == desired) && super.implies(requested);
}
/**
@@ -315,9 +303,8 @@ public final class BundlePermission exte
* {@code BundlePermission} actions.
*
* <p>
- * Always returns present {@code BundlePermission} actions in the
- * following order: {@code provide}, {@code require},
- * {@code host}, {@code fragment}.
+ * Always returns present {@code BundlePermission} actions in the following
+ * order: {@code provide}, {@code require}, {@code host}, {@code fragment}.
*
* @return Canonical string representation of the {@code BundlePermission
* } actions.
@@ -359,8 +346,8 @@ public final class BundlePermission exte
}
/**
- * Returns a new {@code PermissionCollection} object suitable for
- * storing {@code BundlePermission} objects.
+ * Returns a new {@code PermissionCollection} object suitable for storing
+ * {@code BundlePermission} objects.
*
* @return A new {@code PermissionCollection} object.
*/
@@ -377,10 +364,9 @@ public final class BundlePermission exte
*
* @param obj The object to test for equality with this
* {@code BundlePermission} object.
- * @return {@code true} if {@code obj} is a
- * {@code BundlePermission}, and has the same bundle symbolic
- * name and actions as this {@code BundlePermission} object;
- * {@code false} otherwise.
+ * @return {@code true} if {@code obj} is a {@code BundlePermission}, and
+ * has the same bundle symbolic name and actions as this
+ * {@code BundlePermission} object; {@code false} otherwise.
*/
public boolean equals(Object obj) {
if (obj == this) {
@@ -393,8 +379,7 @@ public final class BundlePermission exte
BundlePermission bp = (BundlePermission) obj;
- return (getActionsMask() == bp.getActionsMask())
- && getName().equals(bp.getName());
+ return (getActionsMask() == bp.getActionsMask()) && getName().equals(bp.getName());
}
/**
@@ -409,12 +394,11 @@ public final class BundlePermission exte
}
/**
- * WriteObject is called to save the state of the
- * {@code BundlePermission} object to a stream. The actions are
- * serialized, and the superclass takes care of the name.
+ * WriteObject is called to save the state of the {@code BundlePermission}
+ * object to a stream. The actions are serialized, and the superclass takes
+ * care of the name.
*/
- private synchronized void writeObject(java.io.ObjectOutputStream s)
- throws IOException {
+ private synchronized void writeObject(java.io.ObjectOutputStream s) throws IOException {
// Write out the actions. The superclass takes care of the name
// call getActions to make sure actions field is initialized
if (actions == null)
@@ -426,8 +410,7 @@ public final class BundlePermission exte
* readObject is called to restore the state of the BundlePermission from a
* stream.
*/
- private synchronized void readObject(java.io.ObjectInputStream s)
- throws IOException, ClassNotFoundException {
+ private synchronized void readObject(java.io.ObjectInputStream s) throws IOException, ClassNotFoundException {
// Read in the action, then initialize the rest
s.defaultReadObject();
setTransients(parseActions(actions));
@@ -443,7 +426,7 @@ public final class BundlePermission exte
*/
final class BundlePermissionCollection extends PermissionCollection {
- private static final long serialVersionUID = 3258407326846433079L;
+ private static final long serialVersionUID = 3258407326846433079L;
/**
* Table of permissions.
@@ -458,7 +441,7 @@ final class BundlePermissionCollection e
* @serial
* @GuardedBy this
*/
- private boolean all_allowed;
+ private boolean all_allowed;
/**
* Create an empty BundlePermissions object.
@@ -480,12 +463,10 @@ final class BundlePermissionCollection e
*/
public void add(final Permission permission) {
if (!(permission instanceof BundlePermission)) {
- throw new IllegalArgumentException("invalid permission: "
- + permission);
+ throw new IllegalArgumentException("invalid permission: " + permission);
}
if (isReadOnly()) {
- throw new SecurityException("attempt to add a Permission to a "
- + "readonly PermissionCollection");
+ throw new SecurityException("attempt to add a Permission to a " + "readonly PermissionCollection");
}
final BundlePermission bp = (BundlePermission) permission;
final String name = bp.getName();
@@ -496,12 +477,10 @@ final class BundlePermissionCollection e
final int oldMask = existing.getActionsMask();
final int newMask = bp.getActionsMask();
if (oldMask != newMask) {
- pc.put(name, new BundlePermission(name, oldMask
- | newMask));
+ pc.put(name, new BundlePermission(name, oldMask | newMask));
}
- }
- else {
+ } else {
pc.put(name, bp);
}
@@ -518,8 +497,8 @@ final class BundlePermissionCollection e
*
* @param permission The Permission object to compare with this
* {@code BundlePermission} object.
- * @return {@code true} if {@code permission} is a proper subset
- * of a permission in the set; {@code false} otherwise.
+ * @return {@code true} if {@code permission} is a proper subset of a
+ * permission in the set; {@code false} otherwise.
*/
public boolean implies(final Permission permission) {
if (!(permission instanceof BundlePermission)) {
@@ -575,8 +554,8 @@ final class BundlePermissionCollection e
}
/**
- * Returns an enumeration of all {@code BundlePermission} objects in
- * the container.
+ * Returns an enumeration of all {@code BundlePermission} objects in the
+ * container.
*
* @return Enumeration of all {@code BundlePermission} objects.
*/
@@ -584,27 +563,21 @@ final class BundlePermissionCollection e
List<Permission> all = new ArrayList<Permission>(permissions.values());
return Collections.enumeration(all);
}
-
+
/* serialization logic */
- private static final ObjectStreamField[] serialPersistentFields = {
- new ObjectStreamField("permissions", Hashtable.class),
- new ObjectStreamField("all_allowed", Boolean.TYPE) };
-
- private synchronized void writeObject(ObjectOutputStream out)
- throws IOException {
- Hashtable<String, BundlePermission> hashtable = new Hashtable<String, BundlePermission>(
- permissions);
+ private static final ObjectStreamField[] serialPersistentFields = {new ObjectStreamField("permissions", Hashtable.class), new ObjectStreamField("all_allowed", Boolean.TYPE)};
+
+ private synchronized void writeObject(ObjectOutputStream out) throws IOException {
+ Hashtable<String, BundlePermission> hashtable = new Hashtable<String, BundlePermission>(permissions);
ObjectOutputStream.PutField pfields = out.putFields();
pfields.put("permissions", hashtable);
pfields.put("all_allowed", all_allowed);
out.writeFields();
}
- private synchronized void readObject(java.io.ObjectInputStream in)
- throws IOException, ClassNotFoundException {
+ private synchronized void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {
ObjectInputStream.GetField gfields = in.readFields();
- Hashtable<String, BundlePermission> hashtable = (Hashtable<String, BundlePermission>) gfields
- .get("permissions", null);
+ Hashtable<String, BundlePermission> hashtable = (Hashtable<String, BundlePermission>) gfields.get("permissions", null);
permissions = new HashMap<String, BundlePermission>(hashtable);
all_allowed = gfields.get("all_allowed", false);
}
Modified: felix/trunk/framework/src/main/java/org/osgi/framework/CapabilityPermission.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/osgi/framework/CapabilityPermission.java?rev=1337360&r1=1337359&r2=1337360&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/osgi/framework/CapabilityPermission.java (original)
+++ felix/trunk/framework/src/main/java/org/osgi/framework/CapabilityPermission.java Fri May 11 20:19:02 2012
@@ -1,5 +1,5 @@
/*
- * Copyright (c) OSGi Alliance (2000, 2011). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2000, 2012). All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -47,7 +47,7 @@ import java.util.Set;
* </ul>
*
* @ThreadSafe
- * @version $Id: bab1ac06b46613f6cff39b291295d8b3e51d58ce $
+ * @version $Id: b17bcaec959f67c3eae4c4c80c39a0a8716b22dc $
* @since 1.6
*/
@@ -64,8 +64,7 @@ public final class CapabilityPermission
private final static int ACTION_REQUIRE = 0x00000001;
private final static int ACTION_PROVIDE = 0x00000002;
- private final static int ACTION_ALL = ACTION_REQUIRE
- | ACTION_PROVIDE;
+ private final static int ACTION_ALL = ACTION_REQUIRE | ACTION_PROVIDE;
final static int ACTION_NONE = 0;
/**
@@ -133,7 +132,7 @@ public final class CapabilityPermission
* <li>location - The location of the bundle providing the capability.</li>
* <li>id - The bundle ID of the bundle providing the capability.</li>
* <li>name - The symbolic name of the bundle providing the capability.</li>
- * <li>capability.namespace - The name space of the required capability.</li>
+ * <li>capability.namespace - The namespace of the required capability.</li>
* </ul>
* Since the above attribute names may conflict with attribute names of a
* capability, you can prefix an attribute name with '@' in the filter
@@ -146,9 +145,9 @@ public final class CapabilityPermission
* {@code require} permission allows the owner of this permission to require
* a capability matching the attributes. The {@code provide} permission
* allows the bundle to provide a capability in the specified capability
- * name space.
+ * namespace.
*
- * @param name The capability name space or a filter over the attributes.
+ * @param name The capability namespace or a filter over the attributes.
* @param actions {@code require},{@code provide} (canonical order)
* @throws IllegalArgumentException If the specified name is a filter
* expression and either the specified action is not {@code require}
@@ -156,10 +155,8 @@ public final class CapabilityPermission
*/
public CapabilityPermission(String name, String actions) {
this(name, parseActions(actions));
- if ((this.filter != null)
- && ((action_mask & ACTION_ALL) != ACTION_REQUIRE)) {
- throw new IllegalArgumentException(
- "invalid action string for filter expression");
+ if ((this.filter != null) && ((action_mask & ACTION_ALL) != ACTION_REQUIRE)) {
+ throw new IllegalArgumentException("invalid action string for filter expression");
}
}
@@ -170,7 +167,7 @@ public final class CapabilityPermission
* constructor cannot be added to a {@code CapabilityPermission} permission
* collection.
*
- * @param namespace The requested capability name space.
+ * @param namespace The requested capability namespace.
* @param attributes The requested capability attributes.
* @param providingBundle The bundle providing the requested capability.
* @param actions The action {@code require}.
@@ -178,8 +175,7 @@ public final class CapabilityPermission
* {@code require} or attributes or providingBundle are {@code null}
* .
*/
- public CapabilityPermission(String namespace, Map<String, ? > attributes,
- Bundle providingBundle, String actions) {
+ public CapabilityPermission(String namespace, Map<String, ?> attributes, Bundle providingBundle, String actions) {
super(namespace);
setTransients(namespace, parseActions(actions));
if (attributes == null) {
@@ -246,9 +242,7 @@ public final class CapabilityPermission
char c;
// skip whitespace
- while ((i != -1)
- && ((c = a[i]) == ' ' || c == '\r' || c == '\n'
- || c == '\f' || c == '\t'))
+ while ((i != -1) && ((c = a[i]) == ' ' || c == '\r' || c == '\n' || c == '\f' || c == '\t'))
i--;
// check for the known strings
@@ -263,8 +257,7 @@ public final class CapabilityPermission
&& (a[i] == 'e' || a[i] == 'E')) {
matchlen = 7;
mask |= ACTION_REQUIRE;
- }
- else
+ } else
if (i >= 6 && (a[i - 6] == 'p' || a[i - 6] == 'P')
&& (a[i - 5] == 'r' || a[i - 5] == 'R')
&& (a[i - 4] == 'o' || a[i - 4] == 'O')
@@ -274,11 +267,9 @@ public final class CapabilityPermission
&& (a[i] == 'e' || a[i] == 'E')) {
matchlen = 7;
mask |= ACTION_PROVIDE;
- }
- else {
+ } else {
// parse error
- throw new IllegalArgumentException("invalid permission: "
- + actions);
+ throw new IllegalArgumentException("invalid permission: " + actions);
}
// make sure we didn't just match the tail of a word
@@ -296,8 +287,7 @@ public final class CapabilityPermission
case '\t' :
break;
default :
- throw new IllegalArgumentException(
- "invalid permission: " + actions);
+ throw new IllegalArgumentException("invalid permission: " + actions);
}
i--;
}
@@ -329,10 +319,8 @@ public final class CapabilityPermission
try {
return FrameworkUtil.createFilter(filterString);
- }
- catch (InvalidSyntaxException e) {
- IllegalArgumentException iae = new IllegalArgumentException(
- "invalid filter");
+ } catch (InvalidSyntaxException e) {
+ IllegalArgumentException iae = new IllegalArgumentException("invalid filter");
iae.initCause(e);
throw iae;
}
@@ -451,12 +439,8 @@ public final class CapabilityPermission
CapabilityPermission cp = (CapabilityPermission) obj;
- return (action_mask == cp.action_mask)
- && getName().equals(cp.getName())
- && ((attributes == cp.attributes) || ((attributes != null) && (attributes
- .equals(cp.attributes))))
- && ((bundle == cp.bundle) || ((bundle != null) && bundle
- .equals(cp.bundle)));
+ return (action_mask == cp.action_mask) && getName().equals(cp.getName()) && ((attributes == cp.attributes) || ((attributes != null) && (attributes.equals(cp.attributes))))
+ && ((bundle == cp.bundle) || ((bundle != null) && bundle.equals(cp.bundle)));
}
/**
@@ -480,8 +464,7 @@ public final class CapabilityPermission
* WriteObject is called to save the state of this permission to a stream.
* The actions are serialized, and the superclass takes care of the name.
*/
- private synchronized void writeObject(java.io.ObjectOutputStream s)
- throws IOException {
+ private synchronized void writeObject(java.io.ObjectOutputStream s) throws IOException {
if (bundle != null) {
throw new NotSerializableException("cannot serialize");
}
@@ -496,8 +479,7 @@ public final class CapabilityPermission
* readObject is called to restore the state of this permission from a
* stream.
*/
- private synchronized void readObject(java.io.ObjectInputStream s)
- throws IOException, ClassNotFoundException {
+ private synchronized void readObject(java.io.ObjectInputStream s) throws IOException, ClassNotFoundException {
// Read in the action, then initialize the rest
s.defaultReadObject();
setTransients(getName(), parseActions(actions));
@@ -543,8 +525,7 @@ public final class CapabilityPermission
private final Map<String, Object> attributes;
private transient volatile Set<Map.Entry<String, Object>> entries;
- Properties(Map<String, Object> properties,
- Map<String, Object> attributes) {
+ Properties(Map<String, Object> properties, Map<String, Object> attributes) {
this.properties = properties;
this.attributes = attributes;
entries = null;
@@ -569,8 +550,7 @@ public final class CapabilityPermission
if (entries != null) {
return entries;
}
- Set<Map.Entry<String, Object>> all = new HashSet<Map.Entry<String, Object>>(
- attributes.size() + properties.size());
+ Set<Map.Entry<String, Object>> all = new HashSet<Map.Entry<String, Object>>(attributes.size() + properties.size());
all.addAll(attributes.entrySet());
all.addAll(properties.entrySet());
return entries = Collections.unmodifiableSet(all);
@@ -631,18 +611,15 @@ final class CapabilityPermissionCollecti
*/
public void add(final Permission permission) {
if (!(permission instanceof CapabilityPermission)) {
- throw new IllegalArgumentException("invalid permission: "
- + permission);
+ throw new IllegalArgumentException("invalid permission: " + permission);
}
if (isReadOnly()) {
- throw new SecurityException("attempt to add a Permission to a "
- + "readonly PermissionCollection");
+ throw new SecurityException("attempt to add a Permission to a " + "readonly PermissionCollection");
}
final CapabilityPermission cp = (CapabilityPermission) permission;
if (cp.bundle != null) {
- throw new IllegalArgumentException("cannot add to collection: "
- + cp);
+ throw new IllegalArgumentException("cannot add to collection: " + cp);
}
final String name = cp.getName();
@@ -655,8 +632,7 @@ final class CapabilityPermissionCollecti
if (pc == null) {
filterPermissions = pc = new HashMap<String, CapabilityPermission>();
}
- }
- else {
+ } else {
pc = permissions;
}
final CapabilityPermission existing = pc.get(name);
@@ -665,11 +641,9 @@ final class CapabilityPermissionCollecti
final int oldMask = existing.action_mask;
final int newMask = cp.action_mask;
if (oldMask != newMask) {
- pc.put(name, new CapabilityPermission(name, oldMask
- | newMask));
+ pc.put(name, new CapabilityPermission(name, oldMask | newMask));
}
- }
- else {
+ } else {
pc.put(name, cp);
}
@@ -779,13 +753,10 @@ final class CapabilityPermissionCollecti
}
/* serialization logic */
- private static final ObjectStreamField[] serialPersistentFields = {
- new ObjectStreamField("permissions", HashMap.class),
- new ObjectStreamField("all_allowed", Boolean.TYPE),
+ private static final ObjectStreamField[] serialPersistentFields = {new ObjectStreamField("permissions", HashMap.class), new ObjectStreamField("all_allowed", Boolean.TYPE),
new ObjectStreamField("filterPermissions", HashMap.class) };
- private synchronized void writeObject(ObjectOutputStream out)
- throws IOException {
+ private synchronized void writeObject(ObjectOutputStream out) throws IOException {
ObjectOutputStream.PutField pfields = out.putFields();
pfields.put("permissions", permissions);
pfields.put("all_allowed", all_allowed);
@@ -793,15 +764,12 @@ final class CapabilityPermissionCollecti
out.writeFields();
}
- private synchronized void readObject(java.io.ObjectInputStream in)
- throws IOException, ClassNotFoundException {
+ private synchronized void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {
ObjectInputStream.GetField gfields = in.readFields();
- HashMap<String, CapabilityPermission> p = (HashMap<String, CapabilityPermission>) gfields
- .get("permissions", null);
+ HashMap<String, CapabilityPermission> p = (HashMap<String, CapabilityPermission>) gfields.get("permissions", null);
permissions = p;
all_allowed = gfields.get("all_allowed", false);
- HashMap<String, CapabilityPermission> fp = (HashMap<String, CapabilityPermission>) gfields
- .get("filterPermissions", null);
+ HashMap<String, CapabilityPermission> fp = (HashMap<String, CapabilityPermission>) gfields.get("filterPermissions", null);
filterPermissions = fp;
}
}
Modified: felix/trunk/framework/src/main/java/org/osgi/framework/Configurable.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/osgi/framework/Configurable.java?rev=1337360&r1=1337359&r2=1337360&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/osgi/framework/Configurable.java (original)
+++ felix/trunk/framework/src/main/java/org/osgi/framework/Configurable.java Fri May 11 20:19:02 2012
@@ -1,5 +1,5 @@
/*
- * Copyright (c) OSGi Alliance (2000, 2010). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2000, 2012). All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,7 +26,7 @@ package org.osgi.framework;
* {@code instanceof Configurable}.
*
* @deprecated As of 1.2. Please use Configuration Admin service.
- * @version $Id: 29705c0c238aa456cda1b1a13458079bf1542771 $
+ * @version $Id: 1018601ae90d2d16ec34136db4b04dca3ccf8e65 $
*/
public interface Configurable {
/**
@@ -42,9 +42,8 @@ public interface Configurable {
* returning the configuration object.
*
* @return The configuration object for this service.
- * @throws SecurityException If the caller does not have an
- * appropriate permission and the Java Runtime Environment supports
- * permissions.
+ * @throws SecurityException If the caller does not have an appropriate
+ * permission and the Java Runtime Environment supports permissions.
* @deprecated As of 1.2. Please use Configuration Admin service.
*/
public Object getConfigurationObject();
Modified: felix/trunk/framework/src/main/java/org/osgi/framework/Constants.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/osgi/framework/Constants.java?rev=1337360&r1=1337359&r2=1337360&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/osgi/framework/Constants.java (original)
+++ felix/trunk/framework/src/main/java/org/osgi/framework/Constants.java Fri May 11 20:19:02 2012
@@ -1,5 +1,5 @@
/*
- * Copyright (c) OSGi Alliance (2000, 2011). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2000, 2012). All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,6 +16,7 @@
package org.osgi.framework;
+import org.osgi.framework.hooks.bundle.CollisionHook;
import org.osgi.framework.launch.Framework;
/**
@@ -28,7 +29,7 @@ import org.osgi.framework.launch.Framewo
*
* @since 1.1
* @noimplement
- * @version $Id: 517c954ed7d34d2ee762933466f69fa03db7cd37 $
+ * @version $Id: 6d07a4c3e29a5cd93b3daf0f9fcdab5472b357f6 $
*/
public interface Constants {
@@ -1149,8 +1150,9 @@ public interface Constants {
/**
* Framework launching property specifying the trust repositories used by
* the framework. The value is a {@code java.io.File.pathSeparator}
- * separated list of valid file paths to files that contain key stores of
- * type {@code JKS}. The framework will use the key stores as trust
+ * separated list of valid file paths to files that contain key stores. Key
+ * stores of type {@code JKS} must be supported and other key store types
+ * may be supported. The framework will use the key stores as trust
* repositories to authenticate certificates of trusted signers. The key
* stores are only used as read-only trust repositories to access public
* keys. No passwords are required to access the key stores' public keys.
@@ -1276,9 +1278,9 @@ public interface Constants {
* persists across multiple Framework invocations.
*
* <p>
- * By convention, every bundle has its own unique name space, starting with
- * the bundle's identifier (see {@link Bundle#getBundleId}) and followed by
- * a dot (.). A bundle may use this as the prefix of the persistent
+ * By convention, every bundle has its own unique namespace, starting with
+ * the bundle's identifier (see {@link Bundle#getBundleId()}) and followed
+ * by a dot (.). A bundle may use this as the prefix of the persistent
* identifiers for the services it registers.
*/
String SERVICE_PID = "service.pid";
@@ -1293,9 +1295,10 @@ public interface Constants {
*
* <p>
* The service ranking is used by the Framework to determine the <i>natural
- * order</i> of services, see {@link ServiceReference#compareTo}, and the
- * <i>default</i> service to be returned from a call to the
- * {@link BundleContext#getServiceReference} method.
+ * order</i> of services, see {@link ServiceReference#compareTo(Object)},
+ * and the <i>default</i> service to be returned from a call to the
+ * {@link BundleContext#getServiceReference(Class)} or
+ * {@link BundleContext#getServiceReference(String)} method.
*
* <p>
* The default ranking is zero (0). A service with a ranking of
@@ -1434,11 +1437,11 @@ public interface Constants {
* Service property marking the service for export. It defines the
* interfaces under which this service can be exported. This list must be a
* subset of the types under which the service was registered. The single
- * value of an asterisk ("*", \u002A) indicates all the
- * interface types under which the service was registered excluding the
- * non-interface types. It is strongly recommended to only export interface
- * types and not concrete classes due to the complexity of creating proxies
- * for some type of concrete classes.
+ * value of an asterisk ({@code '*'} \u002A) indicates all the interface
+ * types under which the service was registered excluding the non-interface
+ * types. It is strongly recommended to only export interface types and not
+ * concrete classes due to the complexity of creating proxies for some type
+ * of concrete classes.
*
* <p>
* This property may be supplied in the {@code properties}
@@ -1645,12 +1648,11 @@ public interface Constants {
* {@link #BUNDLE_VERSION version} may be installed.
*
* <p>
- * Default value is {@link #FRAMEWORK_BSNVERSION_SINGLE single} in this
- * release of the specification. This default may change to
- * {@link #FRAMEWORK_BSNVERSION_MULTIPLE multiple} in a future specification
- * release. Therefore, code must not assume the default behavior is
- * {@code single} and should interrogate the value of this property to
- * determine the behavior.
+ * Default value is {@link #FRAMEWORK_BSNVERSION_MANAGED managed} in this
+ * release of the specification. This default may change in a future
+ * specification release. Therefore, code must not assume the default
+ * behavior is {@code managed} and should interrogate the value of this
+ * property to determine the behavior.
*
* <p>
* The value of this property may be retrieved by calling the
@@ -1658,6 +1660,7 @@ public interface Constants {
*
* @see #FRAMEWORK_BSNVERSION_MULTIPLE
* @see #FRAMEWORK_BSNVERSION_SINGLE
+ * @see #FRAMEWORK_BSNVERSION_MANAGED
* @since 1.6
*/
String FRAMEWORK_BSNVERSION = "org.osgi.framework.bsnversion";
@@ -1679,6 +1682,22 @@ public interface Constants {
*
* @since 1.6
* @see #FRAMEWORK_BSNVERSION
+ * @see BundleException#DUPLICATE_BUNDLE_ERROR
*/
String FRAMEWORK_BSNVERSION_SINGLE = "single";
+
+ /**
+ * Specifies the framework must consult the {@link CollisionHook bundle
+ * collision hook} services to determine if it will be an error to install a
+ * bundle or update a bundle to have the same symbolic name and version as
+ * another installed bundle. If no bundle collision hook services are
+ * registered, then it will be an error to install a bundle or update a
+ * bundle to have the same symbolic name and version as another installed
+ * bundle.
+ *
+ * @since 1.7
+ * @see #FRAMEWORK_BSNVERSION
+ * @see BundleException#DUPLICATE_BUNDLE_ERROR
+ */
+ String FRAMEWORK_BSNVERSION_MANAGED = "managed";
}
Modified: felix/trunk/framework/src/main/java/org/osgi/framework/Filter.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/osgi/framework/Filter.java?rev=1337360&r1=1337359&r2=1337360&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/osgi/framework/Filter.java (original)
+++ felix/trunk/framework/src/main/java/org/osgi/framework/Filter.java Fri May 11 20:19:02 2012
@@ -1,5 +1,5 @@
/*
- * Copyright (c) OSGi Alliance (2000, 2010). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2000, 2012). All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
package org.osgi.framework;
import java.util.Dictionary;
@@ -21,8 +22,9 @@ import java.util.Map;
/**
* An <a href="http://www.ietf.org/rfc/rfc1960.txt">RFC 1960</a>-based Filter.
* <p>
- * {@code Filter}s can be created by calling {@link BundleContext#createFilter}
- * or {@link FrameworkUtil#createFilter} with a filter string.
+ * {@code Filter}s can be created by calling
+ * {@link BundleContext#createFilter(String)} or
+ * {@link FrameworkUtil#createFilter(String)} with a filter string.
* <p>
* A {@code Filter} can be used numerous times to determine if the match
* argument matches the filter string that was used to create the {@code Filter}.
@@ -40,7 +42,7 @@ import java.util.Map;
* @see "Core Specification, Filters, for a description of the filter string syntax."
* @ThreadSafe
* @noimplement
- * @version $Id: 4d21267f4b85d1912d73f7e2c049cc968c4237f9 $
+ * @version $Id: 807a04ac07c3230b8f4d4e0f9588a35fbdc41e18 $
*/
public interface Filter {
/**
@@ -55,7 +57,7 @@ public interface Filter {
* @return {@code true} if the service's properties match this
* {@code Filter}; {@code false} otherwise.
*/
- boolean match(ServiceReference< ? > reference);
+ boolean match(ServiceReference<?> reference);
/**
* Filter using a {@code Dictionary} with case insensitive key lookup. This
@@ -69,7 +71,7 @@ public interface Filter {
* @throws IllegalArgumentException If {@code dictionary} contains case
* variants of the same key name.
*/
- boolean match(Dictionary<String, ? > dictionary);
+ boolean match(Dictionary<String, ?> dictionary);
/**
* Returns this {@code Filter}'s filter string.
@@ -89,9 +91,8 @@ public interface Filter {
* {@code this.toString().equals(obj.toString())}.
*
* @param obj The object to compare against this {@code Filter}.
- * @return If the other object is a {@code Filter} object, then returns
- * the result of calling
- * {@code this.toString().equals(obj.toString())};
+ * @return If the other object is a {@code Filter} object, then returns the
+ * result of calling {@code this.toString().equals(obj.toString())};
* {@code false} otherwise.
*/
boolean equals(Object obj);
@@ -118,7 +119,7 @@ public interface Filter {
* filter; {@code false} otherwise.
* @since 1.3
*/
- boolean matchCase(Dictionary<String, ? > dictionary);
+ boolean matchCase(Dictionary<String, ?> dictionary);
/**
* Filter using a {@code Map}. This {@code Filter} is executed using the
@@ -132,5 +133,5 @@ public interface Filter {
* {@code false} otherwise.
* @since 1.6
*/
- boolean matches(Map<String, ? > map);
+ boolean matches(Map<String, ?> map);
}
Modified: felix/trunk/framework/src/main/java/org/osgi/framework/FrameworkEvent.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/osgi/framework/FrameworkEvent.java?rev=1337360&r1=1337359&r2=1337360&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/osgi/framework/FrameworkEvent.java (original)
+++ felix/trunk/framework/src/main/java/org/osgi/framework/FrameworkEvent.java Fri May 11 20:19:02 2012
@@ -1,5 +1,5 @@
/*
- * Copyright (c) OSGi Alliance (2004, 2010). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2004, 2012). All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,7 +17,6 @@
package org.osgi.framework;
import java.util.EventObject;
-
import org.osgi.framework.startlevel.FrameworkStartLevel;
import org.osgi.framework.wiring.FrameworkWiring;
@@ -25,17 +24,16 @@ import org.osgi.framework.wiring.Framewo
* A general event from the Framework.
*
* <p>
- * {@code FrameworkEvent} objects are delivered to
- * {@code FrameworkListener}s when a general event occurs within the OSGi
- * environment. A type code is used to identify the event type for future
- * extendability.
+ * {@code FrameworkEvent} objects are delivered to {@code FrameworkListener}s
+ * when a general event occurs within the OSGi environment. A type code is used
+ * to identify the event type for future extendability.
*
* <p>
* OSGi Alliance reserves the right to extend the set of event types.
*
* @Immutable
* @see FrameworkListener
- * @version $Id: e05c6ffd542fa432835961882bf6b15b0620ffb6 $
+ * @version $Id: f679c7581879a2e6006ecdd317a5dd5f735764e3 $
*/
public class FrameworkEvent extends EventObject {
@@ -191,8 +189,8 @@ public class FrameworkEvent extends Even
*
* @param type The event type.
* @param bundle The event source.
- * @param throwable The related exception. This argument may be
- * {@code null} if there is no related exception.
+ * @param throwable The related exception. This argument may be {@code null}
+ * if there is no related exception.
*/
public FrameworkEvent(int type, Bundle bundle, Throwable throwable) {
super(bundle);
Modified: felix/trunk/framework/src/main/java/org/osgi/framework/FrameworkListener.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/osgi/framework/FrameworkListener.java?rev=1337360&r1=1337359&r2=1337360&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/osgi/framework/FrameworkListener.java (original)
+++ felix/trunk/framework/src/main/java/org/osgi/framework/FrameworkListener.java Fri May 11 20:19:02 2012
@@ -1,5 +1,5 @@
/*
- * Copyright (c) OSGi Alliance (2000, 2010). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2000, 2011). All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,23 +19,22 @@ package org.osgi.framework;
import java.util.EventListener;
/**
- * A {@code FrameworkEvent} listener. {@code FrameworkListener} is
- * a listener interface that may be implemented by a bundle developer. When a
+ * A {@code FrameworkEvent} listener. {@code FrameworkListener} is a listener
+ * interface that may be implemented by a bundle developer. When a
* {@code FrameworkEvent} is fired, it is asynchronously delivered to a
- * {@code FrameworkListener}. The Framework delivers
- * {@code FrameworkEvent} objects to a {@code FrameworkListener}
- * in order and must not concurrently call a {@code FrameworkListener}.
+ * {@code FrameworkListener}. The Framework delivers {@code FrameworkEvent}
+ * objects to a {@code FrameworkListener} in order and must not concurrently
+ * call a {@code FrameworkListener}.
*
* <p>
- * A {@code FrameworkListener} object is registered with the Framework
- * using the {@link BundleContext#addFrameworkListener} method.
- * {@code FrameworkListener} objects are called with a
- * {@code FrameworkEvent} objects when the Framework starts and when
- * asynchronous errors occur.
+ * A {@code FrameworkListener} object is registered with the Framework using the
+ * {@link BundleContext#addFrameworkListener(FrameworkListener)} method.
+ * {@code FrameworkListener} objects are called with a {@code FrameworkEvent}
+ * objects when the Framework starts and when asynchronous errors occur.
*
* @see FrameworkEvent
* @NotThreadSafe
- * @version $Id: a32e7599ea09d3510759d77e824cb8d9eff67f9d $
+ * @version $Id: ad7f563bd13b60e2b8a378f147057ca7f0accae2 $
*/
public interface FrameworkListener extends EventListener {