org.springframework.osgi.web.extender.deployer.support
Class DefaultContextPathStrategy
java.lang.Object
org.springframework.osgi.web.extender.deployer.support.DefaultContextPathStrategy
- All Implemented Interfaces:
- ContextPathStrategy
public class DefaultContextPathStrategy
- extends Object
- implements ContextPathStrategy
ContextPathStrategy
default implementation that takes into account
the OSGi bundle properties for determining the war context path.
This implementation iterates through following properties, considering
the first one that is available in the following order:
- bundle location - if present, the location filename is returned as the
context path.
- bundle name - if present, it is used as a fall back to the bundle
location.
- bundle symbolic name - if present, it used as a fallback to the bundle
name.
- bundle identity - if neither of the properties above is present, the
bundle object identity will be used as context path.
- Author:
- Costin Leau
- See Also:
Bundle.getLocation()
,
Constants.BUNDLE_NAME
,
Bundle.getSymbolicName()
,
System.identityHashCode(Object)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultContextPathStrategy
public DefaultContextPathStrategy()
getContextPath
public String getContextPath(Bundle bundle)
- Description copied from interface:
ContextPathStrategy
- Obtains the context path for the given OSGi bundle. The returned String
should be not null and should not contain any spaces.
- Specified by:
getContextPath
in interface ContextPathStrategy
- Parameters:
bundle
- OSGi bundle deployed as war
- Returns:
- the not-null context path (without any spaces) associated with
the given bundle
Copyright © 2006-2008 Spring Framework. All Rights Reserved.