public class LibraryService extends BasicService implements ILibraryService, IPropertiesProvider
LIBRARY_SERVICE
EMPTY_SERVICES
Constructor and Description |
---|
LibraryService(IServiceProvider provider)
Creates a new LibraryService.
|
LibraryService(Object[] urls,
IServiceProvider provider)
Creates a new LibraryService.
|
LibraryService(Object[] urls,
IServiceProvider provider,
Map properties)
Creates a new LibraryService.
|
Modifier and Type | Method and Description |
---|---|
void |
addLibraryServiceListener(ILibraryServiceListener listener)
Add an Library Service listener.
|
void |
addPath(String path)
Add a path.
|
void |
addURL(URL url)
Add a new url.
|
IFuture<List<URL>> |
getAllURLs()
Get all urls (managed and non-managed).
|
IFuture<byte[]> |
getClassDefinition(String name)
Get a class definition.
|
ClassLoader |
getClassLoader()
Returns the current ClassLoader
|
IFuture<List<URL>> |
getNonManagedURLs()
Get other contained (but not directly managed) URLs.
|
IFuture<List<String>> |
getNonManagedURLStrings()
Get the non-managed classpath entries.
|
IFuture<Properties> |
getProperties()
Write current state into properties.
|
IFuture<List<URL>> |
getURLs()
Get all managed entries as URLs.
|
IFuture<List<String>> |
getURLStrings()
Get the non-managed classpath entries as strings.
|
static int |
indexOfFilename(String url,
List urlstrings)
Test if a file name is contained.
|
void |
removeLibraryServiceListener(ILibraryServiceListener listener)
Remove an Library Service listener.
|
void |
removeURL(URL url)
Remove a url.
|
void |
removeURLCompletely(URL url)
Remove a url completely (all references).
|
IFuture<Void> |
setProperties(Properties props)
Update from given properties.
|
IFuture<Void> |
shutdownService()
Shutdown the service.
|
IFuture<Void> |
startService()
Start the service.
|
static URL |
toURL(Object url)
Convert a file/string/url.
|
static File |
urlToFile(String url)
Convert an URL to a file.
|
createServiceIdentifier, createServiceIdentifier, equals, generateServiceName, getPropertyMap, getServiceIdentifier, isValid, setPropertyMap
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getPropertyMap, getServiceIdentifier, isValid
public LibraryService(IServiceProvider provider)
public LibraryService(Object[] urls, IServiceProvider provider)
urls
- Urls may be specified as java.net.URLs, java.io.Files or java.lang.Strings.
Strings are interpreted as relative files (relative to current directory),
absolute files or URLs (whatever can be found).public LibraryService(Object[] urls, IServiceProvider provider, Map properties)
urls
- Urls may be specified as java.net.URLs, java.io.Files or java.lang.Strings.
Strings are interpreted as relative files (relative to current directory),
absolute files or URLs (whatever can be found).public void addPath(String path)
path
- The path.public void addURL(URL url)
addURL
in interface ILibraryService
url
- The url.public void removeURL(URL url)
removeURL
in interface ILibraryService
url
- The url.public void removeURLCompletely(URL url)
removeURLCompletely
in interface ILibraryService
url
- The url.public IFuture<List<URL>> getURLs()
getURLs
in interface ILibraryService
public IFuture<List<URL>> getNonManagedURLs()
getNonManagedURLs
in interface ILibraryService
public IFuture<List<URL>> getAllURLs()
getAllURLs
in interface ILibraryService
public ClassLoader getClassLoader()
getClassLoader
in interface ILibraryService
public IFuture<Void> startService()
startService
in interface IInternalService
startService
in class BasicService
public IFuture<Void> shutdownService()
shutdownService
in interface IInternalService
shutdownService
in class BasicService
listener
- The listener.public void addLibraryServiceListener(ILibraryServiceListener listener)
addLibraryServiceListener
in interface ILibraryService
listener
- The listener to be added.public void removeLibraryServiceListener(ILibraryServiceListener listener)
removeLibraryServiceListener
in interface ILibraryService
listener
- The listener to be removed.public IFuture<List<String>> getURLStrings()
getURLStrings
in interface ILibraryService
public IFuture<List<String>> getNonManagedURLStrings()
getNonManagedURLStrings
in interface ILibraryService
public IFuture<byte[]> getClassDefinition(String name)
getClassDefinition
in interface ILibraryService
name
- The class name.public IFuture<Void> setProperties(Properties props)
setProperties
in interface IPropertiesProvider
public IFuture<Properties> getProperties()
getProperties
in interface IPropertiesProvider
public static int indexOfFilename(String url, List urlstrings)
Copyright © 2012. All Rights Reserved.