|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.eclipse.gemini.blueprint.mock.MockBundle
public class MockBundle
Bundle mock. Except resource/class loading operations (which are executed on its internal class loader), the rest of the methods are dummies.
| Field Summary |
|---|
| Fields inherited from interface org.osgi.framework.Bundle |
|---|
ACTIVE, INSTALLED, RESOLVED, SIGNERS_ALL, SIGNERS_TRUSTED, START_ACTIVATION_POLICY, START_TRANSIENT, STARTING, STOP_TRANSIENT, STOPPING, UNINSTALLED |
| Constructor Summary | |
|---|---|
MockBundle()
Constructs a new MockBundle instance using default values. |
|
MockBundle(org.osgi.framework.BundleContext context)
Constructs a new MockBundle instance associated with the given bundle context. |
|
MockBundle(Dictionary headers)
Constructs a new MockBundle instance with the given bundle headers. |
|
MockBundle(String symName)
Constructs a new MockBundle instance with the given symbolic name. |
|
MockBundle(String symName,
Dictionary headers,
org.osgi.framework.BundleContext context)
Constructs a new MockBundle instance using the given bundle symbolic name, properties and associated
bundle context. |
|
| Method Summary | |
|---|---|
Enumeration |
findEntries(String path,
String filePattern,
boolean recurse)
Delegates to the classloader. |
org.osgi.framework.BundleContext |
getBundleContext()
|
long |
getBundleId()
|
org.osgi.framework.BundleContext |
getContext()
|
URL |
getEntry(String name)
|
Enumeration |
getEntryPaths(String path)
|
Dictionary |
getHeaders()
|
Dictionary |
getHeaders(String locale)
|
long |
getLastModified()
|
String |
getLocation()
|
org.osgi.framework.ServiceReference[] |
getRegisteredServices()
|
URL |
getResource(String name)
|
Enumeration |
getResources(String name)
|
org.osgi.framework.ServiceReference[] |
getServicesInUse()
|
Map |
getSignerCertificates(int signerType)
|
int |
getState()
|
String |
getSymbolicName()
|
org.osgi.framework.Version |
getVersion()
|
boolean |
hasPermission(Object permission)
|
Class<?> |
loadClass(String name)
|
void |
setBundleId(long bundleId)
|
void |
setClassLoader(ClassLoader loader)
Sets the class loader internally used by the bundle to mock the loading operations. |
void |
setLocation(String location)
Sets the location for this mock bundle. |
void |
start()
|
void |
start(int options)
|
void |
stop()
|
void |
stop(int options)
|
String |
toString()
|
void |
uninstall()
|
void |
update()
|
void |
update(InputStream in)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MockBundle()
MockBundle instance using default values.
public MockBundle(Dictionary headers)
MockBundle instance with the given bundle headers.
headers - bundle headerspublic MockBundle(org.osgi.framework.BundleContext context)
MockBundle instance associated with the given bundle context.
context - associated bundle contextpublic MockBundle(String symName)
MockBundle instance with the given symbolic name.
symName - bundle symbolic name
public MockBundle(String symName,
Dictionary headers,
org.osgi.framework.BundleContext context)
MockBundle instance using the given bundle symbolic name, properties and associated
bundle context.
symName - bundle symbolic nameheaders - bundle headerscontext - associated bundle context| Method Detail |
|---|
public Enumeration findEntries(String path,
String filePattern,
boolean recurse)
findEntries in interface org.osgi.framework.BundleBundle.findEntries(java.lang.String, java.lang.String, boolean)public long getBundleId()
getBundleId in interface org.osgi.framework.Bundlepublic void setBundleId(long bundleId)
public URL getEntry(String name)
getEntry in interface org.osgi.framework.Bundlepublic Enumeration getEntryPaths(String path)
getEntryPaths in interface org.osgi.framework.Bundlepublic Dictionary getHeaders()
getHeaders in interface org.osgi.framework.Bundlepublic Dictionary getHeaders(String locale)
getHeaders in interface org.osgi.framework.Bundlepublic long getLastModified()
getLastModified in interface org.osgi.framework.Bundlepublic String getLocation()
getLocation in interface org.osgi.framework.Bundlepublic org.osgi.framework.ServiceReference[] getRegisteredServices()
getRegisteredServices in interface org.osgi.framework.Bundlepublic URL getResource(String name)
getResource in interface org.osgi.framework.Bundle
public Enumeration getResources(String name)
throws IOException
getResources in interface org.osgi.framework.BundleIOExceptionpublic org.osgi.framework.ServiceReference[] getServicesInUse()
getServicesInUse in interface org.osgi.framework.Bundlepublic int getState()
getState in interface org.osgi.framework.Bundlepublic String getSymbolicName()
getSymbolicName in interface org.osgi.framework.Bundlepublic boolean hasPermission(Object permission)
hasPermission in interface org.osgi.framework.Bundle
public Class<?> loadClass(String name)
throws ClassNotFoundException
loadClass in interface org.osgi.framework.BundleClassNotFoundException
public void start()
throws org.osgi.framework.BundleException
start in interface org.osgi.framework.Bundleorg.osgi.framework.BundleException
public void start(int options)
throws org.osgi.framework.BundleException
start in interface org.osgi.framework.Bundleorg.osgi.framework.BundleException
public void stop()
throws org.osgi.framework.BundleException
stop in interface org.osgi.framework.Bundleorg.osgi.framework.BundleException
public void stop(int options)
throws org.osgi.framework.BundleException
stop in interface org.osgi.framework.Bundleorg.osgi.framework.BundleException
public void uninstall()
throws org.osgi.framework.BundleException
uninstall in interface org.osgi.framework.Bundleorg.osgi.framework.BundleException
public void update()
throws org.osgi.framework.BundleException
update in interface org.osgi.framework.Bundleorg.osgi.framework.BundleException
public void update(InputStream in)
throws org.osgi.framework.BundleException
update in interface org.osgi.framework.Bundleorg.osgi.framework.BundleExceptionpublic org.osgi.framework.Version getVersion()
getVersion in interface org.osgi.framework.Bundlepublic Map getSignerCertificates(int signerType)
getSignerCertificates in interface org.osgi.framework.Bundlepublic org.osgi.framework.BundleContext getContext()
public org.osgi.framework.BundleContext getBundleContext()
getBundleContext in interface org.osgi.framework.Bundlepublic String toString()
toString in class Objectpublic void setLocation(String location)
location - bundle locationpublic void setClassLoader(ClassLoader loader)
loader - mock bundle class loader
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||