|
Oracle® Coherence Java API Reference v3.5 E14977-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
com.tangosol.util.Base
com.tangosol.coherence.servlet.WebPluginInstaller.ApplyPatch
public abstract static class WebPluginInstaller.ApplyPatch
Abstract base class for all command line utilities that modify web container libraries to support extension.
Field Summary | |
---|---|
static byte[] |
BLOCK_BUF The buffer to use for buffered I/O. |
static int |
BLOCK_SIZE The size (in bytes) to perform buffered I/O on. |
static java.lang.String |
INSTALL_DESCRIPTOR The name of the XML file that contains information about the plugin installation. |
protected java.io.File |
m_fileLib The target web container library file. |
static java.lang.String |
MANIFEST_NAME The JAR manifest file name. |
Constructor Summary | |
---|---|
WebPluginInstaller.ApplyPatch() Default constructor. |
Method Summary | |
---|---|
protected java.lang.String |
convertClassToEntry(java.lang.String sClass) Convert the given Java class name to its corresponding Jar entry name. |
protected java.lang.String |
convertEntryToClass(java.lang.String sEntry) Convert the given Jar entry name to its corresponding Java class name. |
protected void |
copyEntry(ApplicationEntry entry, ApplicationReader reader, ApplicationWriter writer) Copy an entry from one application archive to another. |
protected void |
createDelegateEntry(ApplicationEntry entry, ApplicationReader reader, ApplicationWriter writer) Create a new delegate class entry that extends the given class entry and delegates all methods to a wrapped instance of the class entry. |
protected void |
createDelegateMethod(ClassFile classfile, Method method, java.lang.String sClass, Method methodGet) Creates a delegate method in the given ClassFile that delegates the given method to the object returned by the given accessor method. |
protected void |
extendEntry(ApplicationEntry entry, ApplicationReader reader, ApplicationWriter writer) Process the given class entry, making any non-private final methods non-final and if necessary, adding a default contructor. |
abstract java.lang.String |
getContainerName() Return the name of the target web container for this utility. |
java.io.File |
getLibrary() Return the library to be patched by this utility. |
abstract java.lang.String |
getLibraryName() Return the name of the web container library modified by this utility. |
abstract void |
init(java.io.File fileDir) Initialize the utility with the installation directory of the target web container. |
void |
install() Install extension classes. |
protected abstract void |
processEntry(ApplicationEntry entry, ApplicationReader reader, ApplicationWriter writer) Perform any necessary processing on the given class entry. |
protected byte[] |
readEntry(ApplicationEntry entry, ApplicationReader reader) Read an entry and return its content. |
protected java.lang.String |
readManifestAttribute(java.io.File fileJar, java.lang.String sName) Read and return the value of the main Manifest attribute with the given name from the Manifest file contained in the specified JAR file. |
protected void |
setLibrary(java.io.File fileLib) Set the library to be patched by this utility. |
void |
uninstall() Uninstall extension classes. |
protected void |
writeEntry(ApplicationEntry entry, ApplicationWriter writer, byte[] ab) Write the contents of an entry. |
Field Detail |
---|
public static final java.lang.String INSTALL_DESCRIPTOR
public static final int BLOCK_SIZE
public static final byte[] BLOCK_BUF
public static final java.lang.String MANIFEST_NAME
protected java.io.File m_fileLib
Constructor Detail |
---|
public WebPluginInstaller.ApplyPatch()
Method Detail |
---|
public abstract void init(java.io.File fileDir)
install()
or uninstall()
is called. If the given directory does not exist or is not an installation directory of a web container of the appropriate type, an exception must be thrown. Implementations of this method must call setLibrary(File)
with the resolved target web container library before returning.fileDir
- the installation directory of the target web containerpublic abstract java.lang.String getContainerName()
public abstract java.lang.String getLibraryName()
protected abstract void processEntry(ApplicationEntry entry, ApplicationReader reader, ApplicationWriter writer) throws java.io.IOException
entry
- the ApplicationEntry to processreader
- the ApplicationReader used to read from a JAR filewriter
- the ApplicationWriter used to write to a JAR filejava.io.IOException
- on processing errorpublic void install()
public void uninstall()
protected java.lang.String convertClassToEntry(java.lang.String sClass)
sClass
- the Java class name to convertprotected java.lang.String convertEntryToClass(java.lang.String sEntry)
sEntry
- the Jar entry name to convertprotected java.lang.String readManifestAttribute(java.io.File fileJar, java.lang.String sName)
fileJar
- the File object that represents the target JAR filesName
- the name of the main Manifest attribute to readprotected byte[] readEntry(ApplicationEntry entry, ApplicationReader reader) throws java.io.IOException
entry
- the ApplicationEntry to processreader
- the ApplicationReader to read from a JAR filejava.io.IOException
- on I/O errorprotected void writeEntry(ApplicationEntry entry, ApplicationWriter writer, byte[] ab) throws java.io.IOException
entry
- the ApplicationEntry to processwriter
- the ApplicationWriter to write to a JAR fileab
- the entry contents, as a byte arrayjava.io.IOException
- on I/O errorprotected void copyEntry(ApplicationEntry entry, ApplicationReader reader, ApplicationWriter writer) throws java.io.IOException
entry
- the ApplicationEntry to processreader
- the ApplicationReader to read from a JAR filewriter
- the ApplicationWriter to write to a JAR filejava.io.IOException
- on I/O errorprotected void extendEntry(ApplicationEntry entry, ApplicationReader reader, ApplicationWriter writer) throws java.io.IOException
entry
- the ApplicationEntry to processreader
- the ApplicationReader used to read from a JAR filewriter
- the ApplicationWriter used to write to a JAR filejava.io.IOException
- on processing errorprotected void createDelegateEntry(ApplicationEntry entry, ApplicationReader reader, ApplicationWriter writer) throws java.io.IOException
entry
- the ApplicationEntry for which a delegate is createdreader
- the ApplicationReader used to read from a JAR filewriter
- the ApplicationWriter used to write to a JAR filejava.io.IOException
- on processing errorprotected void createDelegateMethod(ClassFile classfile, Method method, java.lang.String sClass, Method methodGet)
classfile
- the ClassFile to which to add the delegate methodmethod
- the method to delegatesClass
- the name of the class in which the target method is declaredmethodGet
- the accessor method that returns the target objectpublic java.io.File getLibrary()
protected void setLibrary(java.io.File fileLib)
fileLib
- the library to be patched
|
Oracle® Coherence Java API Reference v3.5 E14977-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |