Class ClassUtils
java.lang.Object
org.apache.felix.scr.impl.inject.internal.ClassUtils
Utility methods for class handling used by method and field references.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Class
<?> static final Class
<?> static final Class
<?> static final Class
<?> static final String
static final Class
<?> static final Class
<?> static final String
static final String
static org.osgi.util.tracker.ServiceTracker
<?, ?> static final Class
<?> static final Class
<?> static final Class
<?> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
close()
static Class
<?> getClassFromComponentClassLoader
(Class<?> componentClass, String className, ComponentLogger logger) Returns the class object representing the class of the field reference The class loader of the component class is used to load the service class.static Object
static String
getPackageName
(Class<?> clazz) Returns the name of the package to which the class belongs or an empty string if the class is in the default package.static void
setBundleContext
(org.osgi.framework.BundleContext bundleContext)
-
Field Details
-
SERVICE_REFERENCE_CLASS
-
COMPONENTS_SERVICE_OBJECTS_CLASS
-
MAP_CLASS
-
MAP_ENTRY_CLASS
-
COLLECTION_CLASS
-
LIST_CLASS
-
COMPONENT_CONTEXT_CLASS
-
BUNDLE_CONTEXT_CLASS
-
INTEGER_CLASS
-
LOGGER_CLASS
- See Also:
-
FORMATTER_LOGGER_CLASS
- See Also:
-
LOGGER_FACTORY_CLASS
- See Also:
-
m_packageAdmin
public static volatile org.osgi.util.tracker.ServiceTracker<?,?> m_packageAdmin
-
-
Constructor Details
-
ClassUtils
public ClassUtils()
-
-
Method Details
-
getClassFromComponentClassLoader
public static Class<?> getClassFromComponentClassLoader(Class<?> componentClass, String className, ComponentLogger logger) Returns the class object representing the class of the field reference The class loader of the component class is used to load the service class.It may well be possible, that the class loader of the target class cannot see the service object class, for example if the service reference is inherited from a component class of another bundle.
- Returns:
- The class object for the referred to service or
null
if the class loader of thetargetClass
cannot see that class.
-
setBundleContext
public static void setBundleContext(org.osgi.framework.BundleContext bundleContext) -
getPackageAdmin
-
close
public static void close() -
getPackageName
Returns the name of the package to which the class belongs or an empty string if the class is in the default package.
-