org.springframework.osgi.mock
Class MockBundle
java.lang.Object
org.springframework.osgi.mock.MockBundle
- All Implemented Interfaces:
- Bundle
- Direct Known Subclasses:
- EntryLookupControllingMockBundle
public class MockBundle
- extends Object
- implements Bundle
Bundle Mock.
The mock will the thread current classloader for loading
classes/resources.
- Author:
- Costin Leau
MockBundle
public MockBundle()
MockBundle
public MockBundle(Dictionary headers)
MockBundle
public MockBundle(BundleContext context)
MockBundle
public MockBundle(String symName)
MockBundle
public MockBundle(String symName,
Dictionary headers,
BundleContext context)
findEntries
public Enumeration findEntries(String path,
String filePattern,
boolean recurse)
- Delegates to the classloader. Identical to classLoader.getResources(path +
filePattern);
- Specified by:
findEntries
in interface Bundle
- See Also:
Bundle.findEntries(java.lang.String,
java.lang.String, boolean)
getBundleId
public long getBundleId()
- Specified by:
getBundleId
in interface Bundle
setBundleId
public void setBundleId(long bundleId)
getEntry
public URL getEntry(String name)
- Specified by:
getEntry
in interface Bundle
getEntryPaths
public Enumeration getEntryPaths(String path)
- Specified by:
getEntryPaths
in interface Bundle
getHeaders
public Dictionary getHeaders()
- Specified by:
getHeaders
in interface Bundle
getHeaders
public Dictionary getHeaders(String locale)
- Specified by:
getHeaders
in interface Bundle
getLastModified
public long getLastModified()
- Specified by:
getLastModified
in interface Bundle
getLocation
public String getLocation()
- Specified by:
getLocation
in interface Bundle
getRegisteredServices
public ServiceReference[] getRegisteredServices()
- Specified by:
getRegisteredServices
in interface Bundle
getResource
public URL getResource(String name)
- Specified by:
getResource
in interface Bundle
getResources
public Enumeration getResources(String name)
throws IOException
- Specified by:
getResources
in interface Bundle
- Throws:
IOException
getServicesInUse
public ServiceReference[] getServicesInUse()
- Specified by:
getServicesInUse
in interface Bundle
getState
public int getState()
- Specified by:
getState
in interface Bundle
getSymbolicName
public String getSymbolicName()
- Specified by:
getSymbolicName
in interface Bundle
hasPermission
public boolean hasPermission(Object permission)
- Specified by:
hasPermission
in interface Bundle
loadClass
public Class loadClass(String name)
throws ClassNotFoundException
- Specified by:
loadClass
in interface Bundle
- Throws:
ClassNotFoundException
start
public void start()
throws BundleException
- Specified by:
start
in interface Bundle
- Throws:
BundleException
stop
public void stop()
throws BundleException
- Specified by:
stop
in interface Bundle
- Throws:
BundleException
uninstall
public void uninstall()
throws BundleException
- Specified by:
uninstall
in interface Bundle
- Throws:
BundleException
update
public void update()
throws BundleException
- Specified by:
update
in interface Bundle
- Throws:
BundleException
update
public void update(InputStream in)
throws BundleException
- Specified by:
update
in interface Bundle
- Throws:
BundleException
getContext
public BundleContext getContext()
getBundleContext
public BundleContext getBundleContext()
- Specified by:
getBundleContext
in interface Bundle
toString
public String toString()
- Overrides:
toString
in class Object
setLocation
public void setLocation(String location)
Copyright © 2006-2008 Spring Framework. All Rights Reserved.