Package org.apache.felix.scr.impl.inject
Class ClassUtils
- java.lang.Object
-
- org.apache.felix.scr.impl.inject.ClassUtils
-
public class ClassUtils extends java.lang.ObjectUtility methods for class handling used by method and field references.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.Class<?>BUNDLE_CONTEXT_CLASSstatic java.lang.Class<?>COLLECTION_CLASSstatic java.lang.Class<?>COMPONENT_CONTEXT_CLASSstatic java.lang.Class<?>COMPONENTS_SERVICE_OBJECTS_CLASSstatic java.lang.StringFORMATTER_LOGGER_CLASSstatic java.lang.Class<?>INTEGER_CLASSstatic java.lang.Class<?>LIST_CLASSstatic java.lang.StringLOGGER_CLASSstatic java.lang.StringLOGGER_FACTORY_CLASSprivate static org.osgi.framework.BundleContextm_contextstatic org.osgi.util.tracker.ServiceTracker<?,?>m_packageAdminstatic java.lang.Class<?>MAP_CLASSstatic java.lang.Class<?>MAP_ENTRY_CLASSprivate static java.lang.Class<?>OBJECT_CLASSprivate static java.lang.StringPACKAGEADMIN_CLASSstatic java.lang.Class<?>SERVICE_REFERENCE_CLASS
-
Constructor Summary
Constructors Constructor Description ClassUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidclose()static java.lang.Class<?>getClassFromComponentClassLoader(java.lang.Class<?> componentClass, java.lang.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 java.lang.ObjectgetPackageAdmin()static java.lang.StringgetPackageName(java.lang.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 voidsetBundleContext(org.osgi.framework.BundleContext bundleContext)
-
-
-
Field Detail
-
PACKAGEADMIN_CLASS
private static final java.lang.String PACKAGEADMIN_CLASS
- See Also:
- Constant Field Values
-
OBJECT_CLASS
private static final java.lang.Class<?> OBJECT_CLASS
-
SERVICE_REFERENCE_CLASS
public static final java.lang.Class<?> SERVICE_REFERENCE_CLASS
-
COMPONENTS_SERVICE_OBJECTS_CLASS
public static final java.lang.Class<?> COMPONENTS_SERVICE_OBJECTS_CLASS
-
MAP_CLASS
public static final java.lang.Class<?> MAP_CLASS
-
MAP_ENTRY_CLASS
public static final java.lang.Class<?> MAP_ENTRY_CLASS
-
COLLECTION_CLASS
public static final java.lang.Class<?> COLLECTION_CLASS
-
LIST_CLASS
public static final java.lang.Class<?> LIST_CLASS
-
COMPONENT_CONTEXT_CLASS
public static final java.lang.Class<?> COMPONENT_CONTEXT_CLASS
-
BUNDLE_CONTEXT_CLASS
public static final java.lang.Class<?> BUNDLE_CONTEXT_CLASS
-
INTEGER_CLASS
public static final java.lang.Class<?> INTEGER_CLASS
-
LOGGER_CLASS
public static final java.lang.String LOGGER_CLASS
- See Also:
- Constant Field Values
-
FORMATTER_LOGGER_CLASS
public static final java.lang.String FORMATTER_LOGGER_CLASS
- See Also:
- Constant Field Values
-
LOGGER_FACTORY_CLASS
public static final java.lang.String LOGGER_FACTORY_CLASS
- See Also:
- Constant Field Values
-
m_context
private static org.osgi.framework.BundleContext m_context
-
m_packageAdmin
public static volatile org.osgi.util.tracker.ServiceTracker<?,?> m_packageAdmin
-
-
Method Detail
-
getClassFromComponentClassLoader
public static java.lang.Class<?> getClassFromComponentClassLoader(java.lang.Class<?> componentClass, java.lang.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
nullif the class loader of thetargetClasscannot see that class.
-
setBundleContext
public static void setBundleContext(org.osgi.framework.BundleContext bundleContext)
-
getPackageAdmin
public static java.lang.Object getPackageAdmin()
-
close
public static void close()
-
getPackageName
public static java.lang.String getPackageName(java.lang.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.
-
-