|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.sling.jcr.classloader.internal.DynamicClassLoaderProviderImpl
public class DynamicClassLoaderProviderImpl
The DynamicClassLoaderProviderImpl
provides
a class loader which loads classes from configured paths
in the repository.
In addition it implements ClassLoaderWriter
and
supports writing class files to the repository.
Field Summary | |
---|---|
static String |
CLASS_PATH_DEFAULT
|
static String |
CLASS_PATH_PROP
|
static String |
OWNER_DEFAULT
Default class loader owner. |
static String |
OWNER_PROP
|
Constructor Summary | |
---|---|
DynamicClassLoaderProviderImpl()
|
Method Summary | |
---|---|
protected void |
activate(org.osgi.service.component.ComponentContext componentContext)
Activate this component. |
protected void |
deactivate(org.osgi.service.component.ComponentContext componentContext)
Deactivate this component |
boolean |
delete(String name)
Delete the class/resource |
ClassLoader |
getClassLoader(ClassLoader parent)
Return the class loader used for dynamic class loading. |
protected String[] |
getClassPaths()
Return the configured class paths |
InputStream |
getInputStream(String fileName)
Get the input stream for a class or resource handled by the underlying class loader. |
long |
getLastModified(String fileName)
Return the last modified for the class or resource. |
OutputStream |
getOutputStream(String name)
Get the output stream for a class or resource handled by the underlying class loader. |
protected String |
getOwnerId()
Return the owner id |
javax.jcr.Session |
getReadSession()
Return the read session. |
void |
release(ClassLoader classLoader)
Release the provided class loader. |
boolean |
rename(String oldName,
String newName)
Rename a class/resource. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String CLASS_PATH_PROP
public static final String CLASS_PATH_DEFAULT
public static final String OWNER_PROP
public static final String OWNER_DEFAULT
Constructor Detail |
---|
public DynamicClassLoaderProviderImpl()
Method Detail |
---|
public ClassLoader getClassLoader(ClassLoader parent)
DynamicClassLoaderProvider
DynamicClassLoaderProvider.release(ClassLoader)
method.
getClassLoader
in interface DynamicClassLoaderProvider
parent
- The parent class loader for this dynamic class loader.
DynamicClassLoaderProvider.getClassLoader(ClassLoader)
public void release(ClassLoader classLoader)
DynamicClassLoaderProvider
release
in interface DynamicClassLoaderProvider
classLoader
- The class loader.DynamicClassLoaderProvider.release(java.lang.ClassLoader)
public boolean delete(String name)
ClassLoaderWriter
delete
in interface ClassLoaderWriter
name
- The path of the class/resource.
true
if the resource exists and could be deleted,
false
otherwise.ClassLoaderWriter.delete(java.lang.String)
public OutputStream getOutputStream(String name)
ClassLoaderWriter
getOutputStream
in interface ClassLoaderWriter
name
- The path of the class/resource.
ClassLoaderWriter.getOutputStream(java.lang.String)
public boolean rename(String oldName, String newName)
ClassLoaderWriter
rename
in interface ClassLoaderWriter
oldName
- The path of the class/resource.newName
- The new path.
true
if the renaming has been successful.ClassLoaderWriter.rename(java.lang.String, java.lang.String)
public InputStream getInputStream(String fileName) throws IOException
ClassLoaderWriter
getInputStream
in interface ClassLoaderWriter
fileName
- The path of the class/resource.
IOException
- If the resource/class does not exist.ClassLoaderWriter.getInputStream(java.lang.String)
public long getLastModified(String fileName)
ClassLoaderWriter
getLastModified
in interface ClassLoaderWriter
fileName
- The path of the class/resource.
-1
if
the information can't be detected.ClassLoaderWriter.getLastModified(java.lang.String)
protected void activate(org.osgi.service.component.ComponentContext componentContext)
componentContext
- The component context.protected void deactivate(org.osgi.service.component.ComponentContext componentContext)
componentContext
- The component context.protected String getOwnerId()
protected String[] getClassPaths()
public javax.jcr.Session getReadSession() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |