JPF 1.5.1

org.java.plugin.standard
Class ShadingPathResolver

java.lang.Object
  extended by org.java.plugin.standard.StandardPathResolver
      extended by org.java.plugin.standard.ShadingPathResolver
All Implemented Interfaces:
PathResolver

public class ShadingPathResolver
extends StandardPathResolver

This implementation of path resolver makes "shadow copy" of plug-in resources before resolving paths to them, this helps avoid locking of local resources and run native code from remote locations.

Configuration parameters

This path resolver implementation supports following configuration parameters:

shadowFolder
Path to the folder where to copy resources to prevent their locking. By default this will be System.getProperty("java.io.tmpdir") + "/.jpf-shadow". Please note that this folder will be maintained automatically by the Framework and might be cleared without any confirmation or notification. So it is strongly not recommended to use plug-ins folder (or other sensitive application directory) as shadow folder, this may lead to losing your data.
unpackMode
If always, "JAR'ed" or "ZIP'ed" plug-ins will be un-compressed to the shadow folder, if never, they will be just copied, if smart, the processing depends on plug-in content - if plug-in contains JAR libraries, it will be un-packed, otherwise just copied to shadow folder. It is also possible to add boolean "unpack" attribute to plug-in manifest, in this case, it's value will be taken into account. The default parameter value is smart.

Version:
$Id: ShadingPathResolver.java,v 1.5 2007/05/13 16:31:48 ddimon Exp $

Field Summary
 
Fields inherited from class org.java.plugin.standard.StandardPathResolver
log
 
Constructor Summary
ShadingPathResolver()
           
 
Method Summary
 void configure(ExtendedProperties config)
          No configuration parameters expected in this implementation.
protected  java.net.URL getBaseUrl(UniqueIdentity uid)
           
 void registerContext(Identity idt, java.net.URL url)
          This implementation accepts PluginDescriptor or PluginFragment as valid plug-in elements.
 java.net.URL resolvePath(Identity idt, java.lang.String path)
          Should resolve given path to URL for a given identity.
 void unregisterContext(java.lang.String id)
          Unregisters plug-in element from this path resolver.
 
Methods inherited from class org.java.plugin.standard.StandardPathResolver
getRegisteredContext, isContextRegistered, maybeJarUrl, resolvePath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShadingPathResolver

public ShadingPathResolver()
Method Detail

configure

public void configure(ExtendedProperties config)
               throws java.lang.Exception
Description copied from class: StandardPathResolver
No configuration parameters expected in this implementation.

Specified by:
configure in interface PathResolver
Overrides:
configure in class StandardPathResolver
Parameters:
config - path resolver configuration data
Throws:
java.lang.Exception - if any error has occurred
See Also:
PathResolver.configure(ExtendedProperties)

registerContext

public void registerContext(Identity idt,
                            java.net.URL url)
Description copied from class: StandardPathResolver
This implementation accepts PluginDescriptor or PluginFragment as valid plug-in elements.

Specified by:
registerContext in interface PathResolver
Overrides:
registerContext in class StandardPathResolver
Parameters:
idt - plug-in element
url - "home" URL for a given plug-in element
See Also:
StandardPathResolver.registerContext( org.java.plugin.registry.Identity, java.net.URL)

unregisterContext

public void unregisterContext(java.lang.String id)
Description copied from interface: PathResolver
Unregisters plug-in element from this path resolver.

Specified by:
unregisterContext in interface PathResolver
Overrides:
unregisterContext in class StandardPathResolver
Parameters:
id - plug-in element identifier
See Also:
StandardPathResolver.unregisterContext( java.lang.String)

resolvePath

public java.net.URL resolvePath(Identity idt,
                                java.lang.String path)
Description copied from interface: PathResolver
Should resolve given path to URL for a given identity.

Specified by:
resolvePath in interface PathResolver
Overrides:
resolvePath in class StandardPathResolver
Parameters:
idt - plug-in element for which to resolve path
path - path to be resolved
Returns:
resolved absolute URL
See Also:
PathResolver.resolvePath( org.java.plugin.registry.Identity, java.lang.String)

getBaseUrl

protected java.net.URL getBaseUrl(UniqueIdentity uid)

JPF 1.5.1

Copyright © 2004-2007 Dmitry Olshansky. All Rights Reserved.