@Service(name="osgi") @Singleton public class OSGiArchiveHandler extends GenericHandler implements CompositeHandler
| Modifier and Type | Field and Description |
|---|---|
static String |
DECORATED_URL |
static String |
RB_NAME |
habitat| Constructor and Description |
|---|
OSGiArchiveHandler() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
accept(ReadableArchive source,
String entryName) |
void |
expand(ReadableArchive source,
WritableArchive target,
DeploymentContext context)
Overriding the expand method of base class(GenericHandler) in order to
support allowing wrapping of non-OSGi bundles when --type=osgi option is
used in deploy command or GUI.
|
String |
getArchiveType()
This method is semantically equivalent to
ArchiveDetector.getArchiveType() except that
this method returns string equivalent of ArchiveType because of backward compatibility reasons. |
ClassLoader |
getClassLoader(ClassLoader parent,
DeploymentContext context)
Creates a classloader that can load code from inside the archive.
|
String |
getDefaultApplicationName(ReadableArchive archive,
DeploymentContext context)
Returns the default application name usable for identifying the archive.
|
boolean |
handles(ReadableArchive archive)
Returns true if this handler understands the specified archive and
can process it.
|
void |
initCompositeMetaData(DeploymentContext context) |
boolean |
requiresAnnotationScanning(ReadableArchive archive)
Returns whether this archive requires annotation scanning.
|
getClassPathURIs, getDefaultApplicationName, getDefaultApplicationNameFromArchiveName, getManifest, getVersionIdentifierclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetClassPathURIs, getDefaultApplicationName, getManifest, getVersionIdentifierpublic static final String RB_NAME
public static final String DECORATED_URL
public String getArchiveType()
ArchiveHandlerArchiveDetector.getArchiveType() except that
this method returns string equivalent of ArchiveType because of backward compatibility reasons.getArchiveType in interface ArchiveHandlerArchiveDetector.getArchiveType()public boolean accept(ReadableArchive source, String entryName)
accept in interface CompositeHandlerpublic void initCompositeMetaData(DeploymentContext context)
initCompositeMetaData in interface CompositeHandlerpublic boolean handles(ReadableArchive archive) throws IOException
ArchiveHandlerhandles in interface ArchiveHandlerIOException - The implementation of this method is expected to interact with
the given archive, and if methods on ReadableArchive
throws an IOException, it can be simply tunneled to the caller.public ClassLoader getClassLoader(ClassLoader parent, DeploymentContext context)
ArchiveHandlergetClassLoader in interface ArchiveHandlerparent - The newly created classloader to be returned must eventually delegate to this classloader.
(This classloader is capable of resolving APIs and other things that the containerpublic String getDefaultApplicationName(ReadableArchive archive, DeploymentContext context)
GenericHandlerThis default implementation returns the name portion of the archive's URI. The archive's name depends on the type of archive (FileArchive vs. JarArchive vs. MemoryMappedArchive, for example).
A concrete subclass can override this method to provide an alternative way of deriving the default application name.
getDefaultApplicationName in interface ArchiveHandlergetDefaultApplicationName in class GenericHandlerarchive - the archive for which the default name is neededcontext - deployment contextpublic void expand(ReadableArchive source, WritableArchive target, DeploymentContext context) throws IOException
expand in interface ArchiveHandlerexpand in class GenericHandlersource - of the expandingtarget - of the expandingcontext - deployment contextIOException - when the archive is corruptedpublic boolean requiresAnnotationScanning(ReadableArchive archive)
requiresAnnotationScanning in interface ArchiveHandlerrequiresAnnotationScanning in class GenericHandlerarchive - fileCopyright © 2019. All rights reserved.