Package org.nuxeo.osgi
Class BundleImpl
- java.lang.Object
-
- org.nuxeo.osgi.BundleImpl
-
- All Implemented Interfaces:
org.osgi.framework.Bundle
- Direct Known Subclasses:
RootRuntimeBundle,SystemBundle
public class BundleImpl extends Object implements org.osgi.framework.Bundle
- Author:
- Bogdan Stefanescu
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classBundleImpl.CompoundEnumerationBuilder
-
Field Summary
Fields Modifier and Type Field Description protected org.osgi.framework.BundleActivatoractivatorprotected booleanallowHostOverrideprotected org.osgi.framework.BundleContextcontextprotected BundleFilefileprotected Dictionary<String,String>headersprotected longidprotected longlastModifiedprotected ClassLoaderloaderprotected Stringlocationprotected OSGiAdapterosgiprotected doublestartupTimeprotected intstateprotected StringsymbolicName
-
Constructor Summary
Constructors Constructor Description BundleImpl(OSGiAdapter osgi, BundleFile file, ClassLoader loader)BundleImpl(OSGiAdapter osgi, BundleFile file, ClassLoader loader, boolean isSystemBundle)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.osgi.framework.BundleContextcreateContext()booleanequals(Object obj)Enumeration<URL>findEntries(String path, String filePattern, boolean recurse)org.osgi.framework.BundleActivatorgetActivator()protected StringgetActivatorClassName()org.osgi.framework.BundleContextgetBundleContext()BundleFilegetBundleFile()longgetBundleId()URLgetEntry(String name)Enumeration<String>getEntryPaths(String path)Dictionary<String,String>getHeaders()Dictionary<String,String>getHeaders(String locale)longgetLastModified()StringgetLocation()static org.osgi.service.packageadmin.PackageAdmingetPackageAdmin()org.osgi.framework.ServiceReference[]getRegisteredServices()URLgetResource(String name)Enumeration<URL>getResources(String name)org.osgi.framework.ServiceReference[]getServicesInUse()MapgetSignerCertificates(int signersType)doublegetStartupTime()intgetState()StringgetSymbolicName()org.osgi.framework.VersiongetVersion()inthashCode()booleanhasPermission(Object permission)Class<?>loadClass(String name)voidshutdown()voidstart()voidstart(int options)voidstop()voidstop(int options)StringtoString()voiduninstall()voidupdate()voidupdate(InputStream in)
-
-
-
Field Detail
-
id
protected final long id
-
symbolicName
protected final String symbolicName
-
headers
protected final Dictionary<String,String> headers
-
context
protected final org.osgi.framework.BundleContext context
-
osgi
protected final OSGiAdapter osgi
-
file
protected final BundleFile file
-
loader
protected final ClassLoader loader
-
state
protected int state
-
lastModified
protected long lastModified
-
activator
protected org.osgi.framework.BundleActivator activator
-
startupTime
protected double startupTime
-
allowHostOverride
protected boolean allowHostOverride
-
-
Constructor Detail
-
BundleImpl
public BundleImpl(OSGiAdapter osgi, BundleFile file, ClassLoader loader) throws org.osgi.framework.BundleException
- Throws:
org.osgi.framework.BundleException
-
BundleImpl
public BundleImpl(OSGiAdapter osgi, BundleFile file, ClassLoader loader, boolean isSystemBundle) throws org.osgi.framework.BundleException
- Throws:
org.osgi.framework.BundleException
-
-
Method Detail
-
getBundleFile
public BundleFile getBundleFile()
-
createContext
protected final org.osgi.framework.BundleContext createContext()
-
getBundleContext
public org.osgi.framework.BundleContext getBundleContext()
- Specified by:
getBundleContextin interfaceorg.osgi.framework.Bundle
-
start
public void start(int options) throws org.osgi.framework.BundleException
- Specified by:
startin interfaceorg.osgi.framework.Bundle- Throws:
org.osgi.framework.BundleException
-
stop
public void stop(int options) throws org.osgi.framework.BundleException
- Specified by:
stopin interfaceorg.osgi.framework.Bundle- Throws:
org.osgi.framework.BundleException
-
getLocation
public String getLocation()
- Specified by:
getLocationin interfaceorg.osgi.framework.Bundle
-
getResource
public URL getResource(String name)
- Specified by:
getResourcein interfaceorg.osgi.framework.Bundle
-
getResources
public Enumeration<URL> getResources(String name) throws IOException
- Specified by:
getResourcesin interfaceorg.osgi.framework.Bundle- Throws:
IOException
-
loadClass
public Class<?> loadClass(String name) throws ClassNotFoundException
- Specified by:
loadClassin interfaceorg.osgi.framework.Bundle- Throws:
ClassNotFoundException
-
getEntry
public URL getEntry(String name)
- Specified by:
getEntryin interfaceorg.osgi.framework.Bundle
-
getPackageAdmin
public static org.osgi.service.packageadmin.PackageAdmin getPackageAdmin()
-
findEntries
public Enumeration<URL> findEntries(String path, String filePattern, boolean recurse)
- Specified by:
findEntriesin interfaceorg.osgi.framework.Bundle
-
getEntryPaths
public Enumeration<String> getEntryPaths(String path)
- Specified by:
getEntryPathsin interfaceorg.osgi.framework.Bundle
-
getBundleId
public long getBundleId()
- Specified by:
getBundleIdin interfaceorg.osgi.framework.Bundle
-
getHeaders
public Dictionary<String,String> getHeaders()
- Specified by:
getHeadersin interfaceorg.osgi.framework.Bundle
-
getHeaders
public Dictionary<String,String> getHeaders(String locale)
- Specified by:
getHeadersin interfaceorg.osgi.framework.Bundle
-
getLastModified
public long getLastModified()
- Specified by:
getLastModifiedin interfaceorg.osgi.framework.Bundle
-
getRegisteredServices
public org.osgi.framework.ServiceReference[] getRegisteredServices()
- Specified by:
getRegisteredServicesin interfaceorg.osgi.framework.Bundle
-
getServicesInUse
public org.osgi.framework.ServiceReference[] getServicesInUse()
- Specified by:
getServicesInUsein interfaceorg.osgi.framework.Bundle
-
getState
public int getState()
- Specified by:
getStatein interfaceorg.osgi.framework.Bundle
-
getSymbolicName
public String getSymbolicName()
- Specified by:
getSymbolicNamein interfaceorg.osgi.framework.Bundle
-
hasPermission
public boolean hasPermission(Object permission)
- Specified by:
hasPermissionin interfaceorg.osgi.framework.Bundle
-
getActivatorClassName
protected String getActivatorClassName()
-
getActivator
public org.osgi.framework.BundleActivator getActivator() throws org.osgi.framework.BundleException
- Throws:
org.osgi.framework.BundleException
-
start
public void start() throws org.osgi.framework.BundleException
- Specified by:
startin interfaceorg.osgi.framework.Bundle- Throws:
org.osgi.framework.BundleException
-
stop
public void stop() throws org.osgi.framework.BundleException
- Specified by:
stopin interfaceorg.osgi.framework.Bundle- Throws:
org.osgi.framework.BundleException
-
shutdown
public void shutdown() throws org.osgi.framework.BundleException
- Throws:
org.osgi.framework.BundleException
-
uninstall
public void uninstall() throws org.osgi.framework.BundleException
- Specified by:
uninstallin interfaceorg.osgi.framework.Bundle- Throws:
org.osgi.framework.BundleException
-
update
public void update() throws org.osgi.framework.BundleException
- Specified by:
updatein interfaceorg.osgi.framework.Bundle- Throws:
org.osgi.framework.BundleException
-
update
public void update(InputStream in) throws org.osgi.framework.BundleException
- Specified by:
updatein interfaceorg.osgi.framework.Bundle- Throws:
org.osgi.framework.BundleException
-
getStartupTime
public double getStartupTime()
-
getSignerCertificates
public Map getSignerCertificates(int signersType)
- Specified by:
getSignerCertificatesin interfaceorg.osgi.framework.Bundle
-
getVersion
public org.osgi.framework.Version getVersion()
- Specified by:
getVersionin interfaceorg.osgi.framework.Bundle
-
-