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 class
BundleImpl.CompoundEnumerationBuilder
-
Field Summary
Fields Modifier and Type Field Description protected org.osgi.framework.BundleActivator
activator
protected boolean
allowHostOverride
protected org.osgi.framework.BundleContext
context
protected BundleFile
file
protected Dictionary<String,String>
headers
protected long
id
protected long
lastModified
protected ClassLoader
loader
protected String
location
protected OSGiAdapter
osgi
protected double
startupTime
protected int
state
protected String
symbolicName
-
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.BundleContext
createContext()
boolean
equals(Object obj)
Enumeration<URL>
findEntries(String path, String filePattern, boolean recurse)
org.osgi.framework.BundleActivator
getActivator()
protected String
getActivatorClassName()
org.osgi.framework.BundleContext
getBundleContext()
BundleFile
getBundleFile()
long
getBundleId()
URL
getEntry(String name)
Enumeration<String>
getEntryPaths(String path)
Dictionary<String,String>
getHeaders()
Dictionary<String,String>
getHeaders(String locale)
long
getLastModified()
String
getLocation()
static org.osgi.service.packageadmin.PackageAdmin
getPackageAdmin()
org.osgi.framework.ServiceReference[]
getRegisteredServices()
URL
getResource(String name)
Enumeration<URL>
getResources(String name)
org.osgi.framework.ServiceReference[]
getServicesInUse()
Map
getSignerCertificates(int signersType)
double
getStartupTime()
int
getState()
String
getSymbolicName()
org.osgi.framework.Version
getVersion()
int
hashCode()
boolean
hasPermission(Object permission)
Class<?>
loadClass(String name)
void
shutdown()
void
start()
void
start(int options)
void
stop()
void
stop(int options)
String
toString()
void
uninstall()
void
update()
void
update(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
-
location
protected final String location
-
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:
getBundleContext
in interfaceorg.osgi.framework.Bundle
-
start
public void start(int options) throws org.osgi.framework.BundleException
- Specified by:
start
in interfaceorg.osgi.framework.Bundle
- Throws:
org.osgi.framework.BundleException
-
stop
public void stop(int options) throws org.osgi.framework.BundleException
- Specified by:
stop
in interfaceorg.osgi.framework.Bundle
- Throws:
org.osgi.framework.BundleException
-
getLocation
public String getLocation()
- Specified by:
getLocation
in interfaceorg.osgi.framework.Bundle
-
getResource
public URL getResource(String name)
- Specified by:
getResource
in interfaceorg.osgi.framework.Bundle
-
getResources
public Enumeration<URL> getResources(String name) throws IOException
- Specified by:
getResources
in interfaceorg.osgi.framework.Bundle
- Throws:
IOException
-
loadClass
public Class<?> loadClass(String name) throws ClassNotFoundException
- Specified by:
loadClass
in interfaceorg.osgi.framework.Bundle
- Throws:
ClassNotFoundException
-
getEntry
public URL getEntry(String name)
- Specified by:
getEntry
in 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:
findEntries
in interfaceorg.osgi.framework.Bundle
-
getEntryPaths
public Enumeration<String> getEntryPaths(String path)
- Specified by:
getEntryPaths
in interfaceorg.osgi.framework.Bundle
-
getBundleId
public long getBundleId()
- Specified by:
getBundleId
in interfaceorg.osgi.framework.Bundle
-
getHeaders
public Dictionary<String,String> getHeaders()
- Specified by:
getHeaders
in interfaceorg.osgi.framework.Bundle
-
getHeaders
public Dictionary<String,String> getHeaders(String locale)
- Specified by:
getHeaders
in interfaceorg.osgi.framework.Bundle
-
getLastModified
public long getLastModified()
- Specified by:
getLastModified
in interfaceorg.osgi.framework.Bundle
-
getRegisteredServices
public org.osgi.framework.ServiceReference[] getRegisteredServices()
- Specified by:
getRegisteredServices
in interfaceorg.osgi.framework.Bundle
-
getServicesInUse
public org.osgi.framework.ServiceReference[] getServicesInUse()
- Specified by:
getServicesInUse
in interfaceorg.osgi.framework.Bundle
-
getState
public int getState()
- Specified by:
getState
in interfaceorg.osgi.framework.Bundle
-
getSymbolicName
public String getSymbolicName()
- Specified by:
getSymbolicName
in interfaceorg.osgi.framework.Bundle
-
hasPermission
public boolean hasPermission(Object permission)
- Specified by:
hasPermission
in 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:
start
in interfaceorg.osgi.framework.Bundle
- Throws:
org.osgi.framework.BundleException
-
stop
public void stop() throws org.osgi.framework.BundleException
- Specified by:
stop
in 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:
uninstall
in interfaceorg.osgi.framework.Bundle
- Throws:
org.osgi.framework.BundleException
-
update
public void update() throws org.osgi.framework.BundleException
- Specified by:
update
in interfaceorg.osgi.framework.Bundle
- Throws:
org.osgi.framework.BundleException
-
update
public void update(InputStream in) throws org.osgi.framework.BundleException
- Specified by:
update
in interfaceorg.osgi.framework.Bundle
- Throws:
org.osgi.framework.BundleException
-
getStartupTime
public double getStartupTime()
-
getSignerCertificates
public Map getSignerCertificates(int signersType)
- Specified by:
getSignerCertificates
in interfaceorg.osgi.framework.Bundle
-
getVersion
public org.osgi.framework.Version getVersion()
- Specified by:
getVersion
in interfaceorg.osgi.framework.Bundle
-
-